예제 #1
1
  /**
   * Sets a mnemomic for the specified button.
   *
   * @param b button
   * @param mnem mnemonics that have already been assigned
   */
  public static void setMnemonic(final AbstractButton b, final StringBuilder mnem) {
    // do not set mnemonics for Mac! Alt+key used for special characters.
    if (Prop.MAC) return;

    // find and assign unused mnemomic
    final String label = b.getText();
    final int ll = label.length();
    for (int l = 0; l < ll; l++) {
      final char ch = Character.toLowerCase(label.charAt(l));
      if (!letter(ch) || mnem.indexOf(Character.toString(ch)) != -1) continue;
      b.setMnemonic(ch);
      mnem.append(ch);
      break;
    }
  }
예제 #2
0
 @Override
 public void refresh(final GUI main, final AbstractButton button) {
   button.setEnabled(text.marked());
 }
예제 #3
0
 @Override
 public void refresh(final GUI main, final AbstractButton button) {
   button.setEnabled(clip() != null);
 }
예제 #4
0
 @Override
 public void refresh(final GUI main, final AbstractButton button) {
   button.setEnabled(!undo.last());
 }