public class ClosureAction extends Attributable implements javax.swing.Action
Action
instance.
Maybe providing an obvious implementation of the required methods
other than actionPerformed might make more sense?!?DEBUG
Constructor and Description |
---|
ClosureAction(Closure closure)
Constructs a ClosureAction object.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e) |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener) |
java.lang.Object |
getValue(java.lang.String key) |
boolean |
isEnabled() |
void |
putValue(java.lang.String key,
java.lang.Object value) |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener) |
void |
setActionClosure(Closure closure)
Specifies the action closure value.
|
void |
setAddPropertyChangeListenerClosure(Closure closure)
Specifies the closure to be applied when a property listener is added.
|
void |
setEnabled(boolean b) |
void |
setGetValueClosure(Closure closure)
Specifies the getValue closure value.
|
void |
setIsEnabledClosure(Closure closure)
Specifies the isEnabled closure value.
|
void |
setPutEnabledClosure(Closure closure)
Specifies the putEnabled closure value.
|
void |
setRemovePropertyChangeListenerClosure(Closure closure)
Specifies the closure to be applied when a property listener is removed.
|
void |
setSetEnabledClosure(Closure closure)
Specifies the setEnabled closure value.
|
_getAttribute, _setAttribute, getAttribute, getAttributeAsBoolean, getAttributeAsByte, getAttributeAsChar, getAttributeAsClosure, getAttributeAsDouble, getAttributeAsFloat, getAttributeAsInt, getAttributeAsShort, getAttributeAsString, getKeys, getStaticAttribute, getStaticKeys, isAttribute, isStaticAttribute, removeAllAttributes, removeAllStaticAttributes, removeAttribute, removeStaticAttribute, setAttribute, setStaticAttribute, showAttributes, showAttributes
public ClosureAction(Closure closure)
closure
- a Closure object, to be called upon the generation of an
ActionEvent
. The closure should be of arity two.
The first argument as usual is the this
object, and the
second argument is the action event being handled.public void setActionClosure(Closure closure)
closure
- a Closure object, to be called upon the generation of an
ActionEvent
. The closure should be of arity two.
The first argument as usual is the this
object, and the
second argument is the action event being handled.public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener
in interface javax.swing.Action
public void setAddPropertyChangeListenerClosure(Closure closure)
closure
- of arity two. The first argument as usual is the
this
object, and the
second argument is the PropertyChangeListener
object being added.removePropertyChangeListener(java.beans.PropertyChangeListener)
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener
in interface javax.swing.Action
public void setRemovePropertyChangeListenerClosure(Closure closure)
closure
- of arity two. The first argument as usual is the
this
object, and the
second argument is the PropertyChangeListener
object being removed.addPropertyChangeListener(java.beans.PropertyChangeListener)
public java.lang.Object getValue(java.lang.String key)
getValue
in interface javax.swing.Action
public void setGetValueClosure(Closure closure)
closure
- of arity two.public void setIsEnabledClosure(Closure closure)
closure
- of arity two.public boolean isEnabled()
isEnabled
in interface javax.swing.Action
public void setPutEnabledClosure(Closure closure)
closure
- of arity two.public void putValue(java.lang.String key, java.lang.Object value)
putValue
in interface javax.swing.Action
public void setSetEnabledClosure(Closure closure)
closure
- of arity two.public void setEnabled(boolean b)
setEnabled
in interface javax.swing.Action