Beispiel #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();
  }
Beispiel #2
0
  /**
   * Answer true if we must use the global settings for this project. If the global preferences do
   * not allow overrides, or if this project does not allow overrides then the global preferences
   * must be used.
   *
   * @param project project that is being tested. It can be null, in which case the global
   *     preferences must be used.
   * @return true if the global preferences must be used.
   */
  public boolean mustUseGlobalValidators(IProject project) {
    if (project == null) return true;
    if (!getGlobalPreferences().getOverride()) return true;
    ProjectPreferences pp = _projectPreferences.get(project);
    if (pp != null) return !pp.getOverride();

    ValPrefManagerProject vpm = new ValPrefManagerProject(project);
    return !vpm.getOverride();
  }