Package org.jdesktop.swingx.hyperlink
Class LinkModelAction<T extends LinkModel>
java.lang.Object
javax.swing.AbstractAction
org.jdesktop.swingx.action.AbstractActionExt
org.jdesktop.swingx.hyperlink.AbstractHyperlinkAction<T>
org.jdesktop.swingx.hyperlink.LinkModelAction<T>
- All Implemented Interfaces:
ActionListener,ItemListener,Serializable,Cloneable,EventListener,Action
Specialized LinkAction for a target of type
LinkModel.
This action delegates actionPerformed to vistingDelegate. PENDING: move to swingx package?
- Author:
- Jeanette Winzenburg
- See Also:
-
Field Summary
FieldsFields inherited from class org.jdesktop.swingx.hyperlink.AbstractHyperlinkAction
target, VISITED_KEYFields inherited from class org.jdesktop.swingx.action.AbstractActionExt
GROUP, IS_STATE, LARGE_ICONFields inherited from class javax.swing.AbstractAction
changeSupport, enabledFields inherited from interface javax.swing.Action
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 Summary
ConstructorsConstructorDescriptionLinkModelAction(ActionListener visitingDelegate) LinkModelAction(T target) LinkModelAction(T target, ActionListener visitingDelegate) -
Method Summary
Modifier and TypeMethodDescriptionvoidThis action delegates to the visitingDelegate if both delegate and target are !protected voidinstalls a propertyChangeListener on the target and updates the visual properties from the target.voidsetVisitingDelegate(ActionListener delegate) The delegate to invoke on actionPerformed.protected voidremoves the propertyChangeListener.protected voidMethods inherited from class org.jdesktop.swingx.hyperlink.AbstractHyperlinkAction
getTarget, isVisited, itemStateChanged, setStateAction, setTarget, setVisitedMethods inherited from class org.jdesktop.swingx.action.AbstractActionExt
dispose, getAccelerator, getActionCommand, getGroup, getLargeIcon, getLongDescription, getMnemonic, getName, getShortDescription, getSmallIcon, isSelected, isStateAction, setAccelerator, setActionCommand, setGroup, setLargeIcon, setLongDescription, setMnemonic, setMnemonic, setName, setSelected, setShortDescription, setSmallIcon, setStateAction, toStringMethods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
Field Details
-
VISIT_ACTION
- See Also:
-
-
Constructor Details
-
LinkModelAction
public LinkModelAction() -
LinkModelAction
-
LinkModelAction
-
LinkModelAction
-
-
Method Details
-
setVisitingDelegate
The delegate to invoke on actionPerformed.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?
- Parameters:
delegate- the action invoked on the target.
-
actionPerformed
This action delegates to the visitingDelegate if both delegate and target are != null, does nothing otherwise. The actionEvent carries the target as source. PENDING: pass through a null target? - most probably! -
installTarget
protected void installTarget()installs a propertyChangeListener on the target and updates the visual properties from the target.- Overrides:
installTargetin classAbstractHyperlinkAction<T extends LinkModel>
-
uninstallTarget
protected void uninstallTarget()removes the propertyChangeListener.Implementation NOTE: this does not clean-up internal state! There is no need to because updateFromTarget handles both null and not-null targets. Hmm...
- Overrides:
uninstallTargetin classAbstractHyperlinkAction<T extends LinkModel>
-
updateFromTarget
protected void updateFromTarget()
-