public class ItemListBox<T> extends ListBox
| Modifier and Type | Class and Description |
|---|---|
static class |
ItemListBox.Builder<T,Box extends ItemListBox<T>>
Simple builder that allows multiple items to be added to the list box during construction.
|
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabledDEFAULT_DIRECTION_ESTIMATORDEBUG_ID_PREFIX| Constructor and Description |
|---|
ItemListBox()
Creates an empty item list box.
|
ItemListBox(Iterable<T> items)
Creates a list box with the supplied set of initial items.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addItem(T item)
Adds the supplied item to this list box at the end of the list.
|
void |
addItem(T item,
String label)
Adds the supplied item to this list box at the end of the list, using the supplied label
if not null.
|
static <T> ItemListBox.Builder<T,ItemListBox<T>> |
builder()
Creates a new builder for an ItemListBox.
|
T |
getSelectedItem()
Returns the currently selected item, or null if no item is selected.
|
void |
insertItem(T item,
int index)
Inserts the supplied item into this list box at the specified position.
|
void |
insertItem(T item,
int index,
String label)
Inserts the supplied item into this list box at the specified position, using the specified
label if given.
|
boolean |
removeItem(T item)
Removes the supplied item from this list box, returning true if the item was found.
|
void |
setSelectedItem(T value)
Selects the specified item.
|
addChangeHandler, addChangeListener, addItem, addItem, addItem, addItem, clear, getDirectionEstimator, getItemCount, getItemText, getName, getSelectedIndex, getValue, getVisibleItemCount, insertItem, insertItem, insertItem, insertItem, isItemSelected, isMultipleSelect, removeChangeListener, removeItem, setDirectionEstimator, setDirectionEstimator, setItemSelected, setItemText, setItemText, setMultipleSelect, setName, setSelectedIndex, setValue, setVisibleItemCount, wrapaddBlurHandler, 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, getTabIndex, isEnabled, removeClickListener, removeFocusListener, removeKeyboardListener, removeMouseListener, removeMouseWheelListener, setAccessKey, setEnabled, setFocus, setTabIndexaddAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, fireEvent, getLayoutData, getParent, isAttached, onBrowserEvent, removeFromParent, setLayoutData, sinkEventsaddStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, isVisible, removeStyleDependentName, removeStyleName, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString, unsinkEventsequals, getClass, hashCode, notify, notifyAll, wait, wait, waitfireEventpublic static <T> ItemListBox.Builder<T,ItemListBox<T>> builder()
public void addItem(T item, String label)
#toLabel() is used to calculate it.public void addItem(T item)
public void insertItem(T item, int index, String label)
#toLabel() is used to calculate it.public void insertItem(T item, int index)
public boolean removeItem(T item)
public T getSelectedItem()
public void setSelectedItem(T value)
Copyright © 2013. All Rights Reserved.