Class SelectionModel

All Implemented Interfaces:
VersionedObject<Set<Integer>>, Iterable<Integer>, Collection<Integer>, Set<Integer>

public class SelectionModel extends VersionedSet<Integer>
  • Constructor Details

    • SelectionModel

      public SelectionModel()
  • Method Details

    • createSelectionReference

      public VersionedReference<Integer> createSelectionReference()
      For single-selections, this will hold the currently selected value.
    • setSelectionMode

      public void setSelectionMode(SelectionModel.SelectionMode mode)
    • getSelectionMode

      public SelectionModel.SelectionMode getSelectionMode()
    • getSelection

      public Integer getSelection()
      Returns the single selection if there is only one selected item or null if there is no selection or more than one item is selected.
    • setSelection

      public void setSelection(Integer selection)
      Sets the currently selected single value regardless of selection mode. This clears the set before adding the selection. Also, if the specified selection is less than 0 then the selection is simply cleared.
    • add

      public boolean add(Integer selection)
      Specified by:
      add in interface Collection<Integer>
      Specified by:
      add in interface Set<Integer>
      Overrides:
      add in class VersionedSet<Integer>
    • incrementVersion

      protected void incrementVersion()
      Overrides:
      incrementVersion in class VersionedSet<Integer>
    • updateSelected

      protected void updateSelected()