Package org.omnifaces.util.selectitems
Class SelectItemsCollector
- java.lang.Object
-
- org.omnifaces.util.selectitems.SelectItemsCollector
-
public final class SelectItemsCollector extends Object
Collection of utility methods for collectingSelectItem
instances from various sources.- Author:
- Arjan Tijms
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<SelectItem>
collectFromParent(FacesContext context, UIComponent parent)
This method gets all select items that are expressed viaUISelectItem
orUISelectItems
children of the given parent component.static List<SelectItem>
collectFromUISelectItemsIterator(FacesContext facesContext, UISelectItems uiSelectItems, Iterable<?> items)
This method runs the algorithm expressed by aUISelectItems
component that uses thevar
iterator construct to generate a list ofSelectItem
s.
-
-
-
Method Detail
-
collectFromParent
public static List<SelectItem> collectFromParent(FacesContext context, UIComponent parent)
This method gets all select items that are expressed viaUISelectItem
orUISelectItems
children of the given parent component.Note that if
SelectItemGroup
instances are present then those will be inserted directly in the returned list and the using code still has to iterate over its children recursively to obtain all separateSelectItem
instances.- Parameters:
parent
- the parent whose children are scannedcontext
- The involved faces context.- Returns:
- list of select items obtained from parent's children.
-
collectFromUISelectItemsIterator
public static List<SelectItem> collectFromUISelectItemsIterator(FacesContext facesContext, UISelectItems uiSelectItems, Iterable<?> items)
This method runs the algorithm expressed by aUISelectItems
component that uses thevar
iterator construct to generate a list ofSelectItem
s.- Parameters:
uiSelectItems
- The involved select items component.items
- The available select items.facesContext
- The involved faces context.- Returns:
- list of
SelectItem
obtained from the given parameters
-
-