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

java.lang.Object
  extended by de.lessvoid.nifty.controls.listbox.ListBoxViewNull<T>
All Implemented Interfaces:
ListBoxView<T>

public class ListBoxViewNull<T>
extends Object
implements ListBoxView<T>

A Null implementation of ListBoxView that does nothing.

Author:
void

Constructor Summary
ListBoxViewNull()
           
 
Method Summary
 void display(List<T> captions, int focusElement, List<Integer> selectionElements)
          Display the given descriptions.
 int getWidth(T item)
          Return the width of the given item.
 void publish(ListBoxSelectionChangedEvent<T> event)
          Publish this event.
 void scrollTo(int newPosition)
          Scroll the view to the given position.
 void updateTotalCount(int newCount)
          Updates the view with the total count of elements currently in the ListBox.
 void updateTotalWidth(int newWidth)
          Update the ListBox view with the given width.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListBoxViewNull

public ListBoxViewNull()
Method Detail

display

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

Specified by:
display in interface ListBoxView<T>

updateTotalCount

public void updateTotalCount(int newCount)
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

scrollTo

public void scrollTo(int newPosition)
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

publish

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

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

updateTotalWidth

public void updateTotalWidth(int newWidth)
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

getWidth

public int getWidth(T item)
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


Copyright © 2011. All Rights Reserved.