de.lessvoid.nifty.controls.listbox
Class ListBoxControl<T>

java.lang.Object
  extended by de.lessvoid.nifty.controls.AbstractController
      extended by de.lessvoid.nifty.controls.listbox.ListBoxControl<T>
All Implemented Interfaces:
Controller, ListBox<T>, ListBoxView<T>, NiftyControl

Deprecated. Please use ListBox when accessing NiftyControls.

@Deprecated
public class ListBoxControl<T>
extends AbstractController
implements ListBox<T>, ListBoxView<T>


Nested Class Summary
 
Nested classes/interfaces inherited from interface de.lessvoid.nifty.controls.ListBox
ListBox.ListBoxViewConverter<T>, ListBox.ListBoxViewConverterSimple<T>, ListBox.SelectionMode
 
Constructor Summary
ListBoxControl()
          Deprecated.  
 
Method Summary
 void addAllItems(List<T> itemsToAdd)
          Deprecated. Add all items to the ListBox.
 void addItem(T newItem)
          Deprecated. Add a item to the ListBox.
 void bind(Nifty niftyParam, Screen screenParam, Element elementParam, Properties parameterParam, Attributes controlDefinitionAttributes)
          Deprecated.  
 void changeSelectionMode(ListBox.SelectionMode listBoxSelectionMode, boolean forceSelection)
          Deprecated. Change the ListBox.SelectionMode to a new one.
 void clear()
          Deprecated. Clear all items from this ListBox.
 void deselectItem(T item)
          Deprecated. Deselect the given item.
 void deselectItemByIndex(int itemIndex)
          Deprecated. Deselect the item with the given itemIndex.
 void display(List<T> visibleItems, int focusElement, List<Integer> selectedElements)
          Deprecated. Display the given descriptions.
 void ensureWidthConstraints()
          Deprecated.  
 int getDisplayItemCount()
          Deprecated. Returns the number of items this ListBox can display without being scrolled.
 T getFocusItem()
          Deprecated. Get the current item that has the focus.
 int getFocusItemIndex()
          Deprecated. Get the index of the current focus item.
 List<T> getItems()
          Deprecated. Get all items of this ListBox.
 List<Integer> getSelectedIndices()
          Deprecated. Get the current selection as a list of indices.
 List<T> getSelection()
          Deprecated. Get the current selection.
 ListBox.ListBoxViewConverter<T> getViewConverter()
          Deprecated.  
 int getWidth(T item)
          Deprecated. Return the width of the given item.
 void init(Properties parameter, Attributes controlDefinitionAttributes)
          Deprecated.  
 boolean inputEvent(NiftyInputEvent inputEvent)
          Deprecated.  
 void insertItem(T item, int index)
          Deprecated. Insert the given item at the given index.
 int itemCount()
          Deprecated. Retrieve the number of items in the ListBox.
 void layoutCallback()
          Deprecated.  
 void mouseWheel(Element e, NiftyMouseInputEvent inputEvent)
          Deprecated.  
 void onFocus(boolean getFocus)
          Deprecated.  
 void onStartScreen()
          Deprecated.  
 void publish(ListBoxSelectionChangedEvent<T> event)
          Deprecated. Publish this event.
 void refresh()
          Deprecated. Refresh the Listbox display.
 void removeAllItems(List<T> itemsToRemove)
          Deprecated. Remove all items given in the List from this ListBox.
 void removeItem(T item)
          Deprecated. Remove the given item from the ListBox.
 void removeItemByIndex(int itemIndex)
          Deprecated. Remove an item from the ListBox by index.
 void scrollTo(int newPosition)
          Deprecated. Scroll the view to the given position.
 void selectItem(T item)
          Deprecated. Select the item in the ListBox.
 void selectItemByIndex(int selectionIndex)
          Deprecated. Select the item with the given index in the ListBox.
 void selectNext()
          Deprecated. Select the next item.
 void selectPrevious()
          Deprecated. Select the previous item.
 void setFocus()
          Deprecated.  
 void setFocusItem(T item)
          Deprecated. Change the current focus item to the item given.
 void setFocusItemByIndex(int itemIndex)
          Deprecated. Change the current focus item to the given index.
 void setListBoxViewConverter(ListBox.ListBoxViewConverter<T> viewConverter)
          Deprecated. Change the ListBoxViewConverter for this ListBox.
 void showItem(T item)
          Deprecated. Make sure the given item is visible.
 void showItemByIndex(int itemIndex)
          Deprecated. Make sure the given item is visible.
 void sortAllItems()
          Deprecated. Sort all items using natural ordering.
 void sortAllItems(Comparator<T> comperator)
          Deprecated. Sort all items using the given comperator.
 void updateTotalCount(int newCount)
          Deprecated. Updates the view with the total count of elements currently in the ListBox.
 void updateTotalWidth(int newWidth)
          Deprecated. Update the ListBox view with the given width.
 
Methods inherited from class de.lessvoid.nifty.controls.AbstractController
bind, disable, enable, getElement, getHeight, getId, getStyle, getWidth, hasFocus, isBound, isEnabled, setEnabled, setFocusable, setHeight, setId, setStyle, setWidth
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.lessvoid.nifty.controls.NiftyControl
disable, enable, getElement, getHeight, getId, getStyle, getWidth, hasFocus, isBound, isEnabled, setEnabled, setFocusable, setHeight, setId, setStyle, setWidth
 

Constructor Detail

ListBoxControl

public ListBoxControl()
Deprecated. 
Method Detail

bind

public void bind(Nifty niftyParam,
                 Screen screenParam,
                 Element elementParam,
                 Properties parameterParam,
                 Attributes controlDefinitionAttributes)
Deprecated. 
Specified by:
bind in interface Controller

init

public void init(Properties parameter,
                 Attributes controlDefinitionAttributes)
Deprecated. 
Specified by:
init in interface Controller
Overrides:
init in class AbstractController

onStartScreen

public void onStartScreen()
Deprecated. 
Specified by:
onStartScreen in interface Controller

mouseWheel

public void mouseWheel(Element e,
                       NiftyMouseInputEvent inputEvent)
Deprecated. 

inputEvent

public boolean inputEvent(NiftyInputEvent inputEvent)
Deprecated. 
Specified by:
inputEvent in interface Controller

onFocus

public void onFocus(boolean getFocus)
Deprecated. 
Specified by:
onFocus in interface Controller
Overrides:
onFocus in class AbstractController

setFocus

public void setFocus()
Deprecated. 
Specified by:
setFocus in interface NiftyControl
Overrides:
setFocus in class AbstractController

getViewConverter

public ListBox.ListBoxViewConverter<T> getViewConverter()
Deprecated. 

display

public void display(List<T> visibleItems,
                    int focusElement,
                    List<Integer> selectedElements)
Deprecated. 
Description copied from interface: ListBoxView
Display the given descriptions.

Specified by:
display in interface ListBoxView<T>

updateTotalCount

public void updateTotalCount(int newCount)
Deprecated. 
Description copied from interface: ListBoxView
Updates the view with the total count of elements currently in the ListBox. This can be used to update the scrollbar.

Specified by:
updateTotalCount in interface ListBoxView<T>
Parameters:
newCount - the new count to display

updateTotalWidth

public void updateTotalWidth(int newWidth)
Deprecated. 
Description copied from interface: ListBoxView
Update the ListBox view with the given width. This is used to update the horizontal scrollbar to a new maximum value.

Specified by:
updateTotalWidth in interface ListBoxView<T>
Parameters:
newWidth - new maximum width of all items in the ListBox

ensureWidthConstraints

public void ensureWidthConstraints()
Deprecated. 

layoutCallback

public void layoutCallback()
Deprecated. 
Specified by:
layoutCallback in interface NiftyControl
Overrides:
layoutCallback in class AbstractController

scrollTo

public void scrollTo(int newPosition)
Deprecated. 
Description copied from interface: ListBoxView
Scroll the view to the given position.

Specified by:
scrollTo in interface ListBoxView<T>
Parameters:
newPosition - the new index to scroll to

getWidth

public int getWidth(T item)
Deprecated. 
Description copied from interface: ListBoxView
Return the width of the given item. This is used to keep track of the maximum width of all items in the ListBox to update the horizontal Scrollbar correctly.

Specified by:
getWidth in interface ListBoxView<T>
Parameters:
item - the item to get the width for
Returns:
the width of the item

changeSelectionMode

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

Specified by:
changeSelectionMode in interface ListBox<T>
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.

addItem

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

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

insertItem

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

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

itemCount

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

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

clear

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

Specified by:
clear in interface ListBox<T>

selectItemByIndex

public void selectItemByIndex(int selectionIndex)
Deprecated. 
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<T>
Parameters:
selectionIndex - the item index to select in the ComboBox

selectItem

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

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

selectNext

public void selectNext()
Deprecated. 
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<T>

selectPrevious

public void selectPrevious()
Deprecated. 
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<T>

deselectItemByIndex

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

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

deselectItem

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

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

getSelection

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

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

getSelectedIndices

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

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

removeItemByIndex

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

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

removeItem

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

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

getItems

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

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

showItem

public void showItem(T item)
Deprecated. 
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<T>
Parameters:
item - the item

showItemByIndex

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

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

setFocusItem

public void setFocusItem(T item)
Deprecated. 
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<T>
Parameters:
item - the item to set the focus to

setFocusItemByIndex

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

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

getFocusItem

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

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

getFocusItemIndex

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

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

setListBoxViewConverter

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

Specified by:
setListBoxViewConverter in interface ListBox<T>
Parameters:
viewConverter - ListBoxViewConverter

publish

public void publish(ListBoxSelectionChangedEvent<T> event)
Deprecated. 
Description copied from interface: ListBoxView
Publish this event.

Specified by:
publish in interface ListBoxView<T>
Parameters:
event - the event to publish

addAllItems

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

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

removeAllItems

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

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

sortAllItems

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

Specified by:
sortAllItems in interface ListBox<T>

sortAllItems

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

Specified by:
sortAllItems in interface ListBox<T>

getDisplayItemCount

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

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

refresh

public void refresh()
Deprecated. 
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<T>


Copyright © 2011. All Rights Reserved.