public class SortedTypeChoiceRenderer extends AbstractList<String> implements org.apache.wicket.markup.html.form.IChoiceRenderer<String>
Collator
for the current CMS locale. This renderer is also the (sorted) list of types to render.
To use it in (for example) a DropDownChoice, use the following code:
CollectionmyTypeList = ... SortedTypeChoiceRenderer renderer = new SortedTypeChoiceRenderer(myComponent, myTypeList); DropDownChoice dropDown = new DropDownChoice("wicketId", typeModel, renderer, renderer);
modCount
Constructor and Description |
---|
SortedTypeChoiceRenderer(Collection<String> types,
Locale locale) |
SortedTypeChoiceRenderer(Collection<String> types,
Locale locale,
org.apache.wicket.Component component)
Creates a new choice renderer the given types in the given locale.
|
SortedTypeChoiceRenderer(org.apache.wicket.Component component,
Collection<String> types) |
Modifier and Type | Method and Description |
---|---|
String |
get(int index) |
Object |
getDisplayValue(String type) |
String |
getIdValue(String type,
int index) |
int |
size() |
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
parallelStream, removeIf, stream
public SortedTypeChoiceRenderer(org.apache.wicket.Component component, Collection<String> types)
public SortedTypeChoiceRenderer(Collection<String> types, Locale locale)
public SortedTypeChoiceRenderer(Collection<String> types, Locale locale, org.apache.wicket.Component component)
types
- the JCR types to translatelocale
- the locale to translate the types intocomponent
- the component the component whose resource bundle is used as the backup for looking up
translated type names. When null
, no backup will be used.public String get(int index)
public int size()
size
in interface Collection<String>
size
in interface List<String>
size
in class AbstractCollection<String>
public String getIdValue(String type, int index)
getIdValue
in interface org.apache.wicket.markup.html.form.IChoiceRenderer<String>
Copyright © 2007–2016 Hippo B.V. (http://www.onehippo.com). All rights reserved.