Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.ProjectScope


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

    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()};
      }
    }
  }
View Full Code Here


        /*
         * If the host has no project specific line delimiter set, we do this
         * here, so it will be transfered to the clients.
         */
        IScopeContext[] scopeContexts = new IScopeContext[] {
            new ProjectScope(project), new InstanceScope() };
        IPreferencesService preferencesService = Platform
            .getPreferencesService();
        String platformLineDelimiter = System.getProperty("line.separator");
        String lineDelimiter = preferencesService.getString(
            Platform.PI_RUNTIME, Platform.PREF_LINE_SEPARATOR,
View Full Code Here

     * Returns the project specific line delimiter preferences for given
     * project, or <code>null</code> if there are no line delimiter settings at
     * all.
     */
    protected static String getLineDelimiterPreference(IProject project) {
        return (new ProjectScope(project)).getNode(Platform.PI_RUNTIME).get(
            Platform.PREF_LINE_SEPARATOR, null);
    }
View Full Code Here

     * specific settings.
     */
    protected static void putLineDelimiterPreference(IProject project,
        @Nullable String lineDelimiter) {

        IEclipsePreferences node = (new ProjectScope(project))
            .getNode(Platform.PI_RUNTIME);
        if (lineDelimiter != null) {
            node.put(Platform.PREF_LINE_SEPARATOR, lineDelimiter);
        } else {
            node.remove(Platform.PREF_LINE_SEPARATOR);
View Full Code Here

        return EDITOR_SAVE_PARTICIPANT_PREFIX + POSTSAVELISTENER_ID;
    }

    public IRestorePoint change(final IProject project) {

        IEclipsePreferences prefs = new ProjectScope(project)
            .getNode(JavaUI.ID_PLUGIN);

        if (prefs == null) {
            log.error("No preference store in project scope available");
            return null;
        }

        final String oldValue = prefs.get(getSaveActionPreferenceKey(), null);

        prefs.putBoolean(getSaveActionPreferenceKey(), false);

        return new IRestorePoint() {

            public void restore() {
                IEclipsePreferences prefs = new ProjectScope(project)
                    .getNode(JavaUI.ID_PLUGIN);

                if (oldValue == null) {
                    prefs.remove(getSaveActionPreferenceKey());
                } else {
View Full Code Here

    IScopeContext[] scopes = new IScopeContext[]{new InstanceScope(), new DefaultScope()};
    final IFile file = getFile(document);
    if (file != null && file.exists()) {
      final IProject project = file.getProject();
      if (project.exists()) {
        ProjectScope projectScope = new ProjectScope(project);
        if (projectScope.getNode(PREFERENCE_NODE_QUALIFIER).getBoolean(JSPCorePreferenceNames.VALIDATION_USE_PROJECT_SETTINGS, false)) {
          scopes = new IScopeContext[]{projectScope, new InstanceScope(), new DefaultScope()};
        }
      }
    }
    return scopes;
View Full Code Here

  }

  protected IScopeContext[] createPreferenceScopes() {
    IProject project = getProject();
    if (project != null) {
      return new IScopeContext[]{new ProjectScope(project), new InstanceScope(), new DefaultScope()};
    }
    return new IScopeContext[]{new InstanceScope(), new DefaultScope()};
  }
View Full Code Here

  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

    fNewFileTemplatesPage = new NewJSPTemplatesWizardPage();
    addPage(fNewFileTemplatesPage);
  }

  private String applyLineDelimiter(IFile file, String text) {
    String lineDelimiter = Platform.getPreferencesService().getString(Platform.PI_RUNTIME, Platform.PREF_LINE_SEPARATOR, System.getProperty("line.separator"), new IScopeContext[] {new ProjectScope(file.getProject()), new InstanceScope() });//$NON-NLS-1$
    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

    fNewFileTemplatesPage = new NewTagTemplatesWizardPage();
    addPage(fNewFileTemplatesPage);
  }

  private String applyLineDelimiter(IFile file, String text) {
    String lineDelimiter = Platform.getPreferencesService().getString(Platform.PI_RUNTIME, Platform.PREF_LINE_SEPARATOR, System.getProperty("line.separator"), new IScopeContext[] {new ProjectScope(file.getProject()), new InstanceScope() });//$NON-NLS-1$
    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

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.