HasValue<T> abstract class
Extends {@link TakesValue} to allow the value to be pulled back out, and to throw {@link com.google.gwt.event.logical.shared.ValueChangeEvent ValueChangeEvent} events. <p> An object that implements this interface should be a user input widget, where the user and programmer can both set and get the object's value. It is intended to provide a unified interface to widgets with "atomic" values, like Strings and Dates.
@param <T> the type of value
abstract class HasValue<T> implements TakesValue<T>, HasValueChangeHandlers<T> { /** * 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 */ void setValue(T val, [bool fireEvents = false]); /** * Returns the current value. * * @return the value as an object of type V * @see #setValue */ T getValue(); }
Subclasses
CheckBox, HasConstrainedValue<T>, ToggleButton, ValueBoxBase<T>
Implements
HasValueChangeHandlers<T>, TakesValue<T>
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 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