@Override
  public void loadProperties(final IProject project) {
    try {
      String temp =
          project.getPersistentProperty(
              new QualifiedName(
                  ProjectBuildPropertyData.QUALIFIER,
                  COptimalizationOptionsData.OPTIMIZATION_LEVEL_PROPERTY));
      if (temp != null && temp.length() != 0) {
        optimalizationLevel.setSelectedValue(temp);
      } else {
        optimalizationLevel.setSelectedValue("Common optimizations");
      }

      temp =
          project.getPersistentProperty(
              new QualifiedName(
                  ProjectBuildPropertyData.QUALIFIER,
                  COptimalizationOptionsData.OTHER_OPTIMIZATION_FLAGS_PROPERTY));
      otherFlags.setStringValue(temp);
    } catch (CoreException e) {
      optimalizationLevel.setSelectedValue("Common optimizations");
      otherFlags.setStringValue("");
    }
  }
  @Override
  public void performDefaults() {
    if (mainComposite == null) {
      return;
    }

    optimalizationLevel.setEnabled(true, mainComposite);
    optimalizationLevel.setSelectedValue("Common optimizations");

    otherFlags.setEnabled(true, mainComposite);
    otherFlags.setStringValue("");
  }
  @Override
  public boolean saveProperties(final IProject project) {
    try {
      QualifiedName qualifiedName =
          new QualifiedName(
              ProjectBuildPropertyData.QUALIFIER,
              COptimalizationOptionsData.OPTIMIZATION_LEVEL_PROPERTY);
      String newValue = optimalizationLevel.getActualValue();
      String oldValue = project.getPersistentProperty(qualifiedName);
      if (newValue != null && !newValue.equals(oldValue)) {
        project.setPersistentProperty(qualifiedName, newValue);
      }

      qualifiedName =
          new QualifiedName(
              ProjectBuildPropertyData.QUALIFIER,
              COptimalizationOptionsData.OTHER_OPTIMIZATION_FLAGS_PROPERTY);
      newValue = otherFlags.getStringValue();
      oldValue = project.getPersistentProperty(qualifiedName);
      if (newValue != null && !newValue.equals(oldValue)) {
        project.setPersistentProperty(qualifiedName, newValue);
      }
    } catch (CoreException e) {
      ErrorReporter.logExceptionStackTrace(e);
      return false;
    }

    return true;
  }
  @Override
  public void setEnabled(final boolean enabled) {
    if (mainComposite == null) {
      return;
    }

    optimalizationLevel.setEnabled(enabled, mainComposite);
    otherFlags.setEnabled(enabled, mainComposite);
  }
  @Override
  public void dispose() {
    if (mainComposite != null) {
      mainComposite.dispose();
      mainComposite = null;

      optimalizationLevel.dispose();
      otherFlags.dispose();
    }
  }