Class DynamicAction

java.lang.Object
javax.swing.AbstractAction
uk.theretiredprogrammer.actionssupport.DynamicAction
All Implemented Interfaces:
ActionListener, Serializable, Cloneable, EventListener, Action
Direct Known Subclasses:
DynamicAsyncAction

public class DynamicAction extends AbstractAction implements ActionListener
A DynamicAction is an Action which can be enabled or disabled, it is not displayed when disabled.

Methods return the object - allowing the builder style of method chaining during construction, if required.

A DynamicAction is an implementation of the Netbeans AbstractAction class.

See Also:
  • Constructor Details

    • DynamicAction

      public DynamicAction(String label)
      Construct a DynamicAction which is enabled
      Parameters:
      label - The label used when this DynamicAction is displayed.
  • Method Details

    • onAction

      public DynamicAction onAction(Runnable action)
      Set the Action method.
      Parameters:
      action - the method to be run when this action is selected.
      Returns:
      this object
    • enable

      public DynamicAction enable(boolean enable)
      Enable/Disable this Action.
      Parameters:
      enable - true if enable, false if disable.
      Returns:
      this object
    • actionPerformed

      public void actionPerformed(ActionEvent e)
      Specified by:
      actionPerformed in interface ActionListener