com.alogient.cameleon.extension.wicket.ui.component
Class SelectChoiceList<T extends SelectChoice<?>>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<T>
              extended by com.alogient.cameleon.extension.wicket.ui.component.SelectChoiceList<T>
All Implemented Interfaces:
Serializable, Cloneable, Iterable<T>, Collection<T>, List<T>, RandomAccess, org.apache.wicket.IClusterable, org.apache.wicket.markup.html.form.IChoiceRenderer<T>

public class SelectChoiceList<T extends SelectChoice<?>>
extends ArrayList<T>
implements org.apache.wicket.markup.html.form.IChoiceRenderer<T>

List of SelectChoice<?> items.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
SelectChoiceList(T... items)
          Create list with initial list of items.
 
Method Summary
 T addSorted(T item)
          Add item to list if not there and then sort.
 Object getDisplayValue(T object)
          Get the display value from the SelectChoice (what the user sees)
 String getIdValue(T object, int index)
          Get key value (what is returned from browser)
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

SelectChoiceList

public SelectChoiceList(T... items)
Create list with initial list of items.

Parameters:
items - initial items
Method Detail

addSorted

public T addSorted(T item)
Add item to list if not there and then sort. Returns pre-existing item (if there) or item passed in.

Parameters:
item - to add to list
Returns:
item added

getDisplayValue

public Object getDisplayValue(T object)
Get the display value from the SelectChoice (what the user sees)

Specified by:
getDisplayValue in interface org.apache.wicket.markup.html.form.IChoiceRenderer<T extends SelectChoice<?>>
Parameters:
object - a SelectChoice object
Returns:
object.getDisplay()

getIdValue

public String getIdValue(T object,
                         int index)
Get key value (what is returned from browser)

Specified by:
getIdValue in interface org.apache.wicket.markup.html.form.IChoiceRenderer<T extends SelectChoice<?>>
Parameters:
object - a SelectChoice object
index - not used
Returns:
object.getKeyAsString()


Copyright © 2011 Alogient. All Rights Reserved.