`

Eclipse Preference Scope

 
阅读更多

Eclipse Preference Scope

INSTANCE - The instance scope can also be thought of as "workspace". That is, the preferences which are stored in this scope are stored per workspace, or per running instance of Eclipse. This scope corresponds to the default location of preferences in Eclipse 2.1. The instance area is derived from the location returned by org.eclipse.core.runtime.Platform#getInstanceLocation(). Preferences stored in this scope will not be available to other running instances of Eclipse.

CONFIGURATION - The configuration scope is used to store preferences on a per configuration level. Being able store preferences per configuration means that all workspaces share the same preferences. For instance, if you are an Eclipse developer and you have a single Eclipse install but you have multiple workspaces for different projects/branches that you are working on, the preferences stored in the configuration scope will be shared between these workspaces. The configuration area is derived from the location returned by org.eclipse.core.runtime.Platform#getConfigurationLocation().

DEFAULT - The default preference scope was initially created to provide a backwards compatibility story for the plug-in customization code in Eclipse 2.1. Preferences stored in the default scope are not persisted to disk and are a part of the plug-in customization story.

PROJECT - There was a request for per project preferences so the project scope handles this. Preferences which are stored in this scope are shared stored in the project content area and are therefore automatically shared with the repository. This enables items like java compiler settings to be shared between team members working on the same project.

INSTANCE and CONFIGURATION are used in most situations.
Store data in Preference:
INSTANCE
...
Preferences preferences = new InstanceScope().getNode("foo.bar.MyPlugin");
preferences.put("key", "value");
try {
       preferences.flush();
 } catch (BackingStoreException e) {
       e.printStackTrace();
 }
...
CONFIGURATION
Preferences preferences = new ConfigurationScope().getNode("foo.bar.MyPlugin");
preferences.put("key", "value");
try {
       preferences.flush();
 } catch (BackingStoreException e) {
       e.printStackTrace();
 }
...

Load data in Preference:
preferences.get("key", "");

分享到:
评论

相关推荐

    eclipse preference config export

    eclipse preference config export. font size/background/color

    theme_preference_eclipse

    Eclipse中直接应用Sublime主题界面

    jd-eclipse Eclipse官方反编译插件jdeclipse_update_site

    6,重启之后,在窗口菜单栏点击Widow->Preference->General->Editors->File Associations,将FileType里的*.class和*.class without source的Associated editors下面的Class File Editor设置成default即可。

    Android 自定义preference组件

    上篇博文代码实现了Android自带的preference组件,本文将通过实例讲解自定义preference组件。 主要通过以下几步来实现: 1.定义需要的layout布局res->layout->xml文件; 2.通过继承Preference类,来实现自定义...

    android Preference自定义样式

    android Preference自定义样式

    eclipse代码折叠插件

     Windows→Preference→Java→Editor→Folding    勾选“Enable folding”,在Select folding to use后面选择Coffee Bytes Java Folding(如果您的eclipse中没有Select folding to use选项,请看第4个步骤,否则...

    Android代码-Material Design风格Preference UI

    Based on support-preference from Android Support Library, adding a lot of exciting features. Sample How to use add dependencies // replace with version above implementation 'moe.shizuku.preference...

    Eclipse color Theme离线安装

    Eclipse color Theme离线安装 评分: 解压缩到eclipse目录下. 在window--->preference-->appearance-->color theme中选择

    eclipse-Color-Theme黑色主题安装包.zip

    eclipse-Color-Theme黑色主题安装包 内有使用说明 eclipse-color-theme-黑色界面主题离线安装包: 解压缩到eclipse目录下. 在window--->preference-->appearance-->color theme中选择

    Android Preference组件使用

    Preference主要实现一些配置数据,一些我们上次点击选择的内容,我们希望在下次应用调起的时候依然有效,无须用户再一次进行配置或选择。Android提供preference这个键值对的方式来处理这种情况,自动保存这些数据,...

    eclipse color theme.zip

    Eclipse color Theme离线安装(亲测可行) 1:下载更新包,解压后将features和plugins放在eclipse安装目录下的...2:在window--->preference-->appearance-->color theme中选择sublimeText2(有很多,可以自己选择)

    eclipse 代码折叠插件 _com.cb.eclipse.folding_1.0.6

    一、Eclipse代码折叠插件 关闭Eclipse,把下载到的插件...1.打开windows——Preference 2.设置Folding值,最后一个选项,打钩。 3.User Defined Regions添加开始和结束标签。 三、设置完成后,重启Eclipse

    eclipse代码折叠插件工具

    Preference --> Java --> Editor --> Floding 在打开的右侧面板中进行代码折叠设置: Select folding to use 的下拉框选择新的 Coffee Bytes java folding (如果没有,重启eclipse) 下面面板的选项可以...

    Android应用Preference

    Preference组件是android的SharePreferences的衍生品,Preference组件的状态值是默认永久的保存在/data/data/包名/shared_prefs 目录下,因为Android系统的Setting应用及一些符合Android设计思想的应用的设置界面...

    libgdx Preference

    libgdx Preference

    preference测试

    preference测试

    eclipse-Color-Theme黑色主题离线安装包.zip

    eclipse-color-theme-黑色界面主题离线安装包: 解压缩到eclipse目录下. 在window--->preference-->appearance-->color theme中选择

    eclipse集成JAD反编绎工具

    具体设置如下:window--preference--general--editors--file associations 上面选中*.class,下面设置其默认的编辑器就行了. 5.反编绎打开方式:如鼠标焦点放到需要查看源代码地方,按F3(可查看eclipse源码快捷键)就能...

    eclipse背景字体配置文件

    黑色主题epf格式文件用eclipse import ->general->preference jar包文件 直接放入eclipse目录下的dropins\plugins

Global site tag (gtag.js) - Google Analytics