Examples of IScopeContext


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

    return processChanges(null); // apply directly
  }

  protected boolean processChanges(IWorkbenchPreferenceContainer container) {

    IScopeContext currContext = fLookupOrder[0];

    List /* <PropertyChange> */changedOptions = new ArrayList();
    boolean needsBuild = getChanges(currContext, changedOptions);
    if (changedOptions.isEmpty()) {
      hasChanges = false;
View Full Code Here

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

      ProjectScope scope = (ProjectScope) new ProjectScope(project);
      node = scope.getNode(FormatterCorePlugin.PLUGIN_ID);
    }
    if (node == null
        || node.get(PreferenceConstants.FORMATTER_PROFILE, null) == null) {
      IScopeContext context = InstanceScope.INSTANCE;
      node = context.getNode(FormatterCorePlugin.PLUGIN_ID);
    }
    Map<String, Object> p = new HashMap<String, Object>(
        defaultPrefrencesValues);
    if (node != null && node.keys().length > 0) {
      Set<String> propetiesNames = p.keySet();
View Full Code Here

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

    project.build(IncrementalProjectBuilder.FULL_BUILD, null);

    PHPCoreTests.waitForIndexer();
    PHPCoreTests.waitForAutoBuild();

    IScopeContext scopeContext = InstanceScope.INSTANCE;
    ProfileManager profileManager = new ProfileManager(
        new ArrayList<Profile>(), scopeContext);
    profileManager.clearAllSettings(scopeContext);
    profileManager.commitChanges(scopeContext);
View Full Code Here

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

    project.build(IncrementalProjectBuilder.FULL_BUILD, null);

    PHPCoreTests.waitForIndexer();
    PHPCoreTests.waitForAutoBuild();

    IScopeContext scopeContext = InstanceScope.INSTANCE;
    ProfileManager profileManager = new ProfileManager(
        new ArrayList<Profile>(), scopeContext);
    profileManager.clearAllSettings(scopeContext);
    profileManager.commitChanges(scopeContext);
View Full Code Here

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

    project.build(IncrementalProjectBuilder.FULL_BUILD, null);

    PHPCoreTests.waitForIndexer();
    PHPCoreTests.waitForAutoBuild();

    IScopeContext scopeContext = InstanceScope.INSTANCE;
    ProfileManager profileManager = new ProfileManager(
        new ArrayList<Profile>(), scopeContext);
    profileManager.clearAllSettings(scopeContext);
    profileManager.commitChanges(scopeContext);
View Full Code Here

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

      fProfilesByName.add(profile);
    }

    Collections.sort(fProfilesByName);

    IScopeContext instanceScope = InstanceScope.INSTANCE;
    String profileId = instanceScope.getNode(FormatterCorePlugin.PLUGIN_ID)
        .get(PROFILE_KEY, null);
    if (profileId == null) {
      // request from bug 129427
      profileId = DefaultScope.INSTANCE.getNode(
          FormatterCorePlugin.PLUGIN_ID).get(PROFILE_KEY, null);
      // fix for bug 89739
      if (DEFAULT_PROFILE.equals(profileId)) { // default default:
        IEclipsePreferences node = instanceScope
            .getNode(FormatterCorePlugin.PLUGIN_ID);
        if (node != null) {
          profileId = PHP_PROFILE;
        }
      }
View Full Code Here

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

  private void updateProfilesWithName(String oldName, Profile newProfile,
      boolean applySettings) {
    IProject[] projects = ResourcesPlugin.getWorkspace().getRoot()
        .getProjects();
    for (int i = 0; i < projects.length; i++) {
      IScopeContext projectScope = new ProjectScope(projects[i]);
      IEclipsePreferences node = projectScope
          .getNode(FormatterCorePlugin.PLUGIN_ID);
      String profileId = node.get(PROFILE_KEY, null);
      if (oldName.equals(profileId)) {
        if (newProfile == null) {
          node.remove(PROFILE_KEY);
        } else {
          if (applySettings) {
            writeToPreferenceStore(newProfile, projectScope);
          } else {
            node.put(PROFILE_KEY, newProfile.getID());
          }
        }
      }
    }

    IScopeContext instanceScope = InstanceScope.INSTANCE;
    final IEclipsePreferences uiPrefs = instanceScope
        .getNode(FormatterCorePlugin.PLUGIN_ID);
    if (newProfile != null
        && oldName.equals(uiPrefs.get(PROFILE_KEY, null))) {
      writeToPreferenceStore(newProfile, instanceScope);
    }
View Full Code Here

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

    }
    return element;
  }

  public static void checkCurrentOptionsVersion() {
    IScopeContext instanceScope = InstanceScope.INSTANCE;
    try {
      List profiles = ProfileStore.readProfiles(instanceScope);
      if (profiles == null) {
        profiles = Collections.EMPTY_LIST;
      }
      ProfileManager manager = new ProfileManager(profiles, instanceScope);
      if (manager.getSelected() instanceof CustomProfile) {
        manager.commitChanges(instanceScope); // updates JavaCore
                            // options
      }
      savePreferences(instanceScope);

      IProject[] projects = ResourcesPlugin.getWorkspace().getRoot()
          .getProjects();
      for (int i = 0; i < projects.length; i++) {
        IScopeContext scope = new ProjectScope(projects[i]);
        if (ProfileManager.hasProjectSpecificSettings(scope)) {
          manager = new ProfileManager(profiles, scope);
          manager.commitChanges(scope); // updates JavaCore project
                          // options
          savePreferences(scope);
View Full Code Here

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

    Map<String, String> prefVals = preferenceValues.get(cacheKey);
    if(prefVals == null){
      prefVals = new HashMap<String, String>();
      preferenceValues.put(cacheKey, prefVals);

      IScopeContext context = InstanceScope.INSTANCE;

      // global
      IEclipsePreferences globalPrefs = context.getNode(NODE_NAME);
      initializeDefaultPreferences(globalPrefs);
      for(String key : globalPrefs.keys()){
        prefVals.put(key, globalPrefs.get(key, null));
      }

      // project
      if (project != null){
        context = new ProjectScope(project);
        IEclipsePreferences projectPrefs = context.getNode(NODE_NAME);
        for(String key : projectPrefs.keys()){
          prefVals.put(key, projectPrefs.get(key, null));
        }
      }
    }
View Full Code Here

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

  {
    ArrayList<OptionInstance> results = new ArrayList<OptionInstance>();
    Map<String, String> options = new HashMap<String, String>();

    // global
    IScopeContext context = InstanceScope.INSTANCE;
    IEclipsePreferences globalPrefs = context.getNode(NODE_NAME);
    initializeDefaultPreferences(globalPrefs);
    for(String key : globalPrefs.keys()){
      options.put(key, globalPrefs.get(key, null));
    }

    // project
    if (project != null){
      context = new ProjectScope(project);
      IEclipsePreferences projectPrefs = context.getNode(NODE_NAME);
      for(String key : projectPrefs.keys()){
        options.put(key, projectPrefs.get(key, null));
      }
    }
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.