Class DefaultAction

java.lang.Object
javax.swing.AbstractAction
groovy.swing.impl.DefaultAction
All Implemented Interfaces:
ActionListener, Serializable, Cloneable, EventListener, Action

public class DefaultAction extends AbstractAction
An Action implementation that delegates execution to a Groovy closure.
See Also:
  • Constructor Details

    • DefaultAction

      public DefaultAction()
  • Method Details

    • actionPerformed

      public void actionPerformed(ActionEvent event)
      Invokes the configured closure in response to the action event.
      Parameters:
      event - the Swing action event
    • getClosure

      public Closure getClosure()
      Returns the closure invoked when the action fires.
      Returns:
      the action closure, or null
    • setClosure

      public void setClosure(Closure closure)
      Sets the closure invoked when the action fires.
      Parameters:
      closure - the action closure