Examples of IScopeContext


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

   */
  public void setPreference(
      String nodeName, IProject project, String name, String value)
    throws IllegalArgumentException, Exception
  {
    IScopeContext context = InstanceScope.INSTANCE;

    IEclipsePreferences globalPrefs = context.getNode(nodeName);
    initializeDefaultPreferences(globalPrefs);

    Option pref = preferences.get(name);
    if (pref == null){
      pref = options.get(name);
    }

    // set global
    if (project == null){
      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);
        projectPrefs.flush();
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.