public class SingleListBox extends ListBox implements HasValue<String>
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
DEFAULT_DIRECTION_ESTIMATOR
DEBUG_ID_PREFIX
Modifier | Constructor and Description |
---|---|
|
SingleListBox()
Create a new SingleListBox with setAddMissingValue(true)
|
|
SingleListBox(boolean addMissingValue)
Create a new SingleListBox
|
protected |
SingleListBox(boolean addMissingValue,
boolean isMultipleSelect) |
Modifier and Type | Method and Description |
---|---|
HandlerRegistration |
addValueChangeHandler(ValueChangeHandler<String> handler) |
int |
findValueIndex(String value)
Finds the index of the specified value.
|
static int |
findValueInListBox(ListBox list,
String value)
Utility function to find the first index of a value in a
ListBox.
|
boolean |
getAddMissingValue()
Gets the current setting for add missing value.
|
static String |
getSelectedText(ListBox list)
Utility function to get the current text.
|
static String |
getSelectedValue(ListBox list)
Utility function to get the current value.
|
String |
getValue()
Returns the current value selected in the ListBox.
|
void |
setAddMissingValue(boolean addMissingValue)
Sets the current setting for add missing value.
|
static boolean |
setSelectedValue(ListBox list,
String value,
boolean addMissingValues)
Utility function to set the current value in a ListBox.
|
void |
setValue(String value)
Selects the specified value in the list.
|
void |
setValue(String value,
boolean fireEvents)
Selects the specified value in the list.
|
addChangeHandler, addChangeListener, addItem, addItem, addItem, addItem, clear, getDirectionEstimator, getItemCount, getItemText, getName, getOptionText, getSelectedIndex, getValue, getVisibleItemCount, insertItem, insertItem, insertItem, insertItem, isItemSelected, isMultipleSelect, onEnsureDebugId, removeChangeListener, removeItem, setDirectionEstimator, setDirectionEstimator, setItemSelected, setItemText, setItemText, setMultipleSelect, setName, setOptionText, setSelectedIndex, setValue, setVisibleItemCount, wrap
addBlurHandler, addClickHandler, addClickListener, addDoubleClickHandler, addDragEndHandler, addDragEnterHandler, addDragHandler, addDragLeaveHandler, addDragOverHandler, addDragStartHandler, addDropHandler, addFocusHandler, addFocusListener, addGestureChangeHandler, addGestureEndHandler, addGestureStartHandler, addKeyboardListener, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, addMouseDownHandler, addMouseListener, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseUpHandler, addMouseWheelHandler, addMouseWheelListener, addTouchCancelHandler, addTouchEndHandler, addTouchMoveHandler, addTouchStartHandler, getFocusImpl, getTabIndex, isEnabled, onAttach, removeClickListener, removeFocusListener, removeKeyboardListener, removeMouseListener, removeMouseWheelListener, setAccessKey, setEnabled, setFocus, setTabIndex
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
fireEvent
public SingleListBox()
public SingleListBox(boolean addMissingValue)
protected SingleListBox(boolean addMissingValue, boolean isMultipleSelect)
public boolean getAddMissingValue()
public void setAddMissingValue(boolean addMissingValue)
addMissingValue
- If true, when setValue is called, if the
item cannot be found in the list, it will be added
automatically to the end of the list.public String getValue()
public void setValue(String value)
setValue
in interface TakesValue<String>
setValue
in interface HasValue<String>
value
- the new valuesetAddMissingValue(boolean)
public void setValue(String value, boolean fireEvents)
setValue
in interface HasValue<String>
value
- the new valuefireEvents
- if true, a ValueChangeEvent event will be firedsetAddMissingValue(boolean)
public int findValueIndex(String value)
value
- the value to findpublic HandlerRegistration addValueChangeHandler(ValueChangeHandler<String> handler)
addValueChangeHandler
in interface HasValueChangeHandlers<String>
public static final String getSelectedValue(ListBox list)
public static final String getSelectedText(ListBox list)
public static final int findValueInListBox(ListBox list, String value)
Copyright © 2015. All Rights Reserved.