Package org.osgi.service.prefs

Examples of org.osgi.service.prefs.Preferences


    Assert.isTrue(key.contains(NODE_SEPARATOR), "Invalid Eclipse Preferences Key!"); //$NON-NLS-1$

    String nodePath = getNodePath(key);
    key = key.substring(key.lastIndexOf(NODE_SEPARATOR) + 1);

    Preferences prefNode = fRootNode.node(nodePath);
    prefNode.putInt(key, value);
  }
View Full Code Here


    Assert.isTrue(key.contains(NODE_SEPARATOR), "Invalid Eclipse Preferences Key!"); //$NON-NLS-1$

    String nodePath = getNodePath(key);
    key = key.substring(key.lastIndexOf(NODE_SEPARATOR) + 1);

    Preferences prefNode = fRootNode.node(nodePath);
    prefNode.putLong(key, value);
  }
View Full Code Here

    Assert.isTrue(key.contains(NODE_SEPARATOR), "Invalid Eclipse Preferences Key!"); //$NON-NLS-1$

    String nodePath = getNodePath(key);
    key = key.substring(key.lastIndexOf(NODE_SEPARATOR) + 1);

    Preferences prefNode = fRootNode.node(nodePath);
    prefNode.put(key, value);
  }
View Full Code Here

  /**
   * @return the number of editors able to be visible at the same time.
   */
  public static int getOpenEditorLimit() {
    Preferences instanceNode = Platform.getPreferencesService().getRootNode().node("instance");
    if (instanceNode != null) {
      Preferences workbenchNode = instanceNode.node("org.eclipse.ui.workbench");
      if (workbenchNode != null) {
        boolean isLimited = workbenchNode.getBoolean("REUSE_OPEN_EDITORS_BOOLEAN", true);
        if (!isLimited)
          return Integer.MAX_VALUE;

        return workbenchNode.getInt("REUSE_OPEN_EDITORS", 1);
      }
    }

    return 1;
  }
View Full Code Here

    Assert.isTrue(key.contains(NODE_SEPARATOR), "Invalid Eclipse Preferences Key!"); //$NON-NLS-1$

    String nodePath = getNodePath(key);
    key = key.substring(key.lastIndexOf(NODE_SEPARATOR) + 1);

    Preferences prefNode = fRootNode.node(nodePath);
    prefNode.putBoolean(key, value);
  }
View Full Code Here

  /* (non-Javadoc)
   * @see org.eclipse.core.runtime.preferences.PreferenceModifyListener#preApply(org.eclipse.core.runtime.preferences.IEclipsePreferences)
   */
  public IEclipsePreferences preApply(IEclipsePreferences node) {
    Preferences instance = node.node(InstanceScope.SCOPE);
    cleanJavaCore(instance.node(JavaCore.PLUGIN_ID));
    return super.preApply(node);
  }
View Full Code Here

            }
            if ( pathName.startsWith("/") ) {
                pathName = pathName.substring(1);
            }
        }
        final Preferences searchNode = node.getNode(pathName, false, false);
        return searchNode != null;
    }
View Full Code Here

 
  /** the known providers */
  private List<Provider> providers = new ArrayList<Provider>();
 
  private RepositoryStorage() {
    final Preferences preferences = getPrefs();
    this.nextId = preferences.getInt("nextid", 0);
    final String[] names = preferences.get("names", "").split(":");
    for (final String id : names) {
      if (id.length() == 0) {
        final Preferences node = preferences.node(id);
        final String type = node.get("type", null);
        final String uri = node.get("uri", null);
        this.providers.add(new Provider(id, type, uri));
      }
    }
  }
View Full Code Here

    return INSTANCE;
  }
 
  public String getNextId() {
    this.nextId++;
    final Preferences preferences = getPrefs();
    preferences.putInt("nextId", this.nextId);
    return "persist-repository-" + this.nextId;
  }
View Full Code Here

  private IEclipsePreferences getPrefs() {
    return ConfigurationScope.INSTANCE.getNode("org.pdtextensions.repos");
  }
 
  public void addProvider(String id, String type, String uri) {
    final Preferences preferences = getPrefs();
    final Preferences node = preferences.node(id);
    node.put("type", type);
    node.put("uri", uri);
    this.providers.add(new Provider(id, type, uri));
  }
View Full Code Here

TOP

Related Classes of org.osgi.service.prefs.Preferences

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.