de.lessvoid.nifty.controls
Class DropDown.SimpleDropDownViewConverter<T>

java.lang.Object
  extended by de.lessvoid.nifty.controls.DropDown.SimpleDropDownViewConverter<T>
Type Parameters:
T -
All Implemented Interfaces:
DropDown.DropDownViewConverter<T>
Enclosing interface:
DropDown<T>

public static class DropDown.SimpleDropDownViewConverter<T>
extends Object
implements DropDown.DropDownViewConverter<T>

A simple implementation of DropDownViewConverter that will just use item.toString(). This is the default DropDownViewConverter used when you don't set a different implementation.

Author:
void

Constructor Summary
DropDown.SimpleDropDownViewConverter()
           
 
Method Summary
 void display(Element element, T item)
          Display the given item in the given element.
 int getWidth(Element element, T item)
          Return the width in pixel of the given item rendered for the given element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DropDown.SimpleDropDownViewConverter

public DropDown.SimpleDropDownViewConverter()
Method Detail

display

public void display(Element element,
                    T item)
Description copied from interface: DropDown.DropDownViewConverter
Display the given item in the given element.

Specified by:
display in interface DropDown.DropDownViewConverter<T>
Parameters:
element - the element to display the item in
item - the item to display

getWidth

public int getWidth(Element element,
                    T item)
Description copied from interface: DropDown.DropDownViewConverter
Return the width in pixel of the given item rendered for the given element.

Specified by:
getWidth in interface DropDown.DropDownViewConverter<T>
Parameters:
element - the element to render
item - the item to render
Returns:
the width of the element after the item has been applied to it


Copyright © 2011. All Rights Reserved.