Class 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 associates a ListSelectControl with a card in a CardControl.
    Author:
    Garret Wilson
    • 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 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 class AbstractCardCoupler
        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 class AbstractCardCoupler
        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 class AbstractCardCoupler
        Parameters:
        selected - The new selected status.