T - NiftyControlDropDownControlpublic interface DropDown<T> extends NiftyControl
| Modifier and Type | Interface | Description |
|---|---|---|
static interface |
DropDown.DropDownViewConverter<T> |
You'll need to implement this interface to change the way your model class T needs
to be displayed in the DropDown.
|
static class |
DropDown.SimpleDropDownViewConverter<T> |
A simple implementation of DropDownViewConverter that will just use item.toString().
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
addAllItems(java.util.Collection<T> itemsToAdd) |
Add all items to the DropDown.
|
void |
addItem(T newItem) |
Add a item to the DropDown.
|
void |
clear() |
Clear all items from this DropDown.
|
java.util.List<T> |
getItems() |
Get all items of this DropDown.
|
int |
getSelectedIndex() |
Returns the index of the current selected item in the list of all items.
|
T |
getSelection() |
Get the current selection.
|
void |
insertItem(T item,
int index) |
Insert the given item at the given index.
|
int |
itemCount() |
Retrieve the number of items in the DropDown.
|
void |
removeAllItems(java.util.Collection<T> itemsToRemove) |
Remove all items given in the List from this DropDown.
|
void |
removeItem(T item) |
Remove the given item from the DropDown.
|
void |
removeItemByIndex(int itemIndex) |
Remove an item from the DropDown by index.
|
void |
selectItem(T item) |
Select the item in the DropDown.
|
void |
selectItemByIndex(int selectionIndex) |
Select the item with the given index in the DropDown.
|
void |
setViewConverter(DropDown.DropDownViewConverter<T> viewConverter) |
Change the DropDownViewConverter for this DropDown.
|
disable, enable, getElement, getHeight, getId, getStyle, getWidth, hasFocus, isBound, isEnabled, layoutCallback, setEnabled, setFocus, setFocusable, setHeight, setId, setStyle, setWidthvoid setViewConverter(@Nonnull
DropDown.DropDownViewConverter<T> viewConverter)
viewConverter - DropDownViewConvertervoid addItem(@Nonnull
T newItem)
newItem - the item to addvoid insertItem(@Nonnull
T item,
int index)
item - itemindex - the index to insert the item.int itemCount()
void clear()
void selectItemByIndex(int selectionIndex)
selectionIndex - the item index to select in the DropDownvoid selectItem(@Nonnull
T item)
item - the item to select@Nullable T getSelection()
int getSelectedIndex()
void removeItemByIndex(int itemIndex)
itemIndex - remove the item with the given index from the DropDownvoid removeItem(T item)
item - the item to remove from the DropDown@Nonnull java.util.List<T> getItems()
void addAllItems(@Nonnull
java.util.Collection<T> itemsToAdd)
itemsToAdd - collection of items to addvoid removeAllItems(@Nonnull
java.util.Collection<T> itemsToRemove)
itemsToRemove - collection of items to removeCopyright © 2018. All rights reserved.