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

Improve Action support in AbstractButton subclasses

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.3.0
    • client-libs
    • beta
    • generic
    • generic



      Name: krC82822 Date: 12/11/2000


      orig synopsis: "Add proper Action support to AbstractButton inherited classes"

      java version "1.3.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
      Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)

      The introduction of javax.swing.Action and AbstractButton.get/setAction() is
      great for people writing GUIs using IDEs, but PLEASE add proper support for
      Actions to AbstractButton subclasses such as JButton, JMenuItem,
      JCheckBoxMenuItem, JToggleButton, JRadioButton, JCheckBox etc.

      Some bug examples:

      JButton: overwrites AbstractButton.configurePropertiesFromAction() to check for
      the "hideActionText" clientProperty BUT FORGETS to overwrite
      AbstractButton.createActionPropertyChangeListener() so when you modify an Action
      AFTER you've done JButton.setAction(), the hideActionText() is ignored and the text
      is set anyway!!!!

      JMenuItem: overwrites AbstractButton.configurePropertiesFromAction() but FORGETS
      to get & set the ACCELERATOR_KEY property from the Action. (accelerators are
      pretty common (understatement) for a JMenuItem!) Same as with JButton: doesn't
      overwrite AbstractButton.createActionPropertyChangeListener(), so changes to an
      Action after the setAction() method aren't dealt with properly!

      JCheckBoxMenuItem/JCheckBox/JRadioButtonMenuitem/JRadioButton/JToggleButton:
      I agree that defining a STATE/SELECTED key in javax.swing.Action is excessive,
      since only the CheckBox/Radio components use that, but AT LEAST add/check for a
      custom Action property "state"/"selected" to/in AbstractAction (using
      get/putValue()). This way a programmer can check the "state"/"selected" property
      (of Boolean type) when actionPerformed() is called!

      All these bugs together make it VERY difficult to effectively use Actions to
      design a GUI at the moment, so PLEASE fix this ASAP (preferably the next 1.3
      release (1.3.1))!!!

      Also, please add get/set methods for the Action keys in AbstractAction so we
      can use AbstractAction in an IDE's designer (bug 4371936).

      (Review ID: 111027)
      ======================================================================

            mdavidsosunw Mark Davidson (Inactive)
            kryansunw Kevin Ryan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: