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

RFE: registerKeyboardAction should allow to specify action commands

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.0
    • 1.1.4
    • client-libs
    • 1.0fcs
    • sparc
    • solaris_2.5.1

        [gelf 10/9/97]

        In the current version of Swing that I'm using (0.4)
        Jcomponent. registerKeyboardAction does not allow to specify action
        commands, thus making impossible to share keyboard listeners.

        E.g. One can specify action commands for JMenuItems and then handle
        all menu events with one ActionListener. Similar functionality is desirable
        for Swing keyboard listeners.

        The reason it came to my attention was that I tried to implement global
        menu hotkeys which are not supported in Swing (might be a separate RFE).
        At that time my code contained one ActionListener that handled all menu
        commands distinguishing among them by means of action commands. If I could
        specify action commands for keyboard actions I would have been able to
        use the same action listener to handle hotkeys by specifying identical
        action commands. I couldn't do this and I had to split one action listener
        into several small ones to handle individual requests, which resulted
        in unnecessary bloated code.

              duke J. Duke
              duke J. Duke
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: