de.lessvoid.nifty.controls.nullobjects
Class ListBoxNull

java.lang.Object
  extended by de.lessvoid.nifty.controls.nullobjects.ListBoxNull
All Implemented Interfaces:
ListBox, NiftyControl

public class ListBoxNull
extends Object
implements ListBox


Nested Class Summary
 
Nested classes/interfaces inherited from interface de.lessvoid.nifty.controls.ListBox
ListBox.ListBoxViewConverter<T>, ListBox.ListBoxViewConverterSimple<T>, ListBox.SelectionMode
 
Constructor Summary
ListBoxNull()
           
 
Method Summary
 void addAllItems(List itemsToAdd)
          Add all items to the ListBox.
 void addItem(Object 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(Object item)
          Deselect the given item.
 void deselectItemByIndex(int itemIndex)
          Deselect the item with the given itemIndex.
 void disable()
           
 void enable()
           
 int getDisplayItemCount()
          Returns the number of items this ListBox can display without being scrolled.
 Element getElement()
           
 Object getFocusItem()
          Get the current item that has the focus.
 int getFocusItemIndex()
          Get the index of the current focus item.
 int getHeight()
           
 String getId()
           
 List getItems()
          Get all items of this ListBox.
 List<Integer> getSelectedIndices()
          Get the current selection as a list of indices.
 List getSelection()
          Get the current selection.
 String getStyle()
           
 int getWidth()
           
 boolean hasFocus()
           
 void insertItem(Object item, int index)
          Insert the given item at the given index.
 boolean isBound()
           
 boolean isEnabled()
           
 int itemCount()
          Retrieve the number of items in the ListBox.
 void layoutCallback()
           
 void refresh()
          Refresh the Listbox display.
 void removeAllItems(List itemsToRemove)
          Remove all items given in the List from this ListBox.
 void removeItem(Object item)
          Remove the given item from the ListBox.
 void removeItemByIndex(int itemIndex)
          Remove an item from the ListBox by index.
 void selectItem(Object 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 setEnabled(boolean enabled)
           
 void setFocus()
           
 void setFocusable(boolean focusable)
           
 void setFocusItem(Object item)
          Change the current focus item to the item given.
 void setFocusItemByIndex(int itemIndex)
          Change the current focus item to the given index.
 void setHeight(SizeValue height)
           
 void setId(String id)
           
 void setListBoxViewConverter(ListBox.ListBoxViewConverter viewConverter)
          Change the ListBoxViewConverter for this ListBox.
 void setStyle(String style)
           
 void setWidth(SizeValue width)
           
 void showItem(Object 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 comperator)
          Sort all items using the given comperator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListBoxNull

public ListBoxNull()
Method Detail

getElement

public Element getElement()
Specified by:
getElement in interface NiftyControl

getId

public String getId()
Specified by:
getId in interface NiftyControl

setId

public void setId(String id)
Specified by:
setId in interface NiftyControl

getWidth

public int getWidth()
Specified by:
getWidth in interface NiftyControl

setWidth

public void setWidth(SizeValue width)
Specified by:
setWidth in interface NiftyControl

getHeight

public int getHeight()
Specified by:
getHeight in interface NiftyControl

setHeight

public void setHeight(SizeValue height)
Specified by:
setHeight in interface NiftyControl

getStyle

public String getStyle()
Specified by:
getStyle in interface NiftyControl

setStyle

public void setStyle(String style)
Specified by:
setStyle in interface NiftyControl

enable

public void enable()
Specified by:
enable in interface NiftyControl

disable

public void disable()
Specified by:
disable in interface NiftyControl

setEnabled

public void setEnabled(boolean enabled)
Specified by:
setEnabled in interface NiftyControl

isEnabled

public boolean isEnabled()
Specified by:
isEnabled in interface NiftyControl

changeSelectionMode

public void changeSelectionMode(ListBox.SelectionMode listBoxSelectionMode,
                                boolean forceSelection)
Description copied from interface: ListBox
Change the ListBox.SelectionMode to a new one.

Specified by:
changeSelectionMode in interface ListBox
Parameters:
listBoxSelectionMode - the new ListBox.SelectionMode to use
forceSelection - 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.

setListBoxViewConverter

public void setListBoxViewConverter(ListBox.ListBoxViewConverter viewConverter)
Description copied from interface: ListBox
Change the ListBoxViewConverter for this ListBox.

Specified by:
setListBoxViewConverter in interface ListBox
Parameters:
viewConverter - ListBoxViewConverter

addItem

public void addItem(Object newItem)
Description copied from interface: ListBox
Add a item to the ListBox.

Specified by:
addItem in interface ListBox
Parameters:
newItem - the item to add

insertItem

public void insertItem(Object item,
                       int index)
Description copied from interface: ListBox
Insert the given item at the given index.

Specified by:
insertItem in interface ListBox
Parameters:
item - item
index - the index to insert the item.

itemCount

public int itemCount()
Description copied from interface: ListBox
Retrieve the number of items in the ListBox.

Specified by:
itemCount in interface ListBox
Returns:
number of items.

clear

public void clear()
Description copied from interface: ListBox
Clear all items from this ListBox.

Specified by:
clear in interface ListBox

selectItemByIndex

public void selectItemByIndex(int selectionIndex)
Description copied from interface: ListBox
Select the item with the given index in the ListBox. This might change the currently selected item if the ListBoxSingleSelectionMode is used or it will add to the selection if ListBoxMultiSelectionMode is used.

Specified by:
selectItemByIndex in interface ListBox
Parameters:
selectionIndex - the item index to select in the ComboBox

selectItem

public void selectItem(Object item)
Description copied from interface: ListBox
Select the item in the ListBox.

Specified by:
selectItem in interface ListBox
Parameters:
item - the item to select

selectNext

public void selectNext()
Description copied from interface: ListBox
Select the next item. This will only work in SingleSelection mode and when there currently is an element selected.

Specified by:
selectNext in interface ListBox

selectPrevious

public void selectPrevious()
Description copied from interface: ListBox
Select the previous item. This will only work in SingleSelection mode and when there currently is an element selected.

Specified by:
selectPrevious in interface ListBox

deselectItemByIndex

public void deselectItemByIndex(int itemIndex)
Description copied from interface: ListBox
Deselect the item with the given itemIndex.

Specified by:
deselectItemByIndex in interface ListBox
Parameters:
itemIndex - item index to deselect

deselectItem

public void deselectItem(Object item)
Description copied from interface: ListBox
Deselect the given item.

Specified by:
deselectItem in interface ListBox
Parameters:
item - item to deselect.

getSelection

public List getSelection()
Description copied from interface: ListBox
Get the current selection.

Specified by:
getSelection in interface ListBox
Returns:
list of the selected items in this ListBox.

removeItemByIndex

public void removeItemByIndex(int itemIndex)
Description copied from interface: ListBox
Remove an item from the ListBox by index.

Specified by:
removeItemByIndex in interface ListBox
Parameters:
itemIndex - remove the item with the given index from the ListBox

removeItem

public void removeItem(Object item)
Description copied from interface: ListBox
Remove the given item from the ListBox.

Specified by:
removeItem in interface ListBox
Parameters:
item - the item to remove from the ListBox

getItems

public List getItems()
Description copied from interface: ListBox
Get all items of this ListBox.

Specified by:
getItems in interface ListBox
Returns:
list of all items

showItem

public void showItem(Object item)
Description copied from interface: ListBox
Make sure the given item is visible. This can also be used to make sure you can see the element after a new item has been added to the ListBox.

Specified by:
showItem in interface ListBox
Parameters:
item - the item

showItemByIndex

public void showItemByIndex(int itemIndex)
Description copied from interface: ListBox
Make sure the given item is visible.

Specified by:
showItemByIndex in interface ListBox
Parameters:
itemIndex - the item index to make visible

setFocusItem

public void setFocusItem(Object item)
Description copied from interface: ListBox
Change the current focus item to the item given. The focus item is the item you can change with the cursor keys. It just marks the item it does not change the selection.

Specified by:
setFocusItem in interface ListBox
Parameters:
item - the item to set the focus to

setFocusItemByIndex

public void setFocusItemByIndex(int itemIndex)
Description copied from interface: ListBox
Change the current focus item to the given index.

Specified by:
setFocusItemByIndex in interface ListBox
Parameters:
itemIndex - the new focus item

getFocusItem

public Object getFocusItem()
Description copied from interface: ListBox
Get the current item that has the focus.

Specified by:
getFocusItem in interface ListBox
Returns:
the item that has the focus

getFocusItemIndex

public int getFocusItemIndex()
Description copied from interface: ListBox
Get the index of the current focus item.

Specified by:
getFocusItemIndex in interface ListBox
Returns:
the index of the current focus item.

addAllItems

public void addAllItems(List itemsToAdd)
Description copied from interface: ListBox
Add all items to the ListBox.

Specified by:
addAllItems in interface ListBox
Parameters:
itemsToAdd - all items to add

removeAllItems

public void removeAllItems(List itemsToRemove)
Description copied from interface: ListBox
Remove all items given in the List from this ListBox.

Specified by:
removeAllItems in interface ListBox
Parameters:
itemsToRemove - list of items to remove

sortAllItems

public void sortAllItems()
Description copied from interface: ListBox
Sort all items using natural ordering.

Specified by:
sortAllItems in interface ListBox

sortAllItems

public void sortAllItems(Comparator comperator)
Description copied from interface: ListBox
Sort all items using the given comperator.

Specified by:
sortAllItems in interface ListBox

setFocus

public void setFocus()
Specified by:
setFocus in interface NiftyControl

setFocusable

public void setFocusable(boolean focusable)
Specified by:
setFocusable in interface NiftyControl

getSelectedIndices

public List<Integer> getSelectedIndices()
Description copied from interface: ListBox
Get the current selection as a list of indices.

Specified by:
getSelectedIndices in interface ListBox
Returns:
list of indices for the current selection

getDisplayItemCount

public int getDisplayItemCount()
Description copied from interface: ListBox
Returns the number of items this ListBox can display without being scrolled.

Specified by:
getDisplayItemCount in interface ListBox
Returns:
number of display items

hasFocus

public boolean hasFocus()
Specified by:
hasFocus in interface NiftyControl

layoutCallback

public void layoutCallback()
Specified by:
layoutCallback in interface NiftyControl

isBound

public boolean isBound()
Specified by:
isBound in interface NiftyControl

refresh

public void refresh()
Description copied from interface: ListBox
Refresh the Listbox display. You can use that when you've made changes to the underlying model classes. This just displays all currently visible elements.

Specified by:
refresh in interface ListBox


Copyright © 2011. All Rights Reserved.