/** Bugzilla 136498: when project-specific settings are enabled, force APT to be enabled. */
 @Override
 public void useProjectSpecificSettings(boolean enable) {
   super.useProjectSpecificSettings(enable);
   if (enable ^ fPerProjSettingsEnabled) {
     fAptEnabledField.setSelection(enable);
     fPerProjSettingsEnabled = enable;
   }
 }
 @Override
 protected void cacheOriginalValues() {
   super.cacheOriginalValues();
   fOriginalProcOptions = AptConfig.getRawProcessorOptions(fJProj);
   fOriginalGenSrcDir = AptConfig.getGenSrcDir(fJProj);
   fOriginalAptEnabled = AptConfig.isEnabled(fJProj);
   fOriginalReconcileEnabled = AptConfig.shouldProcessDuringReconcile(fJProj);
   fPerProjSettingsEnabled = hasProjectSpecificOptionsNoCache(fProject);
 }
 @Override
 public void performDefaults() {
   fPerProjSettingsEnabled = false;
   if (fJProj != null) {
     // If project-specific, load workspace settings
     loadProcessorOptions(null);
   } else {
     // If workspace, load "factory default," which is empty.
     fProcessorOptionsField.removeAllElements();
   }
   super.performDefaults();
 }
  @Override
  protected void saveSettings() {
    List<ProcessorOption> elements;
    boolean isProjSpecificDisabled = (fJProj != null) && !fBlockControl.isEnabled();
    if (isProjSpecificDisabled) {
      // We're in a project properties pane but the entire configuration
      // block control is disabled.  That means the per-project settings checkbox
      // is unchecked.  To save that state, we'll clear the proc options map.
      elements = Collections.<ProcessorOption>emptyList();
    } else {
      elements = getListElements();
    }
    saveProcessorOptions(elements);
    super.saveSettings();
    if (null != fAptProject) {
      if (isProjSpecificDisabled) { // compare against workspace defaults
        if (!fOriginalGenSrcDir.equals(AptConfig.getGenSrcDir(null))) {
          fAptProject.preferenceChanged(AptPreferenceConstants.APT_GENSRCDIR);
        }
        if (fOriginalAptEnabled != AptConfig.isEnabled(null)) {
          // make JDT "processingEnabled" setting track APT "enabled" setting.
          setJDTProcessAnnotationsSetting(fAptEnabledField.isSelected());

          fAptProject.preferenceChanged(AptPreferenceConstants.APT_ENABLED);
        }
        if (fOriginalReconcileEnabled != AptConfig.shouldProcessDuringReconcile(null)) {
          fAptProject.preferenceChanged(AptPreferenceConstants.APT_RECONCILEENABLED);
        }
      } else { // compare against current settings
        if (!fOriginalGenSrcDir.equals(fGenSrcDirField.getText()))
          fAptProject.preferenceChanged(AptPreferenceConstants.APT_GENSRCDIR);
        boolean isAptEnabled = fAptEnabledField.isSelected();
        if (fOriginalAptEnabled != isAptEnabled) {
          // make JDT "processingEnabled" setting track APT "enabled" setting.
          setJDTProcessAnnotationsSetting(isAptEnabled);

          fAptProject.preferenceChanged(AptPreferenceConstants.APT_ENABLED);
        }
        if (fOriginalReconcileEnabled != fReconcileEnabledField.isSelected())
          fAptProject.preferenceChanged(AptPreferenceConstants.APT_RECONCILEENABLED);
      }
    }
  }