java.awt.event.ActionListener
, java.awt.event.ItemListener
, java.io.Serializable
, java.lang.Cloneable
, java.util.EventListener
, javax.swing.Action
public class LinkModelAction<T extends LinkModel> extends LinkAction<T>
LinkModel
.
This action delegates actionPerformed to vistingDelegate. PENDING: move to swingx package?
Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
VISIT_ACTION |
GROUP, IS_STATE, LARGE_ICON
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
target, VISITED_KEY
Constructor | Description |
---|---|
LinkModelAction() |
|
LinkModelAction(java.awt.event.ActionListener visitingDelegate) |
|
LinkModelAction(T target) |
|
LinkModelAction(T target,
java.awt.event.ActionListener visitingDelegate) |
Modifier and Type | Method | Description |
---|---|---|
void |
actionPerformed(java.awt.event.ActionEvent e) |
This action delegates to the visitingDelegate if both
delegate and target are != null, does nothing otherwise.
|
protected void |
installTarget() |
installs a propertyChangeListener on the target and
updates the visual properties from the target.
|
void |
setVisitingDelegate(java.awt.event.ActionListener delegate) |
The delegate to invoke on actionPerformed.
|
protected void |
uninstallTarget() |
removes the propertyChangeListener.
|
protected void |
updateFromTarget() |
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
dispose, getAccelerator, getActionCommand, getGroup, getLargeIcon, getLongDescription, getMnemonic, getName, getShortDescription, getSmallIcon, isSelected, isStateAction, setAccelerator, setActionCommand, setGroup, setLargeIcon, setLongDescription, setMnemonic, setMnemonic, setName, setSelected, setShortDescription, setSmallIcon, setStateAction, toString
getTarget, isVisited, itemStateChanged, setStateAction, setTarget, setVisited
public static final java.lang.String VISIT_ACTION
public LinkModelAction()
public LinkModelAction(java.awt.event.ActionListener visitingDelegate)
public LinkModelAction(T target)
public LinkModelAction(T target, java.awt.event.ActionListener visitingDelegate)
public void setVisitingDelegate(java.awt.event.ActionListener delegate)
The delegates actionPerformed is invoked with an ActionEvent having the target as source. Delegates are expected to cope gracefully with the T.
PENDING: JW - How to formalize?
delegate
- the action invoked on the target.public void actionPerformed(java.awt.event.ActionEvent e)
protected void installTarget()
installTarget
in class LinkAction<T extends LinkModel>
protected void uninstallTarget()
Implementation NOTE: this does not clean-up internal state! There is no need to because updateFromTarget handles both null and not-null targets. Hmm...
uninstallTarget
in class LinkAction<T extends LinkModel>
protected void updateFromTarget()