Package io.guise.framework.coupler
Class ActionCardCoupler
- java.lang.Object
-
- com.globalmentor.beans.BoundPropertyObject
-
- io.guise.framework.event.GuiseBoundPropertyObject
-
- io.guise.framework.coupler.AbstractCardCoupler
-
- io.guise.framework.coupler.ActionCardCoupler
-
- All Implemented Interfaces:
com.globalmentor.beans.PropertyBindable
,com.globalmentor.beans.PropertyConstrainable
public class ActionCardCoupler extends AbstractCardCoupler
Associates an action control with a card in a card control. When the action is initiated, the first displayed and enabled specified card within the card control will be selected. When any of the the associated cards are selected, if the action implementsSelectable
the action will be selected. If the card's constraints implementDisplayable
, the action will be displayed based upon the card constraints' displayed status. If the card's constraints implementEnableable
, the action will be enabled based upon the card constraints' enabled status. If a card's constraints implementTaskCardConstraints
and the action implementsActionValueControl
and represents aTaskState
value, the action's contained value will reflect any changes in the card constraints task state. If the action implementsSelectActionControl
its auto-select status will be turned off when installed. This coupler is only functional when the given card is contained within aCardControl
.- Author:
- Garret Wilson
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ACTION_PROPERTY
The bound property of the action.-
Fields inherited from class io.guise.framework.coupler.AbstractCardCoupler
CARD_PROPERTY, CARDS_PROPERTY
-
-
Constructor Summary
Constructors Constructor Description ActionCardCoupler()
Default constructor.ActionCardCoupler(ActionControl actionControl, Component... cards)
Action and cards constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ActionControl
getAction()
void
setAction(ActionControl newAction)
Sets the connected action.protected void
updateDisplayed(boolean displayed)
Updates the current displayed status.protected void
updateEnabled(boolean enabled)
Updates the current enabled status.protected void
updateSelected(boolean selected)
Updates the current selected status.protected void
updateTaskState(com.globalmentor.model.TaskState taskState)
Updates the current task state.-
Methods inherited from class io.guise.framework.coupler.AbstractCardCoupler
getCard, getCardControl, getCards, installCardConstraints, isCardSelectable, selectCard, selectCard, setCard, setCards, uninstallCardConstraints, updateDisplayed, updateEnabled, updateSelected, updateTaskState
-
Methods inherited from class io.guise.framework.event.GuiseBoundPropertyObject
getSession
-
Methods inherited from class com.globalmentor.beans.BoundPropertyObject
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, createPostponedPropertyChangeEvent, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getForwardPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeSupport, getRepeatPropertyChangeListener, getRepeatVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, getVetoableChangeSupport, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
-
-
-
-
Constructor Detail
-
ActionCardCoupler
public ActionCardCoupler()
Default constructor.
-
ActionCardCoupler
public ActionCardCoupler(ActionControl actionControl, Component... cards)
Action and cards constructor.- Parameters:
actionControl
- The new action to connect to the card, ornull
if the action should not be coupled with a card.cards
- The new cards to connect, if any.
-
-
Method Detail
-
getAction
public ActionControl getAction()
- Returns:
- The action to connect to the card, or
null
if the action is not coupled with a card.
-
setAction
public void setAction(ActionControl newAction)
Sets the connected action. This is a bound property.- Parameters:
newAction
- The new action to connect to the card, ornull
if the action should not be coupled with a card.- See Also:
ACTION_PROPERTY
-
updateDisplayed
protected void updateDisplayed(boolean displayed)
Updates the current displayed status. This implementation does nothing.This implementation updates the action's displayed status. If no action is connected, no action occurs.
- Overrides:
updateDisplayed
in classAbstractCardCoupler
- Parameters:
displayed
- The new displayed status.
-
updateEnabled
protected void updateEnabled(boolean enabled)
Updates the current enabled status. This implementation does nothing.This implementation updates the action's enabled status. If no action is connected, no action occurs.
- Overrides:
updateEnabled
in classAbstractCardCoupler
- Parameters:
enabled
- The new enabled status.
-
updateTaskState
protected void updateTaskState(com.globalmentor.model.TaskState taskState)
Description copied from class:AbstractCardCoupler
Updates the current task state. This implementation does nothing.- Overrides:
updateTaskState
in classAbstractCardCoupler
- Parameters:
taskState
- The new task state, ornull
if there is no task state.
-
updateSelected
protected void updateSelected(boolean selected)
Description copied from class:AbstractCardCoupler
Updates the current selected status. This implementation does nothing.- Overrides:
updateSelected
in classAbstractCardCoupler
- Parameters:
selected
- The new selected status.
-
-