Package org.eclipse.core.runtime.preferences

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


  /**
   * Returns the port of the console defined in the preferences
   * @return port
   */
  private int getPort() {
    IScopeContext context = new InstanceScope();
    IEclipsePreferences preferences = context.getNode(OsgiPlugin.PLUGIN_ID);
    return Integer.valueOf(preferences.get(OsgiPlugin.PORT_PREFERENCE_KEY,
        OsgiPlugin.DEFAULT_PORT));
  }
View Full Code Here


      return color;
    }
  }

  private static Color getColorFromPreferences(Class element) {
    IScopeContext context = new InstanceScope();
    IEclipsePreferences node = context.getNode(Activator.PLUGIN_ID);

    String value = node.get(getPreferenceName(element.getName()),
        getDefaultColorStringForModelElementClass(element));
    RGB rgb = StringConverter.asRGB(value);
View Full Code Here

    classToColorMapCache.put(element.getClass(), color);
  }

  private static void setColorToPreferences(Class element, RGB rgb) {
    try {
      IScopeContext context = new InstanceScope();
      IEclipsePreferences node = context.getNode(Activator.PLUGIN_ID);

      node.put(getPreferenceName(element.getName()), StringConverter
          .asString(rgb));
      node.flush();
    }
View Full Code Here

*/
public class ConsolePortVariableResolver implements IDynamicVariableResolver {

  public String resolveValue(IDynamicVariable variable, String argument)
      throws CoreException {
    IScopeContext context = new InstanceScope();
    IEclipsePreferences preferences = context.getNode(OsgiPlugin.PLUGIN_ID);
    return preferences.get(OsgiPlugin.PORT_PREFERENCE_KEY,
        OsgiPlugin.DEFAULT_PORT);
  }
View Full Code Here

      }
    }
  }

  private boolean shouldModelByPersisted() {
    IScopeContext context = new InstanceScope();
    IEclipsePreferences node = context.getNode(Activator.PLUGIN_ID);
    return node.getBoolean(Activator.PERSIST_AOP_MODEL_PREFERENCE, true);
  }
View Full Code Here

TOP

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

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.