com.guiseframework.coupler
Class ListSelectCardCoupler<V>

java.lang.Object
  extended by com.globalmentor.beans.BoundPropertyObject
      extended by com.guiseframework.event.GuiseBoundPropertyObject
          extended by com.guiseframework.coupler.AbstractCardCoupler
              extended by com.guiseframework.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 implement Displayable, the list selected value will be displayed based upon the card constraints' displayed status. If the card's constraints implement Enableable, 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 a CardControl.
All Implemented Interfaces:
com.globalmentor.beans.PropertyBindable, com.globalmentor.beans.PropertyConstrainable

public class ListSelectCardCoupler<V>
extends AbstractCardCoupler

Coupler that assocates a ListSelectControl with a card in a CardControl.

Author:
Garret Wilson

Field Summary
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 com.guiseframework.coupler.AbstractCardCoupler
CARD_PROPERTY, CARDS_PROPERTY
 
Fields inherited from class com.globalmentor.beans.BoundPropertyObject
NO_PROPERTY_CHANGE_LISTENERS, NO_VETOABLE_CHANGE_LISTENERS
 
Constructor Summary
ListSelectCardCoupler()
          Default constructor.
ListSelectCardCoupler(ListSelectControl<V> listSelect, V value, Component... cards)
          List select, value, and cards constructor.
 
Method Summary
 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 com.guiseframework.coupler.AbstractCardCoupler
getCard, getCardControl, getCards, installCardConstraints, isCardSelectable, selectCard, selectCard, setCard, setCards, uninstallCardConstraints, updateDisplayed, updateEnabled, updateSelected, updateTaskState, updateTaskState
 
Methods inherited from class com.guiseframework.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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LIST_SELECT_PROPERTY

public static final java.lang.String LIST_SELECT_PROPERTY
The bound property of the list select control.


VALUE_PROPERTY

public static final java.lang.String VALUE_PROPERTY
The value bound property.

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, or null if there is no control coupled with the cards.
value - The value in the list to indicate the cards should be selected, or null 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, or null 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, or null if there is no value.
See Also:
VALUE_PROPERTY

updateDisplayed

protected void updateDisplayed(boolean displayed)
Updates the current displayed status. 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 class AbstractCardCoupler
Parameters:
displayed - The new displayed status.

updateEnabled

protected void updateEnabled(boolean enabled)
Updates the current enabled status. 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 class AbstractCardCoupler
Parameters:
enabled - The new enabled status.

updateSelected

protected void updateSelected(boolean selected)
Updates the current selected status. This implementation selects the connected value in the conntected 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 class AbstractCardCoupler
Parameters:
selected - The new selected status.


Copyright © 2005-2010 GlobalMentor, Inc. All Rights Reserved.