API Reference 0.7.1rikulo_modelSelectionModel<T>

SelectionModel<T> abstract class

Indicates a model that allows selection. It is a supplymental interface used with other models, such as ListModel.

abstract class SelectionModel<T> {
 /**
  * Returns the first selected value, or null if none is selected.
  */
 T get selectedValue;
 /**
  * Returns the current selection.
  * It is readonly. Don't modify it directly. Otherwise, UI won't be
  * updated correctly.
  */
 Set<T> get selection;
 /**
  * Replace the current selection with the given set.
  *
  * Notice this method copies the content of [selection], so it is OK
  * to use it after the invocation.
  */
 void set selection(Iterable<T> selection);
 /** Returns whether an object is selected.
  */
 bool isSelected(Object obj);
 
 /**
  * Returns true if the selection is currently empty.
  */
 bool get isSelectionEmpty;
 /**
  * Add the specified object into selection.
  * It returns whether it has been added successfully.
  * Returns false if it is already selected.
  */
 bool addToSelection(T obj);
 /**
  * Remove the specified object from selection.
  * It returns whether it is removed successfully.
  * Returns false if it is not selected.
  */
 bool removeFromSelection(Object obj);
 /**
  * Change the selection to the empty set.
  */
 void clearSelection();

 /**
  * Sets the selection mode to be multiple.
  */
 void set multiple(bool multiple);
 /**
  * Returns whether the current selection mode is multiple.
  */
 bool get multiple;
}

Subclasses

AbstractDataModel<T>

Properties

final bool isSelectionEmpty #

Returns true if the selection is currently empty.

bool get isSelectionEmpty;

abstract bool get multiple #

Returns whether the current selection mode is multiple.

abstract void set multiple(bool multiple) #

Sets the selection mode to be multiple.

final T selectedValue #

Returns the first selected value, or null if none is selected.

T get selectedValue;

abstract Set<T> get selection #

Returns the current selection. It is readonly. Don't modify it directly. Otherwise, UI won't be updated correctly.

abstract void set selection(Iterable<T> selection) #

Replace the current selection with the given set.

Notice this method copies the content of selection, so it is OK to use it after the invocation.

Methods

abstract bool addToSelection(T obj) #

Add the specified object into selection. It returns whether it has been added successfully. Returns false if it is already selected.

abstract void clearSelection() #

Change the selection to the empty set.

abstract bool isSelected(Object obj) #

Returns whether an object is selected.

abstract bool removeFromSelection(Object obj) #

Remove the specified object from selection. It returns whether it is removed successfully. Returns false if it is not selected.