Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.ProjectScope


  private void loadPreferences(IFile file) {
    fScopes = new IScopeContext[]{new InstanceScope(), new DefaultScope()};

    fPreferencesService = Platform.getPreferencesService();
    if (file != null && file.isAccessible()) {
      ProjectScope projectScope = new ProjectScope(file.getProject());
      if (projectScope.getNode(PREFERENCE_NODE_QUALIFIER).getBoolean(JSPCorePreferenceNames.VALIDATION_USE_PROJECT_SETTINGS, false)) {
        fScopes = new IScopeContext[]{projectScope, new InstanceScope(), new DefaultScope()};
      }
    }

    fSeverityMissingRequiredAttribute = getMessageSeverity(JSPCorePreferenceNames.VALIDATION_ACTIONS_SEVERITY_MISSING_REQUIRED_ATTRIBUTE);
View Full Code Here


  protected IScopeContext[] createPreferenceScopes(NestedValidatorContext context) {
    if (context != null) {
      final IProject project = context.getProject();
      if (project != null && project.isAccessible()) {
        final ProjectScope projectScope = new ProjectScope(project);
        if (projectScope.getNode(XMLCorePlugin.getDefault().getBundle().getSymbolicName()).getBoolean(XMLCorePreferenceNames.USE_PROJECT_SETTINGS, false))
        return new IScopeContext[]{projectScope, new InstanceScope(), new DefaultScope()};
      }
    }
    return new IScopeContext[]{new InstanceScope(), new DefaultScope()};
  }
View Full Code Here

    return cmDocument;
  }
 
  private String applyLineDelimiter(IFile file, String text) {
    String systemLineSeparator = System.getProperty("line.separator");
    String lineDelimiter = Platform.getPreferencesService().getString(Platform.PI_RUNTIME, Platform.PREF_LINE_SEPARATOR, systemLineSeparator, new IScopeContext[] {new ProjectScope(file.getProject()), new InstanceScope() });//$NON-NLS-1$
    if(!systemLineSeparator.equals(lineDelimiter)) {
      String convertedText = StringUtils.replace(text, "\r\n", "\n");
      convertedText = StringUtils.replace(convertedText, "\r", "\n");
      convertedText = StringUtils.replace(convertedText, "\n", lineDelimiter);
      return convertedText;
View Full Code Here

  protected IProject m_project;
 
  protected void setupScope()
  {
    m_original = new ProjectScope(m_project).getNode(Activator.PLUGIN_ID);
  }
View Full Code Here

  }
 
  public ProjectPreferences(IProject project)
  {
    m_searchScope = new IScopeContext[3];
    m_searchScope[0] = new ProjectScope(project);
    m_searchScope[1] = new InstanceScope();
    m_searchScope[2] = new DefaultScope();
 
    m_project = project;
   
View Full Code Here

        // .fbprefs
        // so check if the file is there...
        IFile file = getUserPreferencesFile(project);
        boolean projectPropsEnabled = file.isAccessible();
        if (projectPropsEnabled) {
            ScopedPreferenceStore store = new ScopedPreferenceStore(new ProjectScope(project), PLUGIN_ID);
            // so if the file is there, we can check if after 1.3.8 the flag is
            // set
            // to use workspace properties instead
            projectPropsEnabled = !store.contains(FindBugsConstants.PROJECT_PROPS_DISABLED)
                    || !store.getBoolean(FindBugsConstants.PROJECT_PROPS_DISABLED);
View Full Code Here

            // read workspace (user) settings from instance area
            return new ScopedPreferenceStore(new InstanceScope(), FindbugsPlugin.PLUGIN_ID);
        }

        // use project settings
        return new ScopedPreferenceStore(new ProjectScope(project), FindbugsPlugin.PLUGIN_ID);
    }
View Full Code Here

public class Preferences {
  IEclipsePreferences pref;

  public Preferences(IProject project) {
    IScopeContext projectScope = new ProjectScope(project);
    pref = projectScope.getNode(Activator.PLUGIN_ID);
  }
View Full Code Here

        e.getMessage(), e);
    plugin.getLog().log(status);
  }

  public IEclipsePreferences getProjectPreferences(IProject project) {
    ProjectScope ps = new ProjectScope(project);
    return ps.getNode(ID);
  }
View Full Code Here

  }
 
  public String getProjectSpecificPreferencesValue(String key, String def,
      IProject project) {
    assert project != null;
    ProjectScope scope = (ProjectScope) projectToScope.get(project);
    if (scope == null) {
      scope = new ProjectScope(project);
      projectToScope.put(project, scope);
    }
    IEclipsePreferences node = scope.getNode(nodeQualifier);
    if (node != null) {
      return node.get(key, def);
    }
    return null;
  }
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.