Class SingleSelectionProperty<T>


public class SingleSelectionProperty<T> extends SelectionProperty<T,T>
Represents a selection of zero or one item(s) from a list.
  • Constructor Details

    • SingleSelectionProperty

      public SingleSelectionProperty()
    • SingleSelectionProperty

      @SafeVarargs public SingleSelectionProperty(T... items)
    • SingleSelectionProperty

      public SingleSelectionProperty(List<T> items)
  • Method Details

    • removeItem

      public boolean removeItem(T item)
      Overrides:
      removeItem in class SelectionProperty<T,T>
    • setValue

      public boolean setValue(T value)
      Description copied from class: MutableProperty
      Sets the value of this property.
      Overrides:
      setValue in class MutableProperty<T>
      Parameters:
      value - The new value
      Returns:
      true if the value was changed.
    • selectItem

      public boolean selectItem(T item) throws IllegalArgumentException
      Description copied from class: SelectionProperty
      Selects an item from the list of items.
      Overrides:
      selectItem in class SelectionProperty<T,T>
      Parameters:
      item - The item to select
      Returns:
      false if the item was already selected.
      Throws:
      IllegalArgumentException - If the item is not in the list of items.
    • selectPrevious

      public void selectPrevious()
      Description copied from class: SelectionProperty
      Selects the previous item.
      Specified by:
      selectPrevious in class SelectionProperty<T,T>
    • selectNext

      public void selectNext()
      Description copied from class: SelectionProperty
      Selects the next item.
      Specified by:
      selectNext in class SelectionProperty<T,T>
    • selectIndex

      public boolean selectIndex(int index)
      Description copied from class: SelectionProperty
      Selects an item from the list of items at a given index.
      Specified by:
      selectIndex in class SelectionProperty<T,T>
      Parameters:
      index - The index of the item to select
      Returns:
      false if the item was already selected.
    • clearSelection

      public boolean clearSelection()
    • getSelectedItem

      public T getSelectedItem()
    • getSelectedIndex

      public int getSelectedIndex()
    • isItemSelected

      public boolean isItemSelected(T item)
    • isAnyItemSelected

      public boolean isAnyItemSelected()