com.google.gwt.user.client.ui
Class ValueListBox<T>
java.lang.Object
com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.client.ui.Composite
com.google.gwt.user.client.ui.ValueListBox<T>
- Type Parameters:
T - the value type
- All Implemented Interfaces:
- IsEditor<TakesValueEditor<T>>, HasAttachHandlers, HasValueChangeHandlers<T>, HasHandlers, EventListener, TakesValue<T>, HasConstrainedValue<T>, HasValue<T>, HasVisibility, IsRenderable, IsWidget
public class ValueListBox<T>
- extends Composite
- implements HasConstrainedValue<T>, IsEditor<TakesValueEditor<T>>
Implementation of HasConstrainedValue based on a
SelectElement.
A Renderer is used to get user-presentable strings to
display in the select element.
| Methods inherited from class com.google.gwt.user.client.ui.Composite |
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidget |
| Methods inherited from class com.google.gwt.user.client.ui.Widget |
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, ensureHandlers, fireEvent, getHandlerCount, getHandlerManager, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, replaceElement, setLayoutData, setParent, sinkEvents |
| Methods inherited from class com.google.gwt.user.client.ui.UIObject |
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString, unsinkEvents |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ValueListBox
public ValueListBox(Renderer<T> renderer)
ValueListBox
public ValueListBox(Renderer<T> renderer,
ProvidesKey<T> keyProvider)
addValueChangeHandler
public HandlerRegistration addValueChangeHandler(ValueChangeHandler<T> handler)
- Description copied from interface:
HasValueChangeHandlers
- Adds a
ValueChangeEvent handler.
- Specified by:
addValueChangeHandler in interface HasValueChangeHandlers<T>
- Parameters:
handler - the handler
- Returns:
- the registration for the event
asEditor
public TakesValueEditor<T> asEditor()
- Returns a
TakesValueEditor backed by the ValueListBox.
- Specified by:
asEditor in interface IsEditor<TakesValueEditor<T>>
- Returns:
- an
Editor of type E
getValue
public T getValue()
- Description copied from interface:
HasValue
- Gets this object's value.
- Specified by:
getValue in interface TakesValue<T>- Specified by:
getValue in interface HasValue<T>
- Returns:
- the object's value
- See Also:
TakesValue.setValue(V)
setAcceptableValues
public void setAcceptableValues(java.util.Collection<T> newValues)
- Description copied from interface:
HasConstrainedValue
- Set the acceptable values.
- Specified by:
setAcceptableValues in interface HasConstrainedValue<T>
- Parameters:
newValues - the acceptible values
setValue
public void setValue(T value)
- Set the value and display it in the select element. Add the value to the
acceptable set if it is not already there.
- Specified by:
setValue in interface TakesValue<T>- Specified by:
setValue in interface HasValue<T>
- Parameters:
value - the object's new value- See Also:
TakesValue.getValue()
setValue
public void setValue(T value,
boolean fireEvents)
- Description copied from interface:
HasValue
- Sets this object's value. Fires
ValueChangeEvent when
fireEvents is true and the new value does not equal the existing value.
It is acceptable to fail assertions or throw (documented) unchecked
exceptions in response to bad values.
- Specified by:
setValue in interface HasValue<T>
- Parameters:
value - the object's new valuefireEvents - fire events if true and value is new