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.ActionStandard 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 voidaddPropertyChangeListener(java.beans.PropertyChangeListener listener)java.lang.ObjectgetValue(java.lang.String key)Gets one of this object's properties using the associated key.booleanisEnabled()voidputValue(java.lang.String key, java.lang.Object newVal)Sets one of this object's properties using the associated key.voidremovePropertyChangeListener(java.beans.PropertyChangeListener listener)voidsetEnabled(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. SeeActionfor 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_ICONproperty.- 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:
getValuein 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, aPropertyChangeEventis sent to listeners.- Specified by:
putValuein 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:
isEnabledin interfacejavax.swing.Action
-
setEnabled
public void setEnabled(boolean newVal)
- Specified by:
setEnabledin interfacejavax.swing.Action
-
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
- Specified by:
addPropertyChangeListenerin interfacejavax.swing.Action
-
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
- Specified by:
removePropertyChangeListenerin interfacejavax.swing.Action
-
-