public abstract class AbstractHyperlinkAction<T> extends AbstractActionExt
JXHyperlink
configuration and
provide minimal api. Modifier and Type | Field and Description |
---|---|
protected T |
target
the object the actionPerformed can act on.
|
static String |
VISITED_KEY
Key for the visited property value.
|
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 |
---|
AbstractHyperlinkAction()
Instantiates a LinkAction with null target.
|
AbstractHyperlinkAction(T target)
Instantiates a LinkAction with a target of type targetClass.
|
Modifier and Type | Method and Description |
---|---|
T |
getTarget() |
protected void |
installTarget()
hook for subclasses to update internal state after
a new target has been set.
|
boolean |
isVisited() |
void |
itemStateChanged(ItemEvent e)
Callback method as
ItemListener . |
void |
setStateAction(boolean state)
Set the state property.
|
void |
setTarget(T target)
PRE: isTargetable(target)
|
void |
setVisited(boolean visited)
Set the visited property.
|
protected void |
uninstallTarget()
hook for subclasses to cleanup before the old target
is overwritten.
|
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
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
actionPerformed
public static final String VISITED_KEY
public AbstractHyperlinkAction()
public AbstractHyperlinkAction(T target)
installTarget()
target
- the target this action should act on.public void setVisited(boolean visited)
visited
- public boolean isVisited()
protected void installTarget()
Subclasses are free to decide the details. Here:
protected void uninstallTarget()
Subclasses are free to decide the details. Here: does nothing.
public void itemStateChanged(ItemEvent e)
AbstractActionExt
ItemListener
. Updates internal state based
on the given ItemEvent. Here: synchs selected property if isStateAction(), does nothing otherwise.
itemStateChanged
in interface ItemListener
itemStateChanged
in class AbstractActionExt
e
- the ItemEvent fired by a ItemSelectable on changing the selected
state.public void setStateAction(boolean state)
setStateAction
in class AbstractActionExt
state
- if true then this action will fire ItemEventsWebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses