Package org.eclipse.core.runtime.preferences

Examples of org.eclipse.core.runtime.preferences.DefaultScope


* Sets default values for HTML Core preferences
*/
public class HTMLCorePreferenceInitializer extends AbstractPreferenceInitializer {

  public void initializeDefaultPreferences() {
    IEclipsePreferences node = new DefaultScope().getNode(HTMLCorePlugin.getDefault().getBundle().getSymbolicName());

    // formatting preferences
    node.putInt(HTMLCorePreferenceNames.LINE_WIDTH, 72);
    node.putBoolean(HTMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES, false);
    node.put(HTMLCorePreferenceNames.INDENTATION_CHAR, HTMLCorePreferenceNames.TAB);
View Full Code Here


  private IPreferencesService fPreferencesService = null;
  private IScopeContext[] fScopes = null;

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

  private boolean isReservedTaglibPrefix(String name) {
    return fReservedPrefixes.get(name) != null;
  }
 
  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()};
      }
    }

    fSeverityIncludeFileMissing = getMessageSeverity(JSPCorePreferenceNames.VALIDATION_DIRECTIVE_INCLUDE_FILE_NOT_FOUND);
    fSeverityIncludeFileNotSpecified = getMessageSeverity(JSPCorePreferenceNames.VALIDATION_DIRECTIVE_INCLUDE_NO_FILE_SPECIFIED);
View Full Code Here

    errorTable.put(state, msg, severity);
  }
 
  private void init() {
    fPreferenceService = Platform.getPreferencesService();
    fLookupOrder = new IScopeContext[] {new InstanceScope(), new DefaultScope()};
   
    if (fProject != null) {
      ProjectScope projectScope = new ProjectScope(fProject);
      if(projectScope.getNode(HTMLCorePlugin.getDefault().getBundle().getSymbolicName()).getBoolean(HTMLCorePreferenceNames.USE_PROJECT_SETTINGS, false))
        fLookupOrder = new IScopeContext[] {projectScope, new InstanceScope(), new DefaultScope()};
    }
   
    for (int i = 0; i < NodeType.MAX_TYPE; i++) {
      errTables[i] = new ErrorTable();
    }
View Full Code Here

      // TLD
      else {
        try {
          final IJavaProject javaProject = JavaCore.create(file.getProject());
          if (javaProject.exists()) {
            IScopeContext[] scopes = new IScopeContext[]{new InstanceScope(), new DefaultScope()};
            ProjectScope projectScope = new ProjectScope(file.getProject());
            if (projectScope.getNode(PREFERENCE_NODE_QUALIFIER).getBoolean(JSPCorePreferenceNames.VALIDATION_USE_PROJECT_SETTINGS, false)) {
              scopes = new IScopeContext[]{projectScope, new InstanceScope(), new DefaultScope()};
            }
            Map[] problems = detectProblems(javaProject, file, scopes);
            for (int i = 0; i < problems.length; i++) {
              ValidatorMessage message = ValidatorMessage.create(problems[i].get(IMarker.MESSAGE).toString(), resource);
              message.setType(MARKER_TYPE);
View Full Code Here

* Sets default values for JSP Core preferences
*/
public class JSPCorePreferenceInitializer extends AbstractPreferenceInitializer {

  public void initializeDefaultPreferences() {
    IEclipsePreferences node = new DefaultScope().getNode(JSPCorePlugin.getDefault().getBundle().getSymbolicName());

    // compiler/validation preferences
    node.putBoolean(JSPCorePreferenceNames.VALIDATE_FRAGMENTS, true);

    // code generation preferences
View Full Code Here

    }
    return IMessage.NORMAL_SEVERITY;
  }

  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

    protected static Logger log = Logger.getLogger(PreferenceInitializer.class
        .getName());

    @Override
    public void initializeDefaultPreferences() {
        IEclipsePreferences prefs = new DefaultScope().getNode(Saros.SAROS);       
        setPreferences(prefs);
    }
View Full Code Here

  private int getProblemSeverity(String key, IScopeContext[] contexts) {
    return Platform.getPreferencesService().getInt(PREFERENCE_NODE_QUALIFIER, key, IMessage.NORMAL_SEVERITY, contexts);
  }

  private IScopeContext[] getScopeContexts(IStructuredDocument document) {
    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

TOP

Related Classes of org.eclipse.core.runtime.preferences.DefaultScope

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.