Class OrderedMultiSelectionModel<T>

Type Parameters:
T - the record data type
All Implemented Interfaces:
HasHandlers, ProvidesKey<T>, SelectionChangeEvent.HasSelectionChangedHandlers, SelectionModel<T>, SetSelectionModel<T>

public class OrderedMultiSelectionModel<T> extends MultiSelectionModel<T>
A simple selection model that allows multiple items to be selected and retains order of selection. Selecting the same item multiple times does not change the order (item won't be moved to the end of selection). OrderedMultiSelectionModel uses LinkedHashMaps, which may increase the size of your compiled output if you do not use LinkedHashMaps elsewhere in your application.
  • Constructor Details

    • OrderedMultiSelectionModel

      public OrderedMultiSelectionModel()
      Constructs a OrderedMultiSelectionModel without a key provider.
    • OrderedMultiSelectionModel

      public OrderedMultiSelectionModel(ProvidesKey<T> keyProvider)
      Constructs a OrderedMultiSelectionModel with the given key provider.
      Parameters:
      keyProvider - an instance of ProvidesKey, or null if the item should act as its own key
  • Method Details

    • getSelectedList

      public List<T> getSelectedList()
      Get the List of selected items as a copy.
      Returns:
      the list of selected items in the order of additions. Selecting an element already in the selection does not move it to the end of the list.