fos = new FileOutputStream(file); output = new BufferedOutputStream(fos); IEclipsePreferences node = (IEclipsePreferences) service.getRootNode().node(InstanceScope.SCOPE); service.exportPreferences(node, output, (String[]) null); output.flush();
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); }
/** * Answer the <code>Preferences</code> for the receiver, this will be a * project preferences if the receiver is editing project preferences, * otherwise instance preferences. * * @param project * the project for which the line editor will be modified * @return the preferences */ private Preferences getPreferences(IProject project) { if (project != null) { return Platform.getPreferencesService().getRootNode().node(ProjectScope.SCOPE).node(project.getName()); } return Platform.getPreferencesService().getRootNode().node(InstanceScope.SCOPE); }
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); } }
Preferences getSharedPreferences() { if (agentLocation == null) return null; IPreferencesService prefService = (IPreferencesService) ServiceHelper.getService(Activator.getContext(), IPreferencesService.class.getName()); if (prefService == null) return null; try { //see ProfileScope for preference path format String locationString = EncodingUtils.encodeSlashes(agentLocation.getRootLocation().toString()); return prefService.getRootNode().node("/profile/shared/" + locationString + "/_SELF_/" + getBundleId() + '/' + NODE_REPOSITORIES); //$NON-NLS-1$ //$NON-NLS-2$ } catch (IllegalArgumentException e) { return null; } }
public static void setEnabledPreferredKEXMethods(String methods, String order){ IPreferencesService service=Platform.getPreferencesService(); service.getRootNode().node(InstanceScope.SCOPE).node(JSchCorePlugin.ID).put( IConstants.PREF_PREFERRED_KEYEXCHANGE_METHODS, methods); service.getRootNode().node(InstanceScope.SCOPE).node(JSchCorePlugin.ID).put( IConstants.PREF_PREFERRED_KEYEXCHANGE_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); }
@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 static void setSelectedSSHAgents(String methods){ IPreferencesService service=Platform.getPreferencesService(); service.getRootNode().node(InstanceScope.SCOPE).node(JSchCorePlugin.ID).put( IConstants.PREF_PREFERRED_SSHAGENT, methods); }
Preferences getSharedPreferences() { if (agentLocation == null) return null; IPreferencesService prefService = ServiceHelper.getService(Activator.getContext(), IPreferencesService.class); if (prefService == null) return null; try { //see ProfileScope for preference path format String locationString = EncodingUtils.encodeSlashes(agentLocation.getRootLocation().toString()); return prefService.getRootNode().node("/profile/shared/" + locationString + "/_SELF_/" + getBundleId() + '/' + NODE_REPOSITORIES); //$NON-NLS-1$ //$NON-NLS-2$ } catch (IllegalArgumentException e) { return null; } }
/** * Return the preference node which is the root for where we store the repository information. * Returns <code>null</code> if no preferences are available */ Preferences getPreferences() { if (agentLocation == null) return null; IPreferencesService prefService = ServiceHelper.getService(Activator.getContext(), IPreferencesService.class); if (prefService == null) return null; try { //see ProfileScope for preference path format String locationString = EncodingUtils.encodeSlashes(agentLocation.getRootLocation().toString()); return prefService.getRootNode().node("/profile/" + locationString + "/_SELF_/" + getBundleId() + '/' + NODE_REPOSITORIES); //$NON-NLS-1$ //$NON-NLS-2$ } catch (IllegalArgumentException e) { return null; } }
public void performOk() { getPreferenceStore().propagate(); try { Platform.getPreferencesService().getRootNode().node(InstanceScope.SCOPE).node(EditorsUI.PLUGIN_ID).flush(); } catch (BackingStoreException e) { EditorsPlugin.log(e); } }
@Override public void performOk() { getPreferenceStore().propagate(); try { Platform.getPreferencesService().getRootNode().node(InstanceScope.SCOPE).node(EditorsUI.PLUGIN_ID).flush(); } catch (BackingStoreException e) { EditorsPlugin.log(e); } }
static void deleted(IProject project) throws CoreException { // The settings dir has been removed/moved so remove all project prefs // for the resource. We have to do this now because (since we aren't // synchronizing) there is short-circuit code that doesn't visit the // children. Preferences root = Platform.getPreferencesService().getRootNode(); Preferences projectNode = root.node(ProjectScope.SCOPE).node(project.getName()); // check if we need to notify the charset manager boolean hasResourcesSettings = getFile(project, PREFS_REGULAR_QUALIFIER).exists() || getFile(project, PREFS_DERIVED_QUALIFIER).exists(); // remove the preferences removeNode(projectNode); // notifies the CharsetManager if (hasResourcesSettings) preferencesChanged(project); }
static void deleted(IProject project) throws CoreException { // The settings dir has been removed/moved so remove all project prefs // for the resource. We have to do this now because (since we aren't // synchronizing) there is short-circuit code that doesn't visit the // children. Preferences root = Platform.getPreferencesService().getRootNode(); Preferences projectNode = root.node(ProjectScope.SCOPE).node(project.getName()); // check if we need to notify the charset manager boolean hasResourcesSettings = getFile(project, PREFS_REGULAR_QUALIFIER).exists() || getFile(project, PREFS_DERIVED_QUALIFIER).exists(); // remove the preferences removeNode(projectNode); // notifies the CharsetManager if (hasResourcesSettings) preferencesChanged(project); }
static void deleted(IProject project) throws CoreException { // The settings dir has been removed/moved so remove all project prefs // for the resource. We have to do this now because (since we aren't // synchronizing) there is short-circuit code that doesn't visit the // children. Preferences root = Platform.getPreferencesService().getRootNode(); Preferences projectNode = root.node(ProjectScope.SCOPE).node(project.getName()); // check if we need to notify the charset manager boolean hasResourcesSettings = getFile(project, PREFS_REGULAR_QUALIFIER).exists() || getFile(project, PREFS_DERIVED_QUALIFIER).exists(); // remove the preferences removeNode(projectNode); // notifies the CharsetManager if (hasResourcesSettings) preferencesChanged(project); }
private boolean isDerivedEncodingStoredSeparately(IProject project) { // be careful looking up for our node so not to create any nodes as side effect Preferences node = Platform.getPreferencesService().getRootNode().node(ProjectScope.SCOPE); try { //TODO once bug 90500 is fixed, should be as simple as this: // String path = project.getName() + IPath.SEPARATOR + ResourcesPlugin.PI_RESOURCES; // return node.nodeExists(path) ? node.node(path).getBoolean(ResourcesPlugin.PREF_SEPARATE_DERIVED_ENCODINGS, false) : false; // for now, take the long way if (!node.nodeExists(project.getName())) return ResourcesPlugin.DEFAULT_PREF_SEPARATE_DERIVED_ENCODINGS; node = node.node(project.getName()); if (!node.nodeExists(ResourcesPlugin.PI_RESOURCES)) return ResourcesPlugin.DEFAULT_PREF_SEPARATE_DERIVED_ENCODINGS; node = node.node(ResourcesPlugin.PI_RESOURCES); return node.getBoolean(ResourcesPlugin.PREF_SEPARATE_DERIVED_ENCODINGS, ResourcesPlugin.DEFAULT_PREF_SEPARATE_DERIVED_ENCODINGS); } catch (BackingStoreException e) { // nodeExists failed String message = Messages.resources_readingEncoding; Policy.log(new ResourceStatus(IResourceStatus.FAILED_GETTING_CHARSET, project.getFullPath(), message, e)); return ResourcesPlugin.DEFAULT_PREF_SEPARATE_DERIVED_ENCODINGS; } }
public void initialize() { IFeatureModel model = (IFeatureModel) getPage().getModel(); refresh(); if (model.isEditable() == false) { getTablePart().setButtonEnabled(NEW_PLUGIN, false); getTablePart().setButtonEnabled(NEW_FEATURE, false); getTablePart().setButtonEnabled(REMOVE, false); getTablePart().setButtonEnabled(RECOMPUTE_IMPORT, false); fSyncButton.setEnabled(false); } IEclipsePreferences eclipsePrefs = Platform.getPreferencesService().getRootNode(); Preferences prefs = eclipsePrefs.node(Plugin.PLUGIN_PREFERENCE_SCOPE).node(IPDEUIConstants.PLUGIN_ID); fSyncButton.setSelection(prefs.getBoolean(model.getFeature().getLabel(), false)); model.addModelChangedListener(this); PDECore.getDefault().getModelManager().addPluginModelListener(this); PDECore.getDefault().getFeatureModelManager().addFeatureModelListener(this); }