ps:内容来自Eclipse Preferences FAQ。代码简单,直接贴了。
| 1. |
Through the backwards compatibility layer. Again, all the old APIs exist and are fully functional.
|
| 2. | Via navigation from the root node.
If the user knows which scope they wish to store the preference in and knows the path structure for the hierarchy of that scope, then they are able to navigate directly to that preference node and set their preference value. In the example below we are setting the auto-build setting in the INSTANCE scope.
|
| 3. | Through the scope context.
If the user knows which scope they wish to set the preference value in but doesn't know the path structure for that scope, (or prefers not to navigate it themselves) then they can use the convenience methods in IScopeContext to determine the correct preference node. This is the method in which we envision most clients setting preference values. In the example below we are storing the preference in the project preferences for "MyProject".
|

本文介绍了三种在Eclipse中设置自动构建的方法:通过向后兼容层、通过从根节点导航和通过作用域上下文。这些方法适用于不同场景,帮助用户灵活地配置Eclipse的自动构建功能。
330

被折叠的 条评论
为什么被折叠?



