Type Parameters:
E - the list element type
All Superinterfaces:
Collection<E>, Iterable<E>, List<E>, Observable, ObservableList<E>, Selectable

public interface SelectableList<E> extends Selectable, ObservableList<E>
Interface describing a list with individually selectable items.
See Also:
  • Method Details

    • beginSelectionChange

      void beginSelectionChange()
      Starts a series of selections. The call of this method must be paired with a call to endSelectionChange(), ideally inside a try-finally-block. Selection changes may be nested.
      See Also:
    • endSelectionChange

      void endSelectionChange()
      Ends a series of selections.
      Throws:
      IllegalStateException - if this method is not called properly paired with beginSelectionChange()
      See Also:
    • getNumSelected

      int getNumSelected()
      Returns the number of selected items.
      Returns:
      the number of selected items
    • addSelectionListener

      default void addSelectionListener(SelectionChangeListener<? super E> selectionChangeListener)
      Adds a given selection listener. Selection changes of index ranges will be combined into a single change event.
      Parameters:
      selectionChangeListener - the given selection listener
      Throws:
      NullPointerException - if the given listener is null
    • addSelectionListener

      void addSelectionListener(SelectionChangeListener<? super E> selectionChangeListener, boolean requestSingleChangeEvents)
      Adds a given selection listener.
      Parameters:
      selectionChangeListener - the given selection listener
      requestSingleChangeEvents - if true, a change event will be generated for each single selection change, e.g. range selections will not be optimized to a single [from,to] range change
      Throws:
      NullPointerException - if the given listener is null
    • removeSelectionListener

      boolean removeSelectionListener(SelectionChangeListener<? super E> selectionChangeListener)
      Removes a given selection listener.
      Parameters:
      selectionChangeListener - the given selection listener
      Returns:
      true, iff the listener was present before
      Throws:
      NullPointerException - if the given listener is null