Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.ProjectScope


    if (!JavaProject.hasJavaNature(this.project)) return null;
    // Get cached preferences if exist
    JavaModelManager.PerProjectInfo perProjectInfo = JavaModelManager.getJavaModelManager().getPerProjectInfo(this.project, true);
    if (perProjectInfo.preferences != null) return perProjectInfo.preferences;
    // Init project preferences
    IScopeContext context = new ProjectScope(getProject());
    final IEclipsePreferences eclipsePreferences = context.getNode(JavaCore.PLUGIN_ID);
    updatePreferences(eclipsePreferences);
    perProjectInfo.preferences = eclipsePreferences;

    // Listen to new preferences node
    final IEclipsePreferences eclipseParentPreferences = (IEclipsePreferences) eclipsePreferences.parent();
View Full Code Here


  @Override
  public Map<String,String> getValues(IProject project)
    throws Exception
  {
    return getValues(supportsProjectScope ?
        new ProjectScope(project) : InstanceScope.INSTANCE);
  }
View Full Code Here

  @Override
  public void setOption(IProject project, String name, String value)
    throws Exception
  {
    setOption(supportsProjectScope ?
        new ProjectScope(project) : InstanceScope.INSTANCE, name, value);
  }
View Full Code Here

        prefVals.put(key, globalPrefs.get(key, null));
      }

      // project
      if (project != null){
        context = new ProjectScope(project);
        IEclipsePreferences projectPrefs = context.getNode(NODE_NAME);
        for(String key : projectPrefs.keys()){
          prefVals.put(key, projectPrefs.get(key, null));
        }
      }
View Full Code Here

      options.put(key, globalPrefs.get(key, null));
    }

    // project
    if (project != null){
      context = new ProjectScope(project);
      IEclipsePreferences projectPrefs = context.getNode(NODE_NAME);
      for(String key : projectPrefs.keys()){
        options.put(key, projectPrefs.get(key, null));
      }
    }
View Full Code Here

      validateValue(pref, name, value);
      globalPrefs.put(name, value);
      globalPrefs.flush();

    }else{
      context = new ProjectScope(project);
      IEclipsePreferences projectPrefs = context.getNode(nodeName);

      // if project value is the same as the global, then remove it.
      if(value.equals(globalPrefs.get(name, null))){
        projectPrefs.remove(name);
View Full Code Here

    if (!JavaProject.hasJavaNature(this.project)) return null;
    // Get cached preferences if exist
    JavaModelManager.PerProjectInfo perProjectInfo = JavaModelManager.getJavaModelManager().getPerProjectInfo(this.project, true);
    if (perProjectInfo.preferences != null) return perProjectInfo.preferences;
    // Init project preferences
    IScopeContext context = new ProjectScope(getProject());
    final IEclipsePreferences eclipsePreferences = context.getNode(JavaCore.PLUGIN_ID);
    updatePreferences(eclipsePreferences);
    perProjectInfo.preferences = eclipsePreferences;

    // Listen to new preferences node
    final IEclipsePreferences eclipseParentPreferences = (IEclipsePreferences) eclipsePreferences.parent();
View Full Code Here

        return node != null ? node.get(key, (defaultvalue != null ? defaultvalue : Constants.EMPTY_STRING))
                : defaultvalue;
    }

    protected IEclipsePreferences getPreferences(IProject project) {
        ProjectScope projectScope = new ProjectScope(project);
        IEclipsePreferences node = projectScope.getNode(ForceIdeCorePlugin.getPluginId());
        return node;
    }
View Full Code Here

  // Creates a preferences scope for the given project.
  // This scope will be used to search for preferences values.
  public static IScopeContext[] createPreferenceScopes(IProject project) {
    if (project != null) {
      return new IScopeContext[] { new ProjectScope(project),
          InstanceScope.INSTANCE, DefaultScope.INSTANCE };
    }
    return new IScopeContext[] { InstanceScope.INSTANCE,
        DefaultScope.INSTANCE };
  }
View Full Code Here

  public static Preferences getModelPreferences() {
    return PHPDebugPlugin.getDefault().getPluginPreferences();
  }

  public static IScopeContext getProjectScope(IProject project) {
    return new ProjectScope(project);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.core.resources.ProjectScope

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.