Пример #1
0
  /**
   * Answer true if the project has disabled all of it's validators, or if project overrides are not
   * allowed if global validation has been disabled.
   *
   * @param project the project that is being consulted, or null if only the global settings are to
   *     be checked.
   */
  public boolean isDisabled(IProject project) {
    GlobalPreferences gp = getGlobalPreferences();
    if (!gp.getOverride() || project == null) return gp.getDisableAllValidation();

    ProjectPreferences pp = _projectPreferences.get(project);
    if (pp == null) return gp.getDisableAllValidation();
    return pp.getSuspend();
  }
Пример #2
0
 /**
  * Update the global preferences, but only if something has actually changed.
  *
  * @param values The global settings.
  * @return a bit mask of the changes between the old values and the new values. See the
  *     GlobalPreferences constants for the bit mask values. If a zero is return there were no
  *     changes.
  */
 public int replace(GlobalPreferencesValues values) {
   GlobalPreferences gp = new GlobalPreferences(values);
   GlobalPreferences old = getGlobalPreferences();
   int changes = old.compare(gp);
   if (changes != 0) {
     _globalPreferences.set(gp);
   }
   return changes;
 }