ActionListener
, ItemListener
, Serializable
, Cloneable
, EventListener
, Action
BasicCalendarHeaderHandler.ZoomOutAction
, HyperlinkAction
, LinkModelAction
public abstract class AbstractHyperlinkAction<T> extends AbstractActionExt
JXHyperlink
configuration and
provide minimal api. Modifier and Type | Field | Description |
---|---|---|
protected T |
target |
the object the actionPerformed can act on.
|
static String |
VISITED_KEY |
Key for the visited property value.
|
changeSupport, enabled
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
Constructor | Description |
---|---|
AbstractHyperlinkAction() |
Instantiates a LinkAction with null target.
|
AbstractHyperlinkAction(T target) |
Instantiates a LinkAction with a target of type targetClass.
|
Modifier and Type | Method | 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.
|
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
actionPerformed
public static final String VISITED_KEY
protected T target
public AbstractHyperlinkAction()
public AbstractHyperlinkAction(T target)
installTarget()
target
- the target this action should act on.public void setVisited(boolean visited)
visited
- public boolean isVisited()
public T getTarget()
public void setTarget(T target)
target
- 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 ItemEventsCopyright © 2018. All rights reserved.