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
Methods
abstract HandlerRegistration addValueChangeHandler(ValueChangeHandler<T> handler) #
Adds a {@link ValueChangeEvent} handler.
@param handler the handler @return the registration for the event
abstract void fireEvent(DwtEvent event) #
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() #
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]) #
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