Package com.sun.javatest.tool
Class ToolAction
- java.lang.Object
-
- com.sun.javatest.tool.ToolAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.util.EventListener
,javax.swing.Action
public abstract class ToolAction extends java.lang.Object implements javax.swing.Action
Standard template for creation of an Action to be used in a Tool.
-
-
Constructor Summary
Constructors Constructor Description ToolAction(UIFactory uif, java.lang.String key)
Construct an internationalized action.ToolAction(UIFactory uif, java.lang.String key, boolean needIcon)
Construct an internationalized action.ToolAction(I18NResourceBundle i18n, java.lang.String key)
Construct an internationalized action.ToolAction(java.lang.String name, java.lang.String desc, int mnemonic)
Construct an action with a specific mnemonic.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
java.lang.Object
getValue(java.lang.String key)
Gets one of this object's properties using the associated key.boolean
isEnabled()
void
putValue(java.lang.String key, java.lang.Object newVal)
Sets one of this object's properties using the associated key.void
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
void
setEnabled(boolean newVal)
-
-
-
Constructor Detail
-
ToolAction
public ToolAction(java.lang.String name, java.lang.String desc, int mnemonic)
Construct an action with a specific mnemonic. This is the non-internationalized version and not recommended. SeeAction
for details on the parameters.- Parameters:
name
- Name of this actiondesc
- Description of this actionmnemonic
- Mnemonic associated with this action- See Also:
Action
-
ToolAction
public ToolAction(UIFactory uif, java.lang.String key)
Construct an internationalized action.- Parameters:
uif
- Factory to use for getting strings.key
- Key for retrieving internationalized strings from the bundle.- See Also:
ToolAction(I18NResourceBundle, String)
-
ToolAction
public ToolAction(UIFactory uif, java.lang.String key, boolean needIcon)
Construct an internationalized action.- Parameters:
uif
- Factory to use for getting strings.key
- Key for retrieving internationalized strings from the bundle.needIcon
- True if an icon resource should be associated with this action. Will be retrieved through the uif. And put into theSMALL_ICON
property.- See Also:
ToolAction(I18NResourceBundle, String)
,Action.SMALL_ICON
-
ToolAction
public ToolAction(I18NResourceBundle i18n, java.lang.String key)
Construct an internationalized action. The resources used are:uiKey.act the name for the button uiKey.tip the tool tip for the action uiKey.mne mnemonic for this action - Parameters:
i18n
- Resource bundle to use when getting action propertieskey
- Key for retrieving internationalized strings from the bundle.
-
-
Method Detail
-
getValue
public java.lang.Object getValue(java.lang.String key)
Gets one of this object's properties using the associated key.- Specified by:
getValue
in interfacejavax.swing.Action
- Parameters:
key
- the key of the property to be returned- Returns:
- the value of the property with the given key
- See Also:
putValue(java.lang.String, java.lang.Object)
-
putValue
public void putValue(java.lang.String key, java.lang.Object newVal)
Sets one of this object's properties using the associated key. If the value has changed, aPropertyChangeEvent
is sent to listeners.- Specified by:
putValue
in interfacejavax.swing.Action
- Parameters:
key
- the key of the property to be storednewVal
- the new value for the property
-
isEnabled
public boolean isEnabled()
- Specified by:
isEnabled
in interfacejavax.swing.Action
-
setEnabled
public void setEnabled(boolean newVal)
- Specified by:
setEnabled
in interfacejavax.swing.Action
-
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
- Specified by:
addPropertyChangeListener
in interfacejavax.swing.Action
-
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
- Specified by:
removePropertyChangeListener
in interfacejavax.swing.Action
-
-