T - the value typepublic class ValueListBox<T> extends Composite implements Focusable, HasConstrainedValue<T>, HasEnabled, IsEditor<TakesValueEditor<T>>
HasConstrainedValue based on a
SelectElement.
A Renderer is used to get user-presentable strings to
display in the select element.
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabledeventsToSinkDEBUG_ID_PREFIX, MISSING_ELEMENT_ERROR, SETELEMENT_TWICE_ERROR| Constructor and Description |
|---|
ValueListBox() |
ValueListBox(Renderer<? super T> renderer) |
ValueListBox(Renderer<? super T> renderer,
ProvidesKey<T> keyProvider) |
| Modifier and Type | Method and Description |
|---|---|
HandlerRegistration |
addValueChangeHandler(ValueChangeHandler<T> handler)
Adds a
ValueChangeEvent handler. |
TakesValueEditor<T> |
asEditor()
Returns a
TakesValueEditor backed by the ValueListBox. |
int |
getTabIndex()
Gets the widget's position in the tab index.
|
T |
getValue()
Gets this object's value.
|
boolean |
isEnabled()
Returns true if the widget is enabled, false if not.
|
void |
setAcceptableValues(java.util.Collection<T> newValues)
Set the acceptable values.
|
void |
setAccessKey(char key)
Sets the widget's 'access key'.
|
void |
setEnabled(boolean enabled)
Sets whether this widget is enabled.
|
void |
setFocus(boolean focused)
Explicitly focus/unfocus this widget.
|
void |
setTabIndex(int index)
Sets the widget's position in the tab index.
|
void |
setValue(T value)
Set the value and display it in the select element.
|
void |
setValue(T value,
boolean fireEvents)
Sets this object's value.
|
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidgetaddAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, ensureHandlers, fireEvent, getHandlerCount, getHandlerManager, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, replaceElement, setLayoutData, setParent, sinkEvents, unsinkEventsaddStyleDependentName, 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, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitfireEventpublic ValueListBox()
public ValueListBox(Renderer<? super T> renderer, ProvidesKey<T> keyProvider)
public HandlerRegistration addValueChangeHandler(ValueChangeHandler<T> handler)
HasValueChangeHandlersValueChangeEvent handler.addValueChangeHandler in interface HasValueChangeHandlers<T>handler - the handlerpublic TakesValueEditor<T> asEditor()
TakesValueEditor backed by the ValueListBox.asEditor in interface IsEditor<TakesValueEditor<T>>Editor of type Epublic int getTabIndex()
FocusablegetTabIndex in interface Focusablepublic T getValue()
HasValuegetValue in interface TakesValue<T>getValue in interface HasValue<T>TakesValue.setValue(V)public boolean isEnabled()
HasEnabledisEnabled in interface HasEnabledpublic void setAcceptableValues(java.util.Collection<T> newValues)
HasConstrainedValuesetAcceptableValues in interface HasConstrainedValue<T>newValues - the acceptible valuespublic void setAccessKey(char key)
FocusablesetAccessKey in interface Focusablekey - the widget's access keypublic void setEnabled(boolean enabled)
HasEnabledsetEnabled in interface HasEnabledenabled - true to enable the widget, false
to disable itpublic void setFocus(boolean focused)
FocusableGWTTestCase#delayTestFinish for more information on how to do this.public void setTabIndex(int index)
Focusable-1 will cause this widget to
be removed from the tab order.setTabIndex in interface Focusableindex - the widget's tab indexpublic void setValue(T value)
setValue in interface TakesValue<T>setValue in interface HasValue<T>value - the object's new valueTakesValue.getValue()public void setValue(T value, boolean fireEvents)
HasValueValueChangeEvent 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.