private void updateStatus(HoverConfig hoverConfig) {
    if (hoverConfig != null && hoverConfig.fIsEnabled && hoverConfig.fStateMask == -1)
      fStatus =
          new StatusInfo(
              IStatus.ERROR,
              Messages.format(
                  PreferencesMessages.JavaEditorHoverConfigurationBlock_modifierIsNotValid,
                  hoverConfig.fModifierString));
    else fStatus = new StatusInfo();

    int i = 0;
    HashMap<Integer, String> stateMasks = new HashMap<Integer, String>(fHoverConfigs.length);
    while (fStatus.isOK() && i < fHoverConfigs.length) {
      if (fHoverConfigs[i].fIsEnabled) {
        String label = getContributedHovers()[i].getLabel();
        Integer stateMask = new Integer(fHoverConfigs[i].fStateMask);
        if (fHoverConfigs[i].fStateMask == -1)
          fStatus =
              new StatusInfo(
                  IStatus.ERROR,
                  Messages.format(
                      PreferencesMessages
                          .JavaEditorHoverConfigurationBlock_modifierIsNotValidForHover,
                      new String[] {fHoverConfigs[i].fModifierString, label}));
        else if (stateMasks.containsKey(stateMask))
          fStatus =
              new StatusInfo(
                  IStatus.ERROR,
                  Messages.format(
                      PreferencesMessages.JavaEditorHoverConfigurationBlock_duplicateModifier,
                      new String[] {label, stateMasks.get(stateMask)}));
        else stateMasks.put(stateMask, label);
      }
      i++;
    }

    fMainPreferencePage.setValid(fStatus.isOK());
    StatusUtil.applyToStatusLine(fMainPreferencePage, fStatus);
  }
 private void updateStatus(IStatus status) {
   setValid(!status.matches(IStatus.ERROR));
   StatusUtil.applyToStatusLine(this, status);
 }