public class ClosureAbstractAction
extends javax.swing.AbstractAction
AbstractAction
.
By specifying a closure one can create an instance of the class that has the appropriate
behaviour. As with all closure classes corresponding to event handling classes,
the closure should be of arity two.
The first argument is the this
object, the object handling the event, and the
second argument is the event being handled.Constructor and Description |
---|
ClosureAbstractAction(Closure closure)
Constructs a ClosureAbstractAction object.
|
ClosureAbstractAction(java.lang.String s,
Closure closure) |
ClosureAbstractAction(java.lang.String s,
javax.swing.Icon icon,
java.lang.String tooltip,
javax.swing.KeyStroke accelerator,
java.lang.Integer mnemonic) |
ClosureAbstractAction(java.lang.String s,
javax.swing.Icon icon,
java.lang.String tooltip,
javax.swing.KeyStroke accelerator,
java.lang.Integer mnemonic,
Closure closure) |
ClosureAbstractAction(java.lang.String s,
java.lang.String tooltip,
Closure closure) |
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent event) |
void |
setActionClosure(Closure closure)
Specifies the action closure value.
|
public ClosureAbstractAction(Closure closure)
closure
- a Closure object, the closure should be of arity two.
The first argument as usual is the this
object, and the
second argument is the event being handled.public ClosureAbstractAction(java.lang.String s, Closure closure)
public ClosureAbstractAction(java.lang.String s, javax.swing.Icon icon, java.lang.String tooltip, javax.swing.KeyStroke accelerator, java.lang.Integer mnemonic)
public ClosureAbstractAction(java.lang.String s, java.lang.String tooltip, Closure closure)
public ClosureAbstractAction(java.lang.String s, javax.swing.Icon icon, java.lang.String tooltip, javax.swing.KeyStroke accelerator, java.lang.Integer mnemonic, Closure closure)
public void setActionClosure(Closure closure)
closure
- a Closure object, the closure should be of arity two.ClosureAbstractAction(java.lang.String, javax.swing.Icon, java.lang.String, javax.swing.KeyStroke, java.lang.Integer, g2d.jlambda.Closure)
public void actionPerformed(java.awt.event.ActionEvent event)