Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7045184

GTK L&F doesn't have hotkeys in jdk7 b141, while b139 has.

    Details

    • Subcomponent:
    • Resolved In Build:
      b145
    • CPU:
      x86
    • OS:
      linux
    • Verification:
      Verified

      Description

      GTK L&F doesn't have hotkeys in jdk7 b141, while b139 has.



      try testcase:

      import javax.swing.JOptionPane;
      import javax.swing.JPanel;
      import javax.swing.SwingUtilities;
      import javax.swing.UIManager;

      public final class JOptionPaneTest extends JPanel {
          public static void main(final String[] args) throws Exception {
              UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
              SwingUtilities.invokeAndWait(new Runnable() {
                  @Override public void run() {
                      JOptionPane.showInputDialog(null, "Alt+C close this dialog?");
                  }
              });
          }
      }

        Issue Links

          Activity

          Hide
          mfang Michael Fang (Inactive) added a comment -
          BT2:EVALUATION

          In most of the java GUI dialogs (mostly deployment/install dialogs), by default, the hotkey for cancel is "escape" and hotkey for the default button is "enter". We tested using SwingSet2 demo and in GTK look and feel, we can "cancel" the dialog by clicking "escape".

          We removed the mnemonic key assignment because in Asian locales, we had to add (x) after the translated string to indicate the mnenonic key assignment. Our QA reported that the underline didn't show, that's why we removed the menonic assignments.

          Do you require us to add this back? or would clicking "escape" to dismiss the dialog work for you?
          Show
          mfang Michael Fang (Inactive) added a comment - BT2:EVALUATION In most of the java GUI dialogs (mostly deployment/install dialogs), by default, the hotkey for cancel is "escape" and hotkey for the default button is "enter". We tested using SwingSet2 demo and in GTK look and feel, we can "cancel" the dialog by clicking "escape". We removed the mnemonic key assignment because in Asian locales, we had to add (x) after the translated string to indicate the mnenonic key assignment. Our QA reported that the underline didn't show, that's why we removed the menonic assignments. Do you require us to add this back? or would clicking "escape" to dismiss the dialog work for you?
          Hide
          mfang Michael Fang (Inactive) added a comment -
          BT2:EVALUATION

          The change to remove mnemonics for OK and Cancel was done according to the evaluation of a related bug
          http://monaco.sfbay.sun.com/detail.jsf?cr=7018514

          The OK and Cancel buttonsdo not have a mnemonics and shouldn't.
          OK is the default button, and therefore can be accessed by "Enter" key.
          Cancel is the Close button and therefore can be accessed by "ESC".
          etc.. etc..

          Entry 1 andy.herrick [2011-02-17 16:31]
          Show
          mfang Michael Fang (Inactive) added a comment - BT2:EVALUATION The change to remove mnemonics for OK and Cancel was done according to the evaluation of a related bug http://monaco.sfbay.sun.com/detail.jsf?cr=7018514 The OK and Cancel buttonsdo not have a mnemonics and shouldn't. OK is the default button, and therefore can be accessed by "Enter" key. Cancel is the Close button and therefore can be accessed by "ESC". etc.. etc.. Entry 1 andy.herrick [2011-02-17 16:31]
          Hide
          mfang Michael Fang (Inactive) added a comment -
          BT2:WORK AROUND

          Workaround/solution is to use "Escape" to Cancel the dialog, and "Enter" to select the default key "OK".
          Show
          mfang Michael Fang (Inactive) added a comment - BT2:WORK AROUND Workaround/solution is to use "Escape" to Cancel the dialog, and "Enter" to select the default key "OK".
          Hide
          mfang Michael Fang (Inactive) added a comment -
          BT2:EVALUATION

          According to this doc (Dialog Box Design):
          http://java.sun.com/products/jlf/ed2/book/HIG.Dialogs2.html
          It states:
          OK and Cancel Buttons

          Do not add a mnemonic to the Cancel button.
          The Cancel button should be activated when users press the Escape key. The Cancel button does not need keyboard focus for this interaction. The Cancel button and its keyboard equivalent (Escape) are not built into the JFC; you must implement them yourself.

          Default Command Buttons

          Since the Enter (and Return) key is already supplied by the JFC for keyboard access, do not add a mnemonic for the default command button.


          Feedback from JFC team ###@###.###:

          don't think we should follow this instruction. The main concept in such situation is to be like a native LAF, if possible. Therefore if native GTK dialogs have mnemonics, we should keep them.
          Show
          mfang Michael Fang (Inactive) added a comment - BT2:EVALUATION According to this doc (Dialog Box Design): http://java.sun.com/products/jlf/ed2/book/HIG.Dialogs2.html It states: OK and Cancel Buttons Do not add a mnemonic to the Cancel button. The Cancel button should be activated when users press the Escape key. The Cancel button does not need keyboard focus for this interaction. The Cancel button and its keyboard equivalent (Escape) are not built into the JFC; you must implement them yourself. Default Command Buttons Since the Enter (and Return) key is already supplied by the JFC for keyboard access, do not add a mnemonic for the default command button. Feedback from JFC team ###@###.###: don't think we should follow this instruction. The main concept in such situation is to be like a native LAF, if possible. Therefore if native GTK dialogs have mnemonics, we should keep them.

            People

            • Assignee:
              mfang Michael Fang (Inactive)
              Reporter:
              dpochepk Dmitrij Pochepko (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: