|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
T
- public interface ListBox<T>
The ListBox interface is the Nifty control API view of a Nifty ListBox control.
Nested Class Summary | |
---|---|
static interface |
ListBox.ListBoxViewConverter<T>
You'll need to implement this interface to change the way your model class T needs to be displayed in the ListBox. |
static class |
ListBox.ListBoxViewConverterSimple<T>
A simple implementation of ListBoxViewConverter that will just use item.toString(). |
static class |
ListBox.SelectionMode
The ListBoxSelectionMode determines how the ListBox handles selections. |
Method Summary | |
---|---|
void |
addAllItems(List<T> itemsToAdd)
Add all items to the ListBox. |
void |
addItem(T newItem)
Add a item to the ListBox. |
void |
changeSelectionMode(ListBox.SelectionMode listBoxSelectionMode,
boolean forceSelection)
Change the ListBox.SelectionMode to a new one. |
void |
clear()
Clear all items from this ListBox. |
void |
deselectItem(T item)
Deselect the given item. |
void |
deselectItemByIndex(int itemIndex)
Deselect the item with the given itemIndex. |
int |
getDisplayItemCount()
Returns the number of items this ListBox can display without being scrolled. |
T |
getFocusItem()
Get the current item that has the focus. |
int |
getFocusItemIndex()
Get the index of the current focus item. |
List<T> |
getItems()
Get all items of this ListBox. |
List<Integer> |
getSelectedIndices()
Get the current selection as a list of indices. |
List<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 ListBox. |
void |
refresh()
Refresh the Listbox display. |
void |
removeAllItems(List<T> itemsToRemove)
Remove all items given in the List from this ListBox. |
void |
removeItem(T item)
Remove the given item from the ListBox. |
void |
removeItemByIndex(int itemIndex)
Remove an item from the ListBox by index. |
void |
selectItem(T item)
Select the item in the ListBox. |
void |
selectItemByIndex(int selectionIndex)
Select the item with the given index in the ListBox. |
void |
selectNext()
Select the next item. |
void |
selectPrevious()
Select the previous item. |
void |
setFocusItem(T item)
Change the current focus item to the item given. |
void |
setFocusItemByIndex(int itemIndex)
Change the current focus item to the given index. |
void |
setListBoxViewConverter(ListBox.ListBoxViewConverter<T> viewConverter)
Change the ListBoxViewConverter for this ListBox. |
void |
showItem(T item)
Make sure the given item is visible. |
void |
showItemByIndex(int itemIndex)
Make sure the given item is visible. |
void |
sortAllItems()
Sort all items using natural ordering. |
void |
sortAllItems(Comparator<T> comperator)
Sort all items using the given comperator. |
Methods inherited from interface de.lessvoid.nifty.controls.NiftyControl |
---|
disable, enable, getElement, getHeight, getId, getStyle, getWidth, hasFocus, isBound, isEnabled, layoutCallback, setEnabled, setFocus, setFocusable, setHeight, setId, setStyle, setWidth |
Method Detail |
---|
void changeSelectionMode(ListBox.SelectionMode listBoxSelectionMode, boolean forceSelection)
ListBox.SelectionMode
to a new one.
listBoxSelectionMode
- the new ListBox.SelectionMode
to useforceSelection
- if set to true will not allow de selecting the last item in the selection and
it will automatically select the first item added. when set to false it's possible to have no
selection at all.void setListBoxViewConverter(ListBox.ListBoxViewConverter<T> viewConverter)
viewConverter
- ListBoxViewConvertervoid 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)
ListBoxSingleSelectionMode
is used or
it will add to the selection if ListBoxMultiSelectionMode
is used.
selectionIndex
- the item index to select in the ComboBoxvoid selectItem(T item)
item
- the item to selectvoid selectNext()
void selectPrevious()
void deselectItemByIndex(int itemIndex)
itemIndex
- item index to deselectvoid deselectItem(T item)
item
- item to deselect.List<T> getSelection()
List<Integer> getSelectedIndices()
void removeItemByIndex(int itemIndex)
itemIndex
- remove the item with the given index from the ListBoxvoid removeItem(T item)
item
- the item to remove from the ListBoxList<T> getItems()
void showItem(T item)
item
- the itemvoid showItemByIndex(int itemIndex)
itemIndex
- the item index to make visiblevoid setFocusItem(T item)
item
- the item to set the focus tovoid setFocusItemByIndex(int itemIndex)
itemIndex
- the new focus itemT getFocusItem()
int getFocusItemIndex()
void addAllItems(List<T> itemsToAdd)
itemsToAdd
- all items to addvoid removeAllItems(List<T> itemsToRemove)
itemsToRemove
- list of items to removevoid sortAllItems()
int getDisplayItemCount()
void sortAllItems(Comparator<T> comperator)
comperator
- void refresh()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |