Package org.eclipse.core.runtime.preferences

Examples of org.eclipse.core.runtime.preferences.IEclipsePreferences


  /**
   * Dispose the receiver.
   */
  private void disposePreferenceStoreListener() {

    IEclipsePreferences root = (IEclipsePreferences) Platform
        .getPreferencesService().getRootNode().node(
            Plugin.PLUGIN_PREFERENCE_SCOPE);
    try {
      if (!(root.nodeExists(nodeQualifier))) {
        return;
      }
    } catch (BackingStoreException e) {
      return;// No need to report here as the node won't have the
      // listener
    }

    IEclipsePreferences preferences = getStorePreferences();
    if (preferences == null) {
      return;
    }
    if (preferencesListener != null) {
      preferences.removePreferenceChangeListener(preferencesListener);
      preferencesListener = null;
    }
  }
View Full Code Here


     * Appends the preferences
     */
    private void appendUserPreferences(PrintWriter writer) {
        // write the prefs to a byte array
        IPreferencesService service = Platform.getPreferencesService();
        IEclipsePreferences node = service.getRootNode();
        ByteArrayOutputStream stm = new ByteArrayOutputStream();
        try {
            service.exportPreferences(node, stm, null);
        } catch (CoreException e) {
            writer.println("Error reading preferences " + e.toString());//$NON-NLS-1$   
View Full Code Here

    /*default*/ IJavaProject getJavaProject() {
        return project;
    }
   
    private void readPreviousProperties() {
        IEclipsePreferences node = getProjectPreferences(UI_STATE_NODE_ID);
        try {
            for(String key: node.keys()) {
                String value = node.get(key, null);
                if (value==null) continue;
                properties.put(key, value);
            }
        } catch (BackingStoreException e) {
            Log.error(e);
View Full Code Here

            Log.error(e);
        }
    }     

    private Configuration readPreviousMapState() {
        IEclipsePreferences node = getProjectPreferences(POINT_NODE_ID);
        Builder builder = Configuration.builder();
        try {
            for (String key: node.keys()) {
                String pointString = node.get(key, null);
                if (pointString == null) continue;
                String[] split = pointString.split("@");
                // cover legacy format
                if (split.length != 2 ) split = pointString.split("#");
                if (split.length != 2 ) {
View Full Code Here

    }

    private void writePointPreferences() {
        if (mapValues.configuration.isError()) return;
        Configuration config = mapValues.configuration.getValueOrFail();
        IEclipsePreferences node = getProjectPreferences(POINT_NODE_ID);
        for(Point each: config.points()) {
            node.put(each.getDocument(), each.x + "@" + each.y);
        }
        try {
            node.flush();
        } catch (BackingStoreException e) {
            Log.error(e);
        }   
    }
View Full Code Here

            Log.error(e);
        }   
    }
   
    private void writeProperties() {
        IEclipsePreferences node = getProjectPreferences(UI_STATE_NODE_ID);  
        try {
            // remove any old entries
            node.clear();
            for (Entry<String, String> entry : properties.entrySet()) {
                node.put(entry.getKey(), entry.getValue());
            }
            node.flush();
        } catch (BackingStoreException e) {
            Log.error(e);
        }
    }   
View Full Code Here

        }
    }   

    private IEclipsePreferences getProjectPreferences(String nodeId) {
        IScopeContext context = new ProjectScope(getProject());
        IEclipsePreferences node = context.getNode(nodeId);
        return node;
    }
View Full Code Here

     * @param factory
     * @param e
     */
    public void loadFromFileOld(IServiceFactory factory, Throwable e) {
        IPreferencesService prefs = Platform.getPreferencesService();
        IEclipsePreferences root = prefs.getRootNode();
        Preferences node = root.node(InstanceScope.SCOPE).node(
                CatalogPlugin.ID + ".services"); //$NON-NLS-1$
        ServiceParameterPersister persister = new ServiceParameterPersister(this, factory);
        persister.restore(node);
    }
View Full Code Here

     *
     * @throws BackingStoreException
     */
    public void restoreFromPreferences() throws BackingStoreException {
        IPreferencesService prefs = Platform.getPreferencesService();
        IEclipsePreferences root = prefs.getRootNode();
        Preferences node = root.node(InstanceScope.SCOPE).node(
                getBundle().getSymbolicName() + ".bookmarks"); //$NON-NLS-1$

        for( String projectId : node.childrenNames() ) {
            URI projectURI = URI.createURI(URI.decode(projectId));
            Preferences projectNode = node.node(projectId);
View Full Code Here

        IBookmarkService mgr = getBookmarkService();
        if (mgr == null) {
            return; // nothing to save!
        }
        IPreferencesService prefs = Platform.getPreferencesService();
        IEclipsePreferences root = prefs.getRootNode();
        Preferences node = root.node(InstanceScope.SCOPE).node(
                getBundle().getSymbolicName() + ".bookmarks"); //$NON-NLS-1$
        clearPreferences(node);
        for( URI project : mgr.getProjects() ) {
            String projectString = project.toString();
            String encPStr = URI.encodeSegment(projectString, true);
View Full Code Here

TOP

Related Classes of org.eclipse.core.runtime.preferences.IEclipsePreferences

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.