Interface SingleSelection<T>

Type Parameters:
T - the item type
All Known Subinterfaces:
FilterListSelection<T>, MultiSelection<T>

public interface SingleSelection<T>
A selection model managing a single selected item.
  • Method Details

    • empty

      Returns:
      an ObservableState indicating whether the selection is empty
    • changing

      Observer<?> changing()
      To prevent a selection change, add a listener throwing a CancelException.

      Note that this is a best-effort warning mechanism, not a transactional revert: throwing a CancelException lets a listener react before the change (for example to save unsaved edits), but does not roll the selection or model back to a consistent state - temporary inconsistency is tolerated.

      Returns:
      an observer notified when the selection is about to change
    • item

      Value<T> item()
      Returns:
      the selected item
    • clear

      void clear()
      Clears the selection
    • singleSelection

      static <T> SingleSelection<T> singleSelection()
      Type Parameters:
      T - the item type
      Returns:
      a default SingleSelection implementation