private EclipsePreferences getPluginPreferences(boolean create) { try { if (!create && !pluginRoot.nodeExists(pluginID)) return null; } catch (BackingStoreException e) { return null; } try { return (EclipsePreferences) pluginRoot.node(pluginID); } catch (ClassCastException e) { throw new RuntimeException("Plug-in preferences must be instances of EclipsePreferences: " + e.getMessage()); //$NON-NLS-1$ } }
fos = new FileOutputStream(file); output = new BufferedOutputStream(fos); IEclipsePreferences node = (IEclipsePreferences) service.getRootNode().node(InstanceScope.SCOPE); service.exportPreferences(node, output, (String[]) null); output.flush();
public String[] getUsers() { String[] users = null; try { users = bundlePreferences.node("user").childrenNames(); } catch (BackingStoreException e) { //best effort } return users == null ? new String[0] : users; }
@Override public Preferences getUserPreferences(String name) { return new OSGiLocalRootPreferences(bundlePreferences.node("user/" + name)); //$NON-NLS-1$ }
/** * Associates the specified <code>int</code> value with the specified key * for specified <code>node</code> in current scope. * * @param node node * @param key <code>key</code> with which the string form of value is to be associated. * @param value <code>value</code> to be associated with <code>key</code>. * @see #getInt(String, String) */ public void putInt(String node, String key, int value) { currentScope.node(node).putInt(key, value); }
/** * Associates the specified <code>boolean</code> value with the specified key * for specified <code>node</code> in current scope. * * @param node node * @param key <code>key</code> with which the string form of value is to be associated. * @param value <code>value</code> to be associated with <code>key</code>. * @see #getBoolean(String, String) */ public void putBoolean(String node, String key, boolean value) { currentScope.node(node).putBoolean(key, value); }
@Override public boolean visit(IEclipsePreferences node) throws BackingStoreException { Preferences destination = result.node(node.absolutePath()); copyFromTo(node, destination, null, 0); return true; } };
@Override public IEclipsePreferences getNode(String qualifier) { if (qualifier == null) throw new IllegalArgumentException(); return (IEclipsePreferences) PreferencesService.getDefault().getRootNode().node(getName()).node(qualifier); }
public IEclipsePreferences preApply(IEclipsePreferences node) { Preferences instance = node.node(InstanceScope.SCOPE); cleanJavaCore(instance.node(JavaCore.PLUGIN_ID)); return super.preApply(node); }
static String[] getFileSpecs(IScopeContext context, String contentTypeId, int type) { Preferences contentTypeNode = ContentTypeManager.getInstance().getPreferences(context).node(contentTypeId); return getFileSpecs(contentTypeNode, type); }
static String[] getFileSpecs(IScopeContext context, String contentTypeId, int type) { Preferences contentTypeNode = ContentTypeManager.getInstance().getPreferences(context).node(contentTypeId); return getFileSpecs(contentTypeNode, type); }
private String getDefaultValue() { String value = null; if (project != null) { value = getStoredValue(getPreferences(null)); } if (value == null) { value = getStoredValue(Platform.getPreferencesService().getRootNode().node(DefaultScope.SCOPE)); } return value != null ? value : System.getProperty(Platform.PREF_LINE_SEPARATOR); }
public static void setEnabledPreferredAuthMethods(String methods, String order){ IPreferencesService service=Platform.getPreferencesService(); service.getRootNode().node(InstanceScope.SCOPE).node(JSchCorePlugin.ID).put( IConstants.PREF_PREFERRED_AUTHENTICATION_METHODS, methods); service.getRootNode().node(InstanceScope.SCOPE).node(JSchCorePlugin.ID).put( IConstants.PREF_PREFERRED_AUTHENTICATION_METHODS_ORDER, order);}
public static void setEnabledPreferredMACMethods(String methods, String order){ IPreferencesService service=Platform.getPreferencesService(); service.getRootNode().node(InstanceScope.SCOPE).node(JSchCorePlugin.ID).put( IConstants.PREF_PREFERRED_MAC_METHODS, methods); service.getRootNode().node(InstanceScope.SCOPE).node(JSchCorePlugin.ID).put( IConstants.PREF_PREFERRED_MAC_METHODS_ORDER, order); } }
@Override public IEclipsePreferences getNode(String qualifier) { if (qualifier == null) throw new IllegalArgumentException(); IPreferencesService preferencesService = Platform.getPreferencesService(); Preferences scopeNode = preferencesService.getRootNode().node(SCOPE); Preferences projectNode = scopeNode.node(project.getName()); return (IEclipsePreferences) projectNode.node(qualifier); }
@Override public IEclipsePreferences getNode(String qualifier) { if (qualifier == null) throw new IllegalArgumentException(); return (IEclipsePreferences) Platform.getPreferencesService().getRootNode().node(SCOPE).node(context.getName()).node(qualifier); }
public boolean visit(IEclipsePreferences node) throws BackingStoreException { String[] keys = node.keys(); if (keys.length == 0) return true; copyFromTo(node, getRootNode().node(node.absolutePath()), keys, 0); return true; } };
public IEclipsePreferences getNode(String qualifier) { if (qualifier == null) throw new IllegalArgumentException(); String locationString = SlashEncode.encode(location.getRootLocation().toString()); //format is /profile/{agentLocationURI}/{profileId}/qualifier return (IEclipsePreferences) PreferencesService.getDefault().getRootNode().node(getName()).node(locationString).node(profileId).node(qualifier); }
@Override public IEclipsePreferences getNode(String qualifier) { if (qualifier == null) throw new IllegalArgumentException(); String locationString = SlashEncode.encode(location.getRootLocation().toString()); //format is /profile/{agentLocationURI}/{profileId}/qualifier return (IEclipsePreferences) PreferencesService.getDefault().getRootNode().node(getName()).node(locationString).node(profileId).node(qualifier); }
public void performOk() { getPreferenceStore().propagate(); try { Platform.getPreferencesService().getRootNode().node(InstanceScope.SCOPE).node(EditorsUI.PLUGIN_ID).flush(); } catch (BackingStoreException e) { EditorsPlugin.log(e); } }