/** * Sets the plugin ID and loads preferences. * @param plugin The ID of the Eclipse plugin whose preferences should be * altered. */ @SuppressWarnings("deprecation") public void setPluginId(String plugin) { preferences = new InstanceScope().getNode(plugin); }
/** * Return the preferences node in the instance scope */ IEclipsePreferences getInstancePreferences(){ return new InstanceScope().getNode(ID); }
/** * Accessor for the preference store for this bundle * * @return The {@link IEclipsePreferences} preference node at the instance scope for this bundle or null if it does * not exist. */ public static IEclipsePreferences getPreferences() { return new InstanceScope().getNode(TracingConstants.BUNDLE_ID); }
private IEclipsePreferences getPreferences() { return new InstanceScope().getNode(FrameworkUtil.getBundle( ThemeEngine.class).getSymbolicName()); }
public org.osgi.service.prefs.Preferences getInstancePreferences() { return new InstanceScope().getNode(getBundle().getSymbolicName()); }
/** * Saves INSTANCE preferences */ public static void save() { try { new InstanceScope().getNode(PDE.PLUGIN_ID).flush(); } catch (BackingStoreException e) { } } }
private void installPreferenceListener() { fPreferenceChangeListener= new IPreferenceChangeListener() { public void preferenceChange(PreferenceChangeEvent event) { if (event.getKey().equals(CleanUpConstants.SHOW_CLEAN_UP_WIZARD)) { updateActionLabel(); } } }; new InstanceScope().getNode(JavaUI.ID_PLUGIN).addPreferenceChangeListener(fPreferenceChangeListener); }
public void dispose() { if (fPreferenceChangeListener != null) { new InstanceScope().getNode(JavaUI.ID_PLUGIN).removePreferenceChangeListener(fPreferenceChangeListener); fPreferenceChangeListener= null; } } }
private PreferenceListenerInstaller(PreferenceableOption2<?> option) { this.option = option; String qualifier = option.getPluginId(); INSTANCE_SCOPE_INSTANCE.getNode(qualifier).addPreferenceChangeListener(this); }
static IEclipsePreferences[] getProxyPreferenceStore(){ if(proxyPreferences==null){ proxyPreferences=new IEclipsePreferences[] { new InstanceScope().getNode("org.eclipse.team.cvs.ui"), //$NON-NLS-1$ new DefaultScope().getNode("org.eclipse.team.cvs.ui") //$NON-NLS-1$ }; } return proxyPreferences; }
/** * Local modules are mapped to deployed applications, represented by * cloud modules, by mapping the local module ID (typically, the module * type + local module name) to the deployed application name. * @return map containing local module ID (key) to deployed cloud * application name (value) */ private Map<String, String> getLocalModuleToCloudModuleMapping() { IEclipsePreferences node = new InstanceScope().getNode(CloudFoundryPlugin.PLUGIN_ID); String string = node.get(KEY_MODULE_MAPPING_LIST + ":" + getServerId(), ""); //$NON-NLS-1$ //$NON-NLS-2$ return convertStringToMap(string); }
void updateServerId(String oldServerId, String newServerId) { IEclipsePreferences node = new InstanceScope().getNode(CloudFoundryPlugin.PLUGIN_ID); String string = node.get(KEY_MODULE_MAPPING_LIST + ":" + oldServerId, ""); //$NON-NLS-1$ //$NON-NLS-2$ node.remove(KEY_MODULE_MAPPING_LIST + ":" + oldServerId); //$NON-NLS-1$ node.put(KEY_MODULE_MAPPING_LIST + ":" + newServerId, string); //$NON-NLS-1$ }
/** * @return the current compiler compliance level * @since 3.3 */ private String getCurrentCompilerCompliance() { IEclipsePreferences setting = new InstanceScope().getNode(JavaCore.PLUGIN_ID); if(getContainer() instanceof IWorkbenchPreferenceContainer) { IEclipsePreferences wcs = ((IWorkbenchPreferenceContainer)getContainer()).getWorkingCopyManager().getWorkingCopy(setting); return wcs.get(JavaCore.COMPILER_COMPLIANCE, (String) JavaCore.getDefaultOptions().get(JavaCore.COMPILER_COMPLIANCE)); } else { return JavaCore.getOption(JavaCore.COMPILER_COMPLIANCE); } }
private boolean showWizard() { InstanceScope instanceScope= new InstanceScope(); IEclipsePreferences instanceNode= instanceScope.getNode(JavaUI.ID_PLUGIN); if (instanceNode.get(CleanUpConstants.SHOW_CLEAN_UP_WIZARD, null) != null) return instanceNode.getBoolean(CleanUpConstants.SHOW_CLEAN_UP_WIZARD, true); DefaultScope defaultScope= new DefaultScope(); IEclipsePreferences defaultNode= defaultScope.getNode(JavaUI.ID_PLUGIN); return defaultNode.getBoolean(CleanUpConstants.SHOW_CLEAN_UP_WIZARD, true); }
public static void migrateSSH2Preferences() { Preferences preferences = JSchCorePlugin.getPlugin().getPluginPreferences(); if(!preferences.getBoolean(IConstants.PREF_HAS_MIGRATED_SSH2_PREFS)){ preferences.setValue(IConstants.PREF_HAS_MIGRATED_SSH2_PREFS, true); migrateSSH2Preferences(new InstanceScope().getNode("")); //$NON-NLS-1$ } }
public void initialize() { // First see if there is an http proxy to migrate migrateUpdateHttpProxy(new InstanceScope().getNode(""), true); //$NON-NLS-1$ ((IEclipsePreferences)Activator.getInstance().getInstancePreferences()).addPreferenceChangeListener(this); // Now initialize each proxy type for (int i = 0; i < proxies.length; i++) { ProxyType type = proxies[i]; type.initialize(isProxiesEnabled()); } registerAuthenticator(); }
/** * {@inheritDoc} */ public boolean isEnabled(IScopeContext context) { IEclipsePreferences node; if (hasSettingsInScope(context)) { node= context.getNode(JavaUI.ID_PLUGIN); } else { node= new InstanceScope().getNode(JavaUI.ID_PLUGIN); } IEclipsePreferences defaultNode= new DefaultScope().getNode(JavaUI.ID_PLUGIN); String key= getPreferenceKey(); return node.getBoolean(key, defaultNode.getBoolean(key, false)); }