Package org.osgi.service.prefs

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


    if (!EclipsePreferences.DEFAULT_PREFERENCES_DIRNAME.equals(path.segment(1)))
      return;
    Preferences root = Platform.getPreferencesService().getRootNode();
    String project = path.segment(0);
    String qualifier = path.removeFileExtension().lastSegment();
    ProjectPreferences projectNode = (ProjectPreferences) root.node(ProjectScope.SCOPE).node(project);
    // if the node isn't known then just return
    try {
      if (!projectNode.nodeExists(qualifier))
        return;
    } catch (BackingStoreException e) {
View Full Code Here


      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);
      if (!node.nodeExists(CONTENT_TYPE_PREF_NODE))
        return false;
View Full Code Here

      if (!node.nodeExists(projectName))
        return false;
      node = node.node(projectName);
      if (!node.nodeExists(Platform.PI_RUNTIME))
        return false;
      node = node.node(Platform.PI_RUNTIME);
      if (!node.nodeExists(CONTENT_TYPE_PREF_NODE))
        return false;
      node = node.node(CONTENT_TYPE_PREF_NODE);
      return node.getBoolean(PREF_LOCAL_CONTENT_TYPE_SETTINGS, false);
    } catch (BackingStoreException e) {
View Full Code Here

      if (!node.nodeExists(Platform.PI_RUNTIME))
        return false;
      node = node.node(Platform.PI_RUNTIME);
      if (!node.nodeExists(CONTENT_TYPE_PREF_NODE))
        return false;
      node = node.node(CONTENT_TYPE_PREF_NODE);
      return node.getBoolean(PREF_LOCAL_CONTENT_TYPE_SETTINGS, false);
    } catch (BackingStoreException e) {
      // exception treated when retrieving the project preferences
    }
    return false;
View Full Code Here

      //      String path = project.getName() + IPath.SEPARATOR + ResourcesPlugin.PI_RESOURCES + IPath.SEPARATOR + ENCODING_PREF_NODE;
      //      return node.nodeExists(path) ? node.node(path) : null;
      // for now, take the long way
      if (!node.nodeExists(project.getName()))
        return null;
      node = node.node(project.getName());
      if (!node.nodeExists(ResourcesPlugin.PI_RESOURCES))
        return null;
      node = node.node(ResourcesPlugin.PI_RESOURCES);
      if (!node.nodeExists(ENCODING_PREF_NODE))
        return null;
View Full Code Here

      if (!node.nodeExists(project.getName()))
        return null;
      node = node.node(project.getName());
      if (!node.nodeExists(ResourcesPlugin.PI_RESOURCES))
        return null;
      node = node.node(ResourcesPlugin.PI_RESOURCES);
      if (!node.nodeExists(ENCODING_PREF_NODE))
        return null;
      return node.node(ENCODING_PREF_NODE);
    } catch (BackingStoreException e) {
      // nodeExists failed
View Full Code Here

      if (!node.nodeExists(ResourcesPlugin.PI_RESOURCES))
        return null;
      node = node.node(ResourcesPlugin.PI_RESOURCES);
      if (!node.nodeExists(ENCODING_PREF_NODE))
        return null;
      return node.node(ENCODING_PREF_NODE);
    } catch (BackingStoreException e) {
      // nodeExists failed
      String message = Messages.resources_readingEncoding;
      Policy.log(new ResourceStatus(IResourceStatus.FAILED_GETTING_CHARSET, project.getFullPath(), message, e));
    }
View Full Code Here

    }
   
    protected void saveState() {
        try {
            Preferences prefs = preferences.getUserPreferences("FeaturesServiceState");
            saveSet(prefs.node("repositories"), repositories.keySet());
            saveMap(prefs.node("features"), installed);
            prefs.putBoolean("bootFeaturesInstalled", bootFeaturesInstalled);
            prefs.flush();
        } catch (Exception e) {
            LOGGER.error("Error persisting FeaturesService state", e);
View Full Code Here

   
    protected void saveState() {
        try {
            Preferences prefs = preferences.getUserPreferences("FeaturesServiceState");
            saveSet(prefs.node("repositories"), repositories.keySet());
            saveMap(prefs.node("features"), installed);
            prefs.putBoolean("bootFeaturesInstalled", bootFeaturesInstalled);
            prefs.flush();
        } catch (Exception e) {
            LOGGER.error("Error persisting FeaturesService state", e);
        }
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"));
                for (Feature f : installed.keySet()) {
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.