Ejemplo n.º 1
0
  @Override
  protected void buttonPressed(int buttonId) {
    if (buttonId == IDialogConstants.CLOSE_ID
        || buttonId == IDialogConstants.CANCEL_ID
        || buttonId == IDialogConstants.BACK_ID) {
      this.setReturnCode(buttonId);
      this.close();

    } else if (buttonId == IDialogConstants.OK_ID) {
      try {
        if (!validate()) {
          return;
        }

        this.perfomeOK();
        setReturnCode(buttonId);
        close();

      } catch (InputException e) {
        if (e.getMessage() != null) {
          this.setMessage(ResourceString.getResourceString(e.getMessage(), e.getArgs()));
        }
        return;

      } catch (Exception e) {
        Activator.showExceptionDialog(e);
      }
    }

    super.buttonPressed(buttonId);
  }
  @Override
  protected String getErrorMessage() {
    try {
      for (ValidatableTabWrapper tabWrapper : this.tabWrapperList) {
        tabWrapper.validatePage();
      }

    } catch (InputException e) {
      return e.getMessage();
    }

    return null;
  }