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 |
|---|---|
static String |
VISIT_ACTION |
target, VISITED_KEYGROUP, IS_STATE, LARGE_ICONchangeSupport, enabledACCELERATOR_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 != null, does nothing otherwise.
|
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, setVisiteddispose, getAccelerator, getActionCommand, getGroup, getLargeIcon, getLongDescription, getMnemonic, getName, getShortDescription, getSmallIcon, isSelected, isStateAction, setAccelerator, setActionCommand, setGroup, setLargeIcon, setLongDescription, setMnemonic, setMnemonic, setName, setSelected, setShortDescription, setSmallIcon, setStateAction, toStringaddPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabledpublic static final String VISIT_ACTION
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()
Copyright © 2017. All Rights Reserved.