Examples of IScopeContext


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

   *
   * @return
   * @throws CoreException
   */
  public String getDevelopmentLanguage() throws CoreException {
    IScopeContext projectScope = new ProjectScope(getDesignRoot().getProject());
    IEclipsePreferences projectNode = projectScope.getNode(Activator.PLUGIN_ID);
    String langCode = projectNode.get("WGA_DESIGN_DEV_LANGUAGE/" + getDesignRoot().getLocation(), null);
    if (langCode != null && getAvailableLableLanguages().contains(langCode.toLowerCase())) {
      return langCode.toLowerCase();
    } else {
      List<String> languages = getAvailableLableLanguages();
View Full Code Here

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

      }
    }
  }

  public boolean isSortLabelFiles() {
    IScopeContext projectScope = new ProjectScope(getDesignRoot().getProject());
    IEclipsePreferences projectNode = projectScope.getNode(Activator.PLUGIN_ID);
    return projectNode.getBoolean("WGA_DESIGN_SORT_LABEL_FILES/" + getDesignRoot().getLocation(), false);
  }
View Full Code Here

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

    IEclipsePreferences projectNode = projectScope.getNode(Activator.PLUGIN_ID);
    return projectNode.getBoolean("WGA_DESIGN_SORT_LABEL_FILES/" + getDesignRoot().getLocation(), false);
  }

  public void setSortLabelFiles(boolean sort) throws BackingStoreException {
    IScopeContext projectScope = new ProjectScope(getDesignRoot().getProject());
    IEclipsePreferences projectNode = projectScope.getNode(Activator.PLUGIN_ID);
    projectNode.putBoolean("WGA_DESIGN_SORT_LABEL_FILES/" + getDesignRoot().getLocation(), sort);
    projectNode.flush();
  }
View Full Code Here

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

   */
  public void setDevelopmentLanguage(String langCode) throws CoreException, BackingStoreException {
    if (langCode != null) {
      langCode = langCode.toLowerCase();
    }
    IScopeContext projectScope = new ProjectScope(getDesignRoot().getProject());
    IEclipsePreferences projectNode = projectScope.getNode(Activator.PLUGIN_ID);
    projectNode.put("WGA_DESIGN_DEV_LANGUAGE/" + getDesignRoot().getLocation(), langCode);
    projectNode.flush();
  }
View Full Code Here

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

        }
        return _headerFileMap;
    }
   
    public IEclipsePreferences getProjectPreferences(IProject project){       
        IScopeContext projectScope = new ProjectScope(project);       
        return (IEclipsePreferences) projectScope.getNode(PLUGIN_ID);
    }
View Full Code Here

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

        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 node removal from parent in order to reset cache (see bug 68993)
        IEclipsePreferences.INodeChangeListener nodeListener = new IEclipsePreferences.INodeChangeListener() {
View Full Code Here

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

            .getProject()),
            InstanceScope.INSTANCE, DefaultScope.INSTANCE };
   
    for (int i = 0; i < contents.length; i++) {
     
      IScopeContext scopeContext = contents[i];
      IEclipsePreferences inode = scopeContext.getNode(PHPCorePlugin.ID);
     
      if (inode != null) {
       
        if (!options.containsKey(PHPCoreConstants.FORMATTER_USE_TABS)) {
         
View Full Code Here

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

    }

    @Test
    public void nextContexts_1() {
        final IScopeContext[] list = ALL_SCOPE_CONTEXTS;
        final IScopeContext item = ConfigurationScope.INSTANCE;
        final IScopeContext[] val = PreferencesHelper.getNextContexts(list, item);
        Assert.assertNotNull(val);
        Assert.assertEquals(1, val.length);
        Assert.assertEquals(DefaultScope.INSTANCE, val[0]);
    }
View Full Code Here

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

    }

    @Test
    public void nextContexts_2() {
        final IScopeContext[] list = ALL_SCOPE_CONTEXTS;
        final IScopeContext item = DefaultScope.INSTANCE;
        final IScopeContext[] val = PreferencesHelper.getNextContexts(list, item);
        Assert.assertNotNull(val);
        Assert.assertEquals(0, val.length);
    }
View Full Code Here

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

    }

    @Test
    public void nextContexts_3() {
        final IScopeContext[] list = ALL_SCOPE_CONTEXTS;
        final IScopeContext item = InstanceScope.INSTANCE;
        final IScopeContext[] val = PreferencesHelper.getNextContexts(list, item);
        Assert.assertNotNull(val);
        Assert.assertEquals(2, val.length);
        Assert.assertEquals(ConfigurationScope.INSTANCE, val[0]);
        Assert.assertEquals(DefaultScope.INSTANCE, val[1]);
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.