Package com.sun.javatest.tool
Class ToolAction
java.lang.Object
com.sun.javatest.tool.ToolAction
- All Implemented Interfaces:
ActionListener
,EventListener
,Action
Standard template for creation of an Action to be used in a Tool.
-
Field Summary
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
-
Constructor Summary
ConstructorsConstructorDescriptionToolAction
(UIFactory uif, String key) Construct an internationalized action.ToolAction
(UIFactory uif, String key, boolean needIcon) Construct an internationalized action.ToolAction
(I18NResourceBundle i18n, String key) Construct an internationalized action.ToolAction
(String name, String desc, int mnemonic) Construct an action with a specific mnemonic. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Gets one of this object's properties using the associated key.boolean
void
Sets one of this object's properties using the associated key.void
void
setEnabled
(boolean newVal) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.awt.event.ActionListener
actionPerformed
-
Constructor Details
-
ToolAction
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:
-
ToolAction
Construct an internationalized action.- Parameters:
uif
- Factory to use for getting strings.key
- Key for retrieving internationalized strings from the bundle.- See Also:
-
ToolAction
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
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 Details
-
getValue
Gets one of this object's properties using the associated key. -
putValue
Sets one of this object's properties using the associated key. If the value has changed, aPropertyChangeEvent
is sent to listeners. -
isEnabled
public boolean isEnabled() -
setEnabled
public void setEnabled(boolean newVal) - Specified by:
setEnabled
in interfaceAction
-
addPropertyChangeListener
- Specified by:
addPropertyChangeListener
in interfaceAction
-
removePropertyChangeListener
- Specified by:
removePropertyChangeListener
in interfaceAction
-