Package io.guise.framework.coupler
Class ListSelectCardCoupler<V>
- java.lang.Object
-
- com.globalmentor.beans.BoundPropertyObject
-
- io.guise.framework.event.GuiseBoundPropertyObject
-
- io.guise.framework.coupler.AbstractCardCoupler
-
- io.guise.framework.coupler.ListSelectCardCoupler<V>
-
- Type Parameters:
V
- The type of values to select. When the specified value is selected, the first displayed and enabled specified card within the card control will be selected. When any of the the associated cards are selected, the specified value is selected. If the card's constraints implementDisplayable
, the list selected value will be displayed based upon the card constraints' displayed status. If the card's constraints implementEnableable
, the list selected value will be enabled based upon the card constraints' enabled status. This coupler is only functional when the given card is contained within aCardControl
.
- All Implemented Interfaces:
com.globalmentor.beans.PropertyBindable
,com.globalmentor.beans.PropertyConstrainable
public class ListSelectCardCoupler<V> extends AbstractCardCoupler
Coupler that associates aListSelectControl
with a card in aCardControl
.- Author:
- Garret Wilson
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
LIST_SELECT_PROPERTY
The bound property of the list select control.static java.lang.String
VALUE_PROPERTY
The value bound property.-
Fields inherited from class io.guise.framework.coupler.AbstractCardCoupler
CARD_PROPERTY, CARDS_PROPERTY
-
-
Constructor Summary
Constructors Constructor Description ListSelectCardCoupler()
Default constructor.ListSelectCardCoupler(ListSelectControl<V> listSelect, V value, Component... cards)
List select, value, and cards constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ListSelectControl<V>
getListSelect()
V
getValue()
void
setListSelect(ListSelectControl<V> newListSelect)
Sets the connected list select control.void
setValue(V newValue)
Sets the list select value to indicate selection.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.-
Methods inherited from class io.guise.framework.coupler.AbstractCardCoupler
getCard, getCardControl, getCards, installCardConstraints, isCardSelectable, selectCard, selectCard, setCard, setCards, uninstallCardConstraints, updateDisplayed, updateEnabled, updateSelected, updateTaskState, 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
-
ListSelectCardCoupler
public ListSelectCardCoupler()
Default constructor.
-
ListSelectCardCoupler
public ListSelectCardCoupler(ListSelectControl<V> listSelect, V value, Component... cards)
List select, value, and cards constructor.- Parameters:
listSelect
- The list select control to connect to the cards, ornull
if there is no control coupled with the cards.value
- The value in the list to indicate the cards should be selected, ornull
if there is no value to indicate selection.cards
- The new cards to connect, if any.
-
-
Method Detail
-
getListSelect
public ListSelectControl<V> getListSelect()
- Returns:
- The list select control to connect to the cards, or
null
if there is no control coupled with the cards.
-
setListSelect
public void setListSelect(ListSelectControl<V> newListSelect)
Sets the connected list select control. This is a bound property.- Parameters:
newListSelect
- The new list select control to connect to the card, ornull
if the list select control should not be coupled with the cards.- See Also:
LIST_SELECT_PROPERTY
-
getValue
public V getValue()
- Returns:
- The list select value to indicate selection, or
null
if there is no value.
-
setValue
public void setValue(V newValue)
Sets the list select value to indicate selection. This is a bound property.- Parameters:
newValue
- The list select value to indicate selection, ornull
if there is no value.- See Also:
VALUE_PROPERTY
-
updateDisplayed
protected void updateDisplayed(boolean displayed)
Updates the current displayed status. This implementation does nothing.This implementation updates the list select control's displayed status of the connected value. If no list select control or no value 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 list select control's enabled status of the connected value. If no list select control or no value is connected, no action occurs.
- Overrides:
updateEnabled
in classAbstractCardCoupler
- Parameters:
enabled
- The new enabled status.
-
updateSelected
protected void updateSelected(boolean selected)
Updates the current selected status. This implementation does nothing.This implementation selects the connected value in the connected list select control if the new selected state is selected. If no list select control or no value is connected, no action occurs.
- Overrides:
updateSelected
in classAbstractCardCoupler
- Parameters:
selected
- The new selected status.
-
-