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

possible hardcoded mnemonic for JFileChooser metal and motif l&f

    Details

    • Subcomponent:
    • Resolved In Build:
      b06
    • CPU:
      x86
    • OS:
      linux_redhat_5.0

      Backports

        Description

        As seen in following, 3 mnemonic keys seems to be hardcoded and making them unable to localize. Please consider externalizing them to src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal.properties for example.

        src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java

                    "FileChooser.lookInLabelMnemonic", new Integer(KeyEvent.VK_I),
                    "FileChooser.fileNameLabelMnemonic", new Integer(KeyEvent.VK_N),
                    "FileChooser.filesOfTypeLabelMnemonic", new Integer(KeyEvent.VK_T),
        Similar hardcode also found in motif L&F.

        src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java

                    "FileChooser.pathLabelMnemonic", new Integer(KeyEvent.VK_P), // 'p'
                    "FileChooser.filterLabelMnemonic", new Integer (KeyEvent.VK_R), // 'r'
                    "FileChooser.foldersLabelMnemonic", new Integer (KeyEvent.VK_L), // 'l'
                    "FileChooser.filesLabelMnemonic", new Integer (KeyEvent.VK_I), // 'i'
                    "FileChooser.enterFileNameLabelMnemonic", new Integer (KeyEvent.VK_N), // 'n'

        Since following keys in src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_xx.properties being translated, in some languages mnemonic character is not in label string and won't show up in gui.

        FileChooser.pathLabelText=Enter path or folder name:
        FileChooser.filterLabelText=Filter
        FileChooser.foldersLabelText=Folders
        FileChooser.filesLabelText=Files
        FileChooser.enterFileNameLabelText=Enter file name:
        FileChooser.enterFolderNameLabelText=Enter folder name:

          Activity

          Hide
          rupashka Pavel Porvatov (Inactive) added a comment -
          BT2:EVALUATION

          We should move hardcoded mnemonics from Metal, Motif and Windows LookAndFeels to properties files. We should also allow to use Integer and String values of "FileChooser.fileNameLabelMnemonic" and other mnemonics, because before the fix values are Integer, after the fix values are Strings (because of they are read from properties files)
          Show
          rupashka Pavel Porvatov (Inactive) added a comment - BT2:EVALUATION We should move hardcoded mnemonics from Metal, Motif and Windows LookAndFeels to properties files. We should also allow to use Integer and String values of "FileChooser.fileNameLabelMnemonic" and other mnemonics, because before the fix values are Integer, after the fix values are Strings (because of they are read from properties files)

            People

            • Assignee:
              rupashka Pavel Porvatov (Inactive)
              Reporter:
              ogino Shinya Ogino (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: