public class LinkModelAction<T extends LinkModel> extends AbstractHyperlinkAction<T>
LinkModel
.
This action delegates actionPerformed to vistingDelegate. PENDING: move to swingx package?
Modifier and Type | Field and Description |
---|---|
private ActionListener |
delegate |
private PropertyChangeListener |
linkListener |
static String |
VISIT_ACTION |
target, VISITED_KEY
GROUP, IS_STATE, LARGE_ICON
changeSupport, enabled
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
Constructor and Description |
---|
LinkModelAction() |
LinkModelAction(ActionListener visitingDelegate) |
LinkModelAction(T target) |
LinkModelAction(T target,
ActionListener visitingDelegate) |
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent e)
This action delegates to the visitingDelegate if both
delegate and target are !
|
private PropertyChangeListener |
getTargetListener() |
protected void |
installTarget()
installs a propertyChangeListener on the target and
updates the visual properties from the target.
|
void |
setVisitingDelegate(ActionListener delegate)
The delegate to invoke on actionPerformed.
|
protected void |
uninstallTarget()
removes the propertyChangeListener.
|
protected void |
updateFromTarget() |
getTarget, isVisited, itemStateChanged, setStateAction, setTarget, setVisited
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
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
private ActionListener delegate
public static final String VISIT_ACTION
private PropertyChangeListener linkListener
public LinkModelAction()
public LinkModelAction(ActionListener visitingDelegate)
public LinkModelAction(T target)
public LinkModelAction(T target, ActionListener visitingDelegate)
public void setVisitingDelegate(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(ActionEvent e)
protected void installTarget()
installTarget
in class AbstractHyperlinkAction<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 AbstractHyperlinkAction<T extends LinkModel>
protected void updateFromTarget()
private PropertyChangeListener getTargetListener()
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses