예제 #1
0
 /**
  * if input is null, the default button labels are returned.<br>
  * if input is not null, the input is returned.
  *
  * @param newButtonLabels Object[] containing button labels as strings.
  * @return Object[] containing button labels
  */
 private Object[] getButtonLabels(Object[] newButtonLabels) {
   if (newButtonLabels == null) {
     return new Object[] {
       parentKafenio.getTranslation("DialogAccept"), parentKafenio.getTranslation("DialogCancel")
     };
   } else {
     return newButtonLabels;
   }
 }
예제 #2
0
  /**
   * creates a new SearchDialog using the given values.
   *
   * @param parent parent frame
   * @param title frame title
   * @param bModal boolean value
   * @param bIsReplace is replace turned on by default?
   * @param bCaseSetting true for case sensitive search, false for case insensitive.
   * @param bTopSetting wrap mode on?
   * @param findText the text to find
   * @param replaceText the text to replace the found text with
   */
  public SearchDialog(
      KafenioPanel parent,
      String title,
      boolean bModal,
      boolean bIsReplace,
      boolean bCaseSetting,
      boolean bTopSetting,
      String findText,
      String replaceText) {
    super(parent, title, bModal);

    isReplaceDialog = bIsReplace;
    jtxfFindTerm = new JTextField(3);
    jtxfReplaceTerm = new JTextField(3);
    jchkCase = new JCheckBox(parent.getTranslation("SearchCaseSensitive"), bCaseSetting);
    jchkTop = new JCheckBox(parent.getTranslation("SearchStartAtTop"), bTopSetting);
    jchkAll = new JCheckBox(parent.getTranslation("SearchReplaceAll"), false);

    if (bIsReplace) {
      panelContents =
          new Object[] {
            parent.getTranslation("SearchFind"),
            jtxfFindTerm,
            parent.getTranslation("SearchReplace"),
            jtxfReplaceTerm,
            jchkAll,
            jchkCase,
            jchkTop
          };
    } else {
      panelContents =
          new Object[] {parent.getTranslation("SearchFind"), jtxfFindTerm, jchkCase, jchkTop};
    }
    if (findText != null) {
      jtxfFindTerm.setText(findText);
    }
    if (replaceText != null) {
      jtxfReplaceTerm.setText(replaceText);
    }
    init(panelContents);
    jtxfFindTerm.requestFocus();
  }
예제 #3
0
 /**
  * @param owner parent frame
  * @param title frame title
  * @param modal is a modal window?
  */
 public AbstractKafenioDialog(KafenioPanel owner, String title, boolean modal) {
   super(owner.getFrame(), title, modal);
   parentKafenio = owner;
   log.debug("new AbstractKafenioDialog created.");
 }