JDK-4371936 : Add get/set methods for javax.swing.Action properties
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.3.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2000-09-18
  • Updated: 2002-10-14
  • Resolved: 2002-10-14
Related Reports
Duplicate :  
Description

Name: rmT116609			Date: 09/18/2000


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)

Please add get/set methods for the Action properties (AbstractAction to be more
precise). This will help when using AbstractActions in combination with an IDE
(such a Forte or JBuilder). Currently the only way to set the icon property is
to call action.putValue(Action.SMALL_ICON, icon); The more preferable way is to
do action.setIcon(icon);
(Review ID: 109687) 
======================================================================

Comments
EVALUATION The getValue/putValue methods in AbstractAction will allow for the setting of just about all the properties on an action. However, what is asked for (paraphrasing here) is that all the keys in Action should map to get/set pairs: ACTION_COMMAND_KEY SHORT_DESCRIPTION LONG_DESCRIPTION NAME SMALL_ICON LARGE_ICON MNEMONIC_KEY The work around is to create a subclass of AbstractAction and define these get/set methods yourself. Seems like a good idea. Should do this. mark.davidson@Eng 2001-02-26
26-02-2001

WORK AROUND Name: rmT116609 Date: 09/18/2000 Write your own Action class with extends AbstractAction. ====================================================================== Create get/set methods which wrap the Action keys. ie, for ACTION_COMMAND_KEY: public String getActionCommand() { return (String)getValue(Action.ACTION_COMMAND_KEY); } public void setActionCommand(String command) { putValue(Action.ACTION_COMMAND_KEY, command); } mark.davidson@Eng 2001-02-26
26-02-2001