API Reference 0.7.1rikulo_eventSelectEvent<T>

SelectEvent<T> class

A select event. It is sent with ViewEvents.select.

class SelectEvent<T> extends ViewEvent {
 final Iterable<T> _selectedValues;
 final int _selectedIndex;

 /** Constructor.
  *
  * + [selectedValues] is the set of selected values. It can't be null.
  * + [selectedIndex] is the index of the first selected value, or -1
  * if [selectedValues] is empty.
  */
 SelectEvent(Iterable<T> selectedValues, int selectedIndex, [String type="select", View target]):
 super(type, target), _selectedValues = selectedValues, _selectedIndex = selectedIndex;

 /** Returns the selected values.
  */
 Iterable<T> get selectedValues => _selectedValues;
 /** Returns the first selected value, or null if no selected value.
  */
 T get selectedValue => _selectedValues.isEmpty ? null: _selectedValues.first;

 /** Returns the first selected index, or -1 if none is selected.
  *
  * Notice that [selectedIndex] is meaningless for `TreeModel`.
  */
 int get selectedIndex => _selectedIndex;

 String toString() => "SelectEvent($target, $selectedValues, $selectedIndex)";
}

Extends

ViewEvent > SelectEvent<T>

Constructors

new SelectEvent(Iterable<T> selectedValues, int selectedIndex, [String type = "select", View target]) #

Constructor.

  • selectedValues is the set of selected values. It can't be null.
  • selectedIndex is the index of the first selected value, or -1 if selectedValues is empty.

SelectEvent(Iterable<T> selectedValues, int selectedIndex, [String type="select", View target]):
super(type, target), _selectedValues = selectedValues, _selectedIndex = selectedIndex;

Properties

View currentTarget #

inherited from ViewEvent

The view that is handling this event currently.

View currentTarget

final bool isPropagationStopped #

inherited from ViewEvent

Returns whether this event's propagation is stopped.

Default: false.

It becomes true if stopPropagation is called, and then all remaining event listeners are ignored.

bool get isPropagationStopped => _propStop;

final int selectedIndex #

Returns the first selected index, or -1 if none is selected.

Notice that selectedIndex is meaningless for TreeModel.

int get selectedIndex => _selectedIndex;

final T selectedValue #

Returns the first selected value, or null if no selected value.

T get selectedValue => _selectedValues.isEmpty ? null: _selectedValues.first;

final Iterable<T> selectedValues #

Returns the selected values.

Iterable<T> get selectedValues => _selectedValues;

View target #

inherited from ViewEvent

Returns the view that this event is targeting to.

View target

final int timeStamp #

inherited from ViewEvent

Returns the time stamp.

int get timeStamp => _stamp;

final String type #

inherited from ViewEvent

Returns the event's type.

String get type => _type;

Methods

void preventDefault() #

inherited from ViewEvent

Prevents the browser's default behavior.

void preventDefault() {
}

void stopPropagation() #

inherited from ViewEvent

Stops the propagation. Once called, all remaining event listeners, if any, are ignored.

void stopPropagation() {
 _propStop = true;
}

String toString() #

Returns a string representation of this object.

docs inherited from Object
String toString() => "SelectEvent($target, $selectedValues, $selectedIndex)";