API Reference 0.3.24dart_web_toolkit_eventHasConstrainedValue<T>

HasConstrainedValue<T> abstract class

Implemented by widgets that pick from a set of values. <p> It is up to the implementation to decide (and document) how to behave when {@link #setValue(Object)} is called with a value that is not in the acceptable set. For example, throwing an {@link IllegalArgumentException}, or quietly adding the value to the acceptable set, are both reasonable choices.

@param <T> the type of value

abstract class HasConstrainedValue<T> extends HasValue<T> {

 /**
  * Set the acceptable values.
  * 
  * @param values the acceptible values
  */
 void setAcceptableValues(Iterable<T> values);
}

Extends

HasValue<T> > HasConstrainedValue<T>

Subclasses

ValueListBox<T>

Methods

abstract HandlerRegistration addValueChangeHandler(ValueChangeHandler<T> handler) #

inherited from HasValueChangeHandlers

Adds a {@link ValueChangeEvent} handler.

@param handler the handler @return the registration for the event

abstract void fireEvent(DwtEvent event) #

inherited from HasHandlers

Fires the given event to the handlers listening to the event's type.

Any exceptions thrown by handlers will be bundled into a UmbrellaException and then re-thrown after all handlers have completed. An exception thrown by a handler will not prevent other handlers from executing.

@param event the event

abstract T getValue() #

inherited from HasValue

Returns the current value.

@return the value as an object of type V @see #setValue

abstract void setAcceptableValues(Iterable<T> values) #

Set the acceptable values.

@param values the acceptible values

abstract void setValue(T val, [bool fireEvents = false]) #

inherited from HasValue

Sets the value. Fires ValueChangeEvent when fireEvents is true and the new value does not equal the existing value.

@param value a value object of type V @see #getValue() @param fireEvents fire events if true and value is new