T - NiftyControlTreeBox<T>ListBoxControl, TreeBoxControlpublic interface ListBox<T> extends NiftyControl
| Modifier and Type | Interface | Description |
|---|---|---|
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.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
addAllItems(java.util.Collection<T> itemsToAdd) |
Add all items to the ListBox.
|
void |
addItem(T newItem) |
Add a item to the ListBox.
|
void |
addItemProcessor(ListBoxItemProcessor processor) |
|
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.
|
Scrollbar |
getHorizontalScrollbar() |
Get the Horizontal scrollbar of this listBox.
|
java.util.List<T> |
getItems() |
Get all items of this ListBox.
|
java.util.List<java.lang.Integer> |
getSelectedIndices() |
Get the current selection as a list of indices.
|
java.util.List<T> |
getSelection() |
Get the current selection.
|
Scrollbar |
getVerticalScrollbar() |
Get the Vertical scrollbar of this listBox.
|
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(java.util.Collection<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(java.util.Comparator<T> comparator) |
Sort all items using the given comparator.
|
disable, enable, getElement, getHeight, getId, getStyle, getWidth, hasFocus, isBound, isEnabled, layoutCallback, setEnabled, setFocus, setFocusable, setHeight, setId, setStyle, setWidthvoid changeSelectionMode(@Nonnull
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(@Nonnull
ListBox.ListBoxViewConverter<T> viewConverter)
viewConverter - ListBoxViewConvertervoid 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)
ListBox.SelectionMode.Single is used or it will add to the selection if ListBox.SelectionMode.Multiple is used.selectionIndex - the item index to select in the ComboBoxvoid selectItem(@Nonnull
T item)
item - the item to selectvoid selectNext()
void selectPrevious()
void deselectItemByIndex(int itemIndex)
itemIndex - item index to deselectvoid deselectItem(@Nonnull
T item)
item - item to deselect.@Nonnull java.util.List<T> getSelection()
@Nonnull java.util.List<java.lang.Integer> getSelectedIndices()
void removeItemByIndex(int itemIndex)
itemIndex - remove the item with the given index from the ListBoxvoid removeItem(@Nonnull
T item)
item - the item to remove from the ListBox@Nonnull java.util.List<T> getItems()
void showItem(@Nonnull
T item)
item - the itemvoid showItemByIndex(int itemIndex)
itemIndex - the item index to make visiblevoid setFocusItem(@Nullable
T item)
item - the item to set the focus tovoid setFocusItemByIndex(int itemIndex)
itemIndex - the new focus item@Nullable T getFocusItem()
int getFocusItemIndex()
void addAllItems(@Nonnull
java.util.Collection<T> itemsToAdd)
itemsToAdd - all items to addvoid removeAllItems(@Nonnull
java.util.Collection<T> itemsToRemove)
itemsToRemove - list of items to removevoid sortAllItems()
int getDisplayItemCount()
void sortAllItems(@Nullable
java.util.Comparator<T> comparator)
void refresh()
void addItemProcessor(@Nonnull
ListBoxItemProcessor processor)
Scrollbar getHorizontalScrollbar()
ScrollbarCopyright © 2018. All rights reserved.