/** * 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); }
@Override public IPreferenceStore getPreferenceStore() { // Create the preference store lazily. if(preferenceStore == null) { // InstanceScope.INSTANCE added in 3.7 preferenceStore = new ScopedPreferenceStore(new InstanceScope(), IMavenConstants.PLUGIN_ID); } return preferenceStore; }
/** * @return the preference store for this bundle * TODO: this is copied from AbstractUIPlugin; need to upgrade to new IPreferencesService */ public IPreferenceStore getPreferenceStore() { // Create the preference store lazily. if ( this.preferenceStore == null) { this.preferenceStore = new ScopedPreferenceStore(new InstanceScope(),getBundle().getSymbolicName()); } return this.preferenceStore; } }
/** * Return the preferences node in the instance scope */ IEclipsePreferences getInstancePreferences(){ return new InstanceScope().getNode(ID); }
private Hashtable loadProfiles() { List list= CleanUpPreferenceUtil.loadProfiles(new InstanceScope()); Hashtable profileIdsTable= new Hashtable(); for (Iterator iterator= list.iterator(); iterator.hasNext();) { Profile profile= (Profile)iterator.next(); profileIdsTable.put(profile.getID(), profile); } return profileIdsTable; }
/** * Returns the line delimiter of the Eclipse platform. * * @return The line delimiter used by the Eclipse platform. * @since 3.3 */ public static String getLineSeparator() { IScopeContext scope = new InstanceScope(); IEclipsePreferences node = scope.getNode(Platform.PI_RUNTIME); return node.get(Platform.PREF_LINE_SEPARATOR, System.getProperty("line.separator")); //$NON-NLS-1$ } }
/** * {@inheritDoc} */ public void performDefaults() { fSettings= CleanUpPreferenceUtil.loadSaveParticipantOptions(new InstanceScope()); settingsChanged(); }
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; } } }
/** * @since 2.3 */ public static String getLineDelimiter(String workspacePath) { return Platform.getPreferencesService().getString (Platform.PI_RUNTIME, Platform.PREF_LINE_SEPARATOR, System.getProperty(Platform.PREF_LINE_SEPARATOR), new IScopeContext[] { new ProjectScope(ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(workspacePath)).getProject()), new InstanceScope() }); }
public static void setFlag(String flagId, int value) { if (getDefaultFlag(flagId) == value) new InstanceScope().getNode(PDE.PLUGIN_ID).remove(flagId); else new InstanceScope().getNode(PDE.PLUGIN_ID).putInt(flagId, value); }
public static void setBoolean(String flagId, boolean value) { if (getDefaultBoolean(flagId) == value) new InstanceScope().getNode(PDE.PLUGIN_ID).remove(flagId); else new InstanceScope().getNode(PDE.PLUGIN_ID) .putBoolean(flagId, value); }
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; }
/** * Accessor for the maximum file count in the preference store * * @return The maximum file count in the preference store or the value 10 if it's not defined. */ public static int getMaxFileCount() { final IScopeContext[] lookupOrder = new IScopeContext[] {new InstanceScope()}; IPreferencesService prefService = Platform.getPreferencesService(); prefService.setDefaultLookupOrder(TracingConstants.BUNDLE_ID, null, new String[] {InstanceScope.SCOPE}); return prefService.getInt(TracingConstants.BUNDLE_ID, TracingConstants.PREFERENCE_MAX_FILE_COUNT_IDENTIFIER, 10, lookupOrder); }
/** * 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); }
private static IPreferenceStore getPreferenceStore(IProject project) { ScopedPreferenceStore store = new ScopedPreferenceStore(new ProjectScope(project), QUALIFIER); store.setSearchContexts(new IScopeContext[] { new ProjectScope(project), new InstanceScope() }); return store; }
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$ } }
private String getLineDelimiterPreference(IFile file) { IScopeContext[] scopeContext; if (file != null && file.getProject() != null) { // project preference scopeContext= new IScopeContext[] { new ProjectScope(file.getProject()) }; String lineDelimiter= Platform.getPreferencesService().getString(Platform.PI_RUNTIME, Platform.PREF_LINE_SEPARATOR, null, scopeContext); if (lineDelimiter != null) return lineDelimiter; } // workspace preference scopeContext= new IScopeContext[] { new InstanceScope() }; return Platform.getPreferencesService().getString(Platform.PI_RUNTIME, Platform.PREF_LINE_SEPARATOR, null, scopeContext); }
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(); }