本文整理汇总了Java中org.eclipse.core.runtime.preferences.ConfigurationScope.INSTANCE属性的典型用法代码示例。如果您正苦于以下问题:Java ConfigurationScope.INSTANCE属性的具体用法?Java ConfigurationScope.INSTANCE怎么用?Java ConfigurationScope.INSTANCE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.core.runtime.preferences.ConfigurationScope
的用法示例。
在下文中一共展示了ConfigurationScope.INSTANCE属性的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getEclipsePreferences
/**
* Returns the eclipse preferences.
* @return the eclipse preferences
*/
public IEclipsePreferences getEclipsePreferences() {
if (eclipsePreferences==null) {
IScopeContext iScopeContext = ConfigurationScope.INSTANCE;
eclipsePreferences = iScopeContext.getNode(PlugInActivator.PLUGIN_ID);
eclipsePreferences.addPreferenceChangeListener(this.getChangeListener());
}
return eclipsePreferences;
}
示例2: getTimeZone
public static TimeZone getTimeZone ()
{
final IScopeContext[] scopeContext = new IScopeContext[] { ConfigurationScope.INSTANCE };
final String tzId = Platform.getPreferencesService ().getString ( PLUGIN_ID, TIME_ZONE_KEY, TimeZone.getDefault ().getID (), scopeContext );
if ( Arrays.asList ( TimeZone.getAvailableIDs () ).contains ( tzId ) )
{
return TimeZone.getTimeZone ( tzId );
}
return TimeZone.getDefault ();
}
示例3: resolveScopeContext
/**
* Resolve the given scheme to a preference scope.
*
* @param scheme the preference scheme
* @return the corresponding preference scope
* @throws IllegalArgumentException if unable to resolve the scheme to a preference scope
*/
private static IScopeContext resolveScopeContext(String scheme) throws IllegalArgumentException {
switch (scheme) {
case "instance":
return InstanceScope.INSTANCE;
case "configuration":
return ConfigurationScope.INSTANCE;
default:
throw new IllegalArgumentException("Unknown scheme: " + scheme);
}
}
示例4: isAutoBuildEnabled
protected static boolean isAutoBuildEnabled() {
IPreferencesService service = Platform.getPreferencesService();
String qualifier = ResourcesPlugin.getPlugin().getBundle().getSymbolicName();
String key = "description.autobuilding";
IScopeContext[] contexts = { InstanceScope.INSTANCE, ConfigurationScope.INSTANCE };
return service.getBoolean(qualifier, key, false, contexts);
}
示例5: isAutoBuildEnabled
protected boolean isAutoBuildEnabled()
{
IPreferencesService service = Platform.getPreferencesService();
String qualifier = ResourcesPlugin.getPlugin().getBundle().getSymbolicName();
String key = "description.autobuilding";
IScopeContext[] contexts = { InstanceScope.INSTANCE, ConfigurationScope.INSTANCE };
return service.getBoolean(qualifier, key, false, contexts);
}
示例6: isAutoBuildEnabled
protected boolean isAutoBuildEnabled()
{
IPreferencesService service = Platform.getPreferencesService();
String qualifier = ResourcesPlugin.getPlugin().getBundle().getSymbolicName();
String key = "description.autobuilding";
IScopeContext[] contexts = { InstanceScope.INSTANCE, ConfigurationScope.INSTANCE};
return service.getBoolean( qualifier, key, false, contexts );
}
示例7: initializeDefaultPreferences
@Override
public void initializeDefaultPreferences() {
// 设置 colors 首选项页的初始值
IPreferenceStore store = Activator.getDefault().getPreferenceStore();
PreferenceConverter.setDefault(store, IColorPreferenceConstant.TAG_FG_COLOR, new RGB(234, 234, 234));
PreferenceConverter.setDefault(store, IColorPreferenceConstant.TAG_BG_COLOR, new RGB(223, 112, 0));
PreferenceConverter.setDefault(store, IColorPreferenceConstant.WRONG_TAG_COLOR, new RGB(255, 0, 0));
PreferenceConverter.setDefault(store, IColorPreferenceConstant.DIFFERENCE_FG_COLOR, new RGB(255, 0, 0));
PreferenceConverter.setDefault(store, IColorPreferenceConstant.DIFFERENCE_BG_COLOR, new RGB(244, 244, 159));
PreferenceConverter.setDefault(store, IColorPreferenceConstant.PT_COLOR, new RGB(255, 0, 0));
PreferenceConverter.setDefault(store, IColorPreferenceConstant.QT_COLOR, new RGB(255, 204, 204));
PreferenceConverter.setDefault(store, IColorPreferenceConstant.MT_COLOR, new RGB(171, 217, 198));
PreferenceConverter.setDefault(store, IColorPreferenceConstant.TM_MATCH101_COLOR, new RGB(255, 255, 204));
PreferenceConverter.setDefault(store, IColorPreferenceConstant.TM_MATCH100_COLOR, new RGB(37, 168, 204));
PreferenceConverter.setDefault(store, IColorPreferenceConstant.TM_MATCH90_COLOR, new RGB(79, 185, 214));
PreferenceConverter.setDefault(store, IColorPreferenceConstant.TM_MATCH80_COLOR, new RGB(114, 199, 222));
PreferenceConverter.setDefault(store, IColorPreferenceConstant.TM_MATCH70_COLOR, new RGB(155, 215, 231));
PreferenceConverter.setDefault(store, IColorPreferenceConstant.TM_MATCH0_COLOR, new RGB(198, 240, 251));
PreferenceConverter.setDefault(store, IColorPreferenceConstant.HIGHLIGHTED_TERM_COLOR, new RGB(170, 255, 85));
// 设置 net.heartsome.cat.common.core 插件中的语言代码初始值
IPreferenceStore corePreferenceStore = new ScopedPreferenceStore(ConfigurationScope.INSTANCE, CoreActivator
.getDefault().getBundle().getSymbolicName());
corePreferenceStore.setDefault(IPreferenceConstants.LANGUAGECODE, LocaleService.getLanguageConfigAsString());
// 设置选择路径对话框的初始值
PlatformUI.getPreferenceStore()
.setDefault(IPreferenceConstants.LAST_DIRECTORY, System.getProperty("user.home"));
ColorConfigLoader.init();
}
示例8: isParamAttrGenerated
private boolean isParamAttrGenerated()
{
IScopeContext[] contexts;
if (project != null)
{
contexts = new IScopeContext[]{
new ProjectScope(project.getProject()), InstanceScope.INSTANCE,
ConfigurationScope.INSTANCE, DefaultScope.INSTANCE
};
}
else
{
contexts = new IScopeContext[]{
InstanceScope.INSTANCE, ConfigurationScope.INSTANCE, DefaultScope.INSTANCE
};
}
for (int j = 0; j < contexts.length; ++j)
{
String value = contexts[j].getNode(JavaCore.PLUGIN_ID)
.get(JavaCore.COMPILER_CODEGEN_METHOD_PARAMETERS_ATTR, null);
if (value != null)
{
value = value.trim();
if (!value.isEmpty())
return "generate".equals(value.trim());
}
}
return false;
}
示例9: onCreateComponent
@Override
protected IJp2pComponent<IManagedPropertyListener<IJp2pProperties, Object>> onCreateComponent(
IJp2pPropertySource<IJp2pProperties> source) {
IPersistedProperties<IJp2pProperties, String,Object> properties = new PersistedProperties( (IJp2pWritePropertySource<IJp2pProperties>) super.getPropertySource(), ConfigurationScope.INSTANCE );
PersistenceService<String,Object> service = new PersistenceService<String,Object>((IJp2pWritePropertySource<IJp2pProperties>) source, properties );
service.start();
return service;
}
示例10: getPreferenceStore
static IPreferenceStore getPreferenceStore() {
return new ScopedPreferenceStore(ConfigurationScope.INSTANCE, PREFERENCE_PATH);
}
示例11: initializeDefaultPreferences
@Override
public void initializeDefaultPreferences()
{
IPreferenceStore store = new ScopedPreferenceStore(ConfigurationScope.INSTANCE, "org.bbaw.bts.app");
System.out.println("Enter in default Preference Initializer");
IEclipsePreferences defaultPrefs = DefaultScope.INSTANCE.getNode("org.bbaw.bts.app");
IEclipsePreferences prefs = DefaultScope.INSTANCE.getNode("org.bbaw.bts.app");
store.setDefault(BTSPluginIDs.PREF_ACTIVE_CORPORA, defaultPrefs.get(BTSPluginIDs.PREF_ACTIVE_CORPORA, null));
prefs.put(BTSPluginIDs.PREF_ACTIVE_CORPORA, defaultPrefs.get(BTSPluginIDs.PREF_ACTIVE_CORPORA, null));
store.setDefault(BTSPluginIDs.PREF_MAIN_CORPUS_KEY, defaultPrefs.get(BTSPluginIDs.PREF_MAIN_CORPUS_KEY, null));
prefs.put(BTSPluginIDs.PREF_ACTIVE_CORPORA, defaultPrefs.get(BTSPluginIDs.PREF_ACTIVE_CORPORA, null));
}
示例12: getScope
public static IScopeContext getScope() {
if (scope == null) {
scope = ConfigurationScope.INSTANCE;
}
return scope;
}
示例13: RailroadViewPreferences
public RailroadViewPreferences() {
preferenceStore = new ScopedPreferenceStore(ConfigurationScope.INSTANCE, "ANTLR Syntax Diagram");
}
示例14: getGlobalPreference
/**
* Set the global preference value for the passed key
*
* @param project
* @param key
* @param value
*/
public static IEclipsePreferences getGlobalPreference() {
IScopeContext context = ConfigurationScope.INSTANCE;
IEclipsePreferences projectPreferences = context.getNode(Activator.PLUGIN_ID);
return projectPreferences;
}