Class ToolAction

java.lang.Object
com.sun.javatest.tool.ToolAction
All Implemented Interfaces:
ActionListener, EventListener, Action

public abstract class ToolAction extends Object implements Action
Standard template for creation of an Action to be used in a Tool.
  • Constructor Details

    • ToolAction

      public ToolAction(String name, String desc, int mnemonic)
      Construct an action with a specific mnemonic. This is the non-internationalized version and not recommended. See Action for details on the parameters.
      Parameters:
      name - Name of this action
      desc - Description of this action
      mnemonic - Mnemonic associated with this action
      See Also:
    • ToolAction

      public ToolAction(UIFactory uif, 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

      public ToolAction(UIFactory uif, 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 the SMALL_ICON property.
      See Also:
    • ToolAction

      public ToolAction(I18NResourceBundle i18n, 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 properties
      key - Key for retrieving internationalized strings from the bundle.
  • Method Details

    • getValue

      public Object getValue(String key)
      Gets one of this object's properties using the associated key.
      Specified by:
      getValue in interface Action
      Parameters:
      key - the key of the property to be returned
      Returns:
      the value of the property with the given key
      See Also:
    • putValue

      public void putValue(String key, Object newVal)
      Sets one of this object's properties using the associated key. If the value has changed, a PropertyChangeEvent is sent to listeners.
      Specified by:
      putValue in interface Action
      Parameters:
      key - the key of the property to be stored
      newVal - the new value for the property
    • isEnabled

      public boolean isEnabled()
      Specified by:
      isEnabled in interface Action
    • setEnabled

      public void setEnabled(boolean newVal)
      Specified by:
      setEnabled in interface Action
    • addPropertyChangeListener

      public void addPropertyChangeListener(PropertyChangeListener listener)
      Specified by:
      addPropertyChangeListener in interface Action
    • removePropertyChangeListener

      public void removePropertyChangeListener(PropertyChangeListener listener)
      Specified by:
      removePropertyChangeListener in interface Action