コード例 #1
0
ファイル: TabMenu.java プロジェクト: papperwing/perun
  /**
   * Return translatable button text by button type
   *
   * @param type button type
   * @return translatable button text
   */
  private static ImageResource getButtonIconByType(ButtonType type) {

    if (ButtonType.ADD.equals(type)) {
      return icons.addIcon();
    } else if (ButtonType.CREATE.equals(type)) {
      return icons.addIcon();
    } else if (ButtonType.REMOVE.equals(type)) {
      return icons.deleteIcon();
    } else if (ButtonType.DELETE.equals(type)) {
      return icons.deleteIcon();
    } else if (ButtonType.SAVE.equals(type)) {
      return icons.diskIcon();
    } else if (ButtonType.SEARCH.equals(type)) {
      return icons.findIcon();
    } else if (ButtonType.FILTER.equals(type)) {
      return icons.filterIcon();
    } else if (ButtonType.OK.equals(type)) {
      return icons.acceptIcon();
    } else if (ButtonType.CANCEL.equals(type)) {
      return icons.stopIcon();
    } else if (ButtonType.CLOSE.equals(type)) {
      return icons.crossIcon();
    } else if (ButtonType.CONTINUE.equals(type)) {
      return icons.arrowRightIcon();
    } else if (ButtonType.FINISH.equals(type)) {
      return icons.arrowRightIcon();
    } else if (ButtonType.BACK.equals(type)) {
      return icons.arrowLeftIcon();
    } else if (ButtonType.FILL.equals(type)) {
      return icons.lightningIcon();
    } else if (ButtonType.LIST_ALL_MEMBERS.equals(type)) {
      return icons.userGreenIcon();
    } else if (ButtonType.LIST_ALL_USERS.equals(type)) {
      return icons.userGrayIcon();
    } else if (ButtonType.VERIFY.equals(type)) {
      return icons.userGreenIcon();
    } else if (ButtonType.APPROVE.equals(type)) {
      return icons.acceptIcon();
    } else if (ButtonType.REJECT.equals(type)) {
      return icons.cancelIcon();
    } else if (ButtonType.REFRESH.equals(type)) {
      return icons.updateIcon();
    } else if (ButtonType.PREVIEW.equals(type)) {
      return icons.applicationFormMagnifyIcon();
    } else if (ButtonType.ENABLE.equals(type)) {
      return icons.acceptIcon();
    } else if (ButtonType.DISABLE.equals(type)) {
      return icons.cancelIcon();
    } else if (ButtonType.SETTINGS.equals(type)) {
      return icons.cogIcon();
    } else {
      // default
      return icons.errorIcon();
    }
  }
コード例 #2
0
ファイル: TabMenu.java プロジェクト: papperwing/perun
  /**
   * Return translatable button text by button type
   *
   * @param type button type
   * @return translatable button text
   */
  private static String getButtonTextByType(ButtonType type) {

    if (ButtonType.ADD.equals(type)) {
      return translation.addButton();
    } else if (ButtonType.CREATE.equals(type)) {
      return translation.createButton();
    } else if (ButtonType.REMOVE.equals(type)) {
      return translation.removeButton();
    } else if (ButtonType.DELETE.equals(type)) {
      return translation.deleteButton();
    } else if (ButtonType.SAVE.equals(type)) {
      return translation.saveButton();
    } else if (ButtonType.SEARCH.equals(type)) {
      return translation.searchButton();
    } else if (ButtonType.FILTER.equals(type)) {
      return translation.filterButton();
    } else if (ButtonType.OK.equals(type)) {
      return translation.okButton();
    } else if (ButtonType.CANCEL.equals(type)) {
      return translation.cancelButton();
    } else if (ButtonType.CLOSE.equals(type)) {
      return translation.closeButton();
    } else if (ButtonType.CONTINUE.equals(type)) {
      return translation.continueButton();
    } else if (ButtonType.FINISH.equals(type)) {
      return translation.finishButton();
    } else if (ButtonType.BACK.equals(type)) {
      return translation.backButton();
    } else if (ButtonType.FILL.equals(type)) {
      return translation.fillButton();
    } else if (ButtonType.LIST_ALL_MEMBERS.equals(type)) {
      return translation.listAllMembersButton();
    } else if (ButtonType.LIST_ALL_USERS.equals(type)) {
      return translation.listAllUsersButton();
    } else if (ButtonType.VERIFY.equals(type)) {
      return translation.verifyButton();
    } else if (ButtonType.APPROVE.equals(type)) {
      return translation.approveButton();
    } else if (ButtonType.REJECT.equals(type)) {
      return translation.rejectButton();
    } else if (ButtonType.REFRESH.equals(type)) {
      return translation.refreshButton();
    } else if (ButtonType.PREVIEW.equals(type)) {
      return translation.previewButton();
    } else if (ButtonType.ENABLE.equals(type)) {
      return translation.enableButton();
    } else if (ButtonType.DISABLE.equals(type)) {
      return translation.disableButton();
    } else if (ButtonType.SETTINGS.equals(type)) {
      return translation.settingsButton();
    } else {
      return "";
    }
  }