T
- public interface DropDown<T> extends NiftyControl
Modifier and Type | Interface and 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 and Description |
---|---|
void |
addAllItems(List<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.
|
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(List<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, setWidth
void setViewConverter(DropDown.DropDownViewConverter<T> viewConverter)
viewConverter
- DropDownViewConvertervoid addItem(T newItem)
newItem
- the item to addvoid insertItem(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(T item)
item
- the item to selectT 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 DropDownvoid addAllItems(List<T> itemsToAdd)
itemsToAdd
- all items to addCopyright © 2013. All Rights Reserved.