Package org.osgi.service.prefs

Examples of org.osgi.service.prefs.Preferences.nodeExists()


    }

    protected boolean loadState() {
        try {
            Preferences prefs = preferences.getUserPreferences("FeaturesServiceState");
            if (prefs.nodeExists("repositories")) {
                Set<URL> repositories = loadSet(prefs.node("repositories"));
                for (URL repo : repositories) {
                    internalAddRepository(repo);
                }
                installed = loadMap(prefs.node("features"));
View Full Code Here


    }

    protected boolean loadState() {
        try {
            Preferences prefs = preferences.getUserPreferences("FeaturesServiceState");
            if (prefs.nodeExists("repositories")) {
                Set<URI> repositories = loadSet(prefs.node("repositories"));
                for (URI repo : repositories) {
                    internalAddRepository(repo);
                }
                installed = loadMap(prefs.node("features"));
View Full Code Here

        throws BackingStoreException
       
    {
        final Preferences prefs = getPreferencesRoot( createIfNecessary );
       
        if( prefs != null && ( prefs.nodeExists( PREFS_GLOBAL ) || createIfNecessary ) )
        {
            return prefs.node( PREFS_GLOBAL );
        }
       
        return null;
View Full Code Here

            level2 = editorInput.getClass().getName();
        }
       
        Preferences prefs = getPreferencesRoot( createIfNecessary );
       
        if( prefs != null && ( prefs.nodeExists( level1 ) || createIfNecessary ) )
        {
            prefs = prefs.node( level1 );
           
            if( prefs.nodeExists( level2 ) || createIfNecessary )
            {
View Full Code Here

       
        if( prefs != null && ( prefs.nodeExists( level1 ) || createIfNecessary ) )
        {
            prefs = prefs.node( level1 );
           
            if( prefs.nodeExists( level2 ) || createIfNecessary )
            {
                return prefs.node( level2 );
            }
        }
       
View Full Code Here

        final IScopeContext scope = new InstanceScope();
       
        final Preferences prefs = scope.getNode( this.pluginId );
        final String editorId = getClass().getName();
       
        if( prefs.nodeExists( editorId ) || createIfNecessary )
        {
            return prefs.node( editorId );
        }
       
        return null;
View Full Code Here

      Preferences node = getConfigurationNode();
      if (id == null) {
        int i = node.childrenNames().length;
        while (true) {
          id = getIdPrefix() + (++i);
          if (!node.nodeExists(id)) {
            break;
          }
        }
      }
      Preferences chlld = node.node(id);
View Full Code Here

  public IEclipsePreferences preApply(IEclipsePreferences node) {
    // the node does not need to be the root of the hierarchy
    Preferences root = node.node("/"); //$NON-NLS-1$
    try {
      // we must not create empty preference nodes, so first check if the node exists
      if (root.nodeExists(InstanceScope.SCOPE)) {
        Preferences instance = root.node(InstanceScope.SCOPE);
        // we must not create empty preference nodes, so first check if the node exists
        if (instance.nodeExists(JavaCore.PLUGIN_ID)) {
          cleanJavaCore(instance.node(JavaCore.PLUGIN_ID));
        }
View Full Code Here

    try {
      // we must not create empty preference nodes, so first check if the node exists
      if (root.nodeExists(InstanceScope.SCOPE)) {
        Preferences instance = root.node(InstanceScope.SCOPE);
        // we must not create empty preference nodes, so first check if the node exists
        if (instance.nodeExists(JavaCore.PLUGIN_ID)) {
          cleanJavaCore(instance.node(JavaCore.PLUGIN_ID));
        }
      }
    } catch (BackingStoreException e) {
      // do nothing
View Full Code Here

    try {
      // be careful looking up for our node so not to create any nodes as side effect
      Preferences node = PROJECT_SCOPE;
      //TODO once bug 90500 is fixed, should be simpler
      // for now, take the long way
      if (!node.nodeExists(projectName))
        return false;
      node = node.node(projectName);
      if (!node.nodeExists(Platform.PI_RUNTIME))
        return false;
      node = node.node(Platform.PI_RUNTIME);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.