public class MenuRenderer extends HtmlBasicInputRenderer
UISelectOne or UISelectMany
component as a list of menu options.HtmlBasicRenderer.OptionComponentInfo, HtmlBasicRenderer.ParamEMPTY_PARAMS, logger| Constructor and Description |
|---|
MenuRenderer() |
| Modifier and Type | Method and Description |
|---|---|
protected Collection<Object> |
bestGuess(Class<? extends Collection<Object>> type,
int initialSize) |
protected Collection<Object> |
cloneValue(Object value)
Utility method to invoke the the
clone method on the provided value. |
protected Object |
coerceToModelType(jakarta.faces.context.FacesContext ctx,
Object value,
Class<?> itemValueType) |
protected boolean |
containsaValue(Object valueArray) |
Object |
convertSelectManyValue(jakarta.faces.context.FacesContext context,
jakarta.faces.component.UISelectMany uiSelectMany,
String[] newValues) |
protected Object |
convertSelectManyValuesForArray(jakarta.faces.context.FacesContext context,
jakarta.faces.component.UISelectMany uiSelectMany,
Class<?> elementType,
String[] newValues) |
protected Collection<Object> |
convertSelectManyValuesForCollection(jakarta.faces.context.FacesContext context,
jakarta.faces.component.UISelectMany uiSelectMany,
Class<? extends Collection<Object>> collectionType,
String[] newValues) |
protected Object |
convertSelectManyValuesForModel(jakarta.faces.context.FacesContext context,
jakarta.faces.component.UISelectMany uiSelectMany,
Class<?> modelType,
String[] newValues) |
Object |
convertSelectOneValue(jakarta.faces.context.FacesContext context,
jakarta.faces.component.UISelectOne uiSelectOne,
String newValue) |
protected Collection<Object> |
createCollection(Collection<Object> collection,
Class<? extends Collection<Object>> fallBackType) |
protected Collection<Object> |
createCollectionFromHint(Object collectionTypeHint)
Create a collection from the provided hint.
|
void |
decode(jakarta.faces.context.FacesContext context,
jakarta.faces.component.UIComponent component)
Decode any new state of the specified
UIComponent from the request contained in the specified
FacesContext, and store that state on the UIComponent. |
void |
encodeBegin(jakarta.faces.context.FacesContext context,
jakarta.faces.component.UIComponent component)
Render the beginning specified
UIComponent to the output stream or writer associated with the response we are
creating. |
void |
encodeEnd(jakarta.faces.context.FacesContext context,
jakarta.faces.component.UIComponent component)
Render the ending of the current state of the specified
UIComponent, following the rules described for
encodeBegin() to acquire the appropriate value to be rendered. |
Object |
getConvertedValue(jakarta.faces.context.FacesContext context,
jakarta.faces.component.UIComponent component,
Object submittedValue)
Attempt to convert previously stored state information into an object of the type required for this component
(optionally using the registered
Converter for this component, if there is one). |
protected Object |
getCurrentSelectedValues(jakarta.faces.component.UIComponent component) |
protected String |
getMultipleText(jakarta.faces.component.UIComponent component) |
protected Object[] |
getSubmittedSelectedValues(jakarta.faces.component.UIComponent component) |
protected static boolean |
isHideNoSelection(jakarta.faces.component.UIComponent component) |
protected boolean |
isSelected(jakarta.faces.context.FacesContext context,
jakarta.faces.component.UIComponent component,
Object itemValue,
Object valueArray,
jakarta.faces.convert.Converter<?> converter) |
protected boolean |
renderOption(jakarta.faces.context.FacesContext context,
jakarta.faces.component.UIComponent component,
jakarta.faces.component.UIComponent selectComponent,
jakarta.faces.convert.Converter<?> converter,
jakarta.faces.model.SelectItem curItem,
Object currentSelections,
Object[] submittedValues,
HtmlBasicRenderer.OptionComponentInfo optionInfo) |
protected int |
renderOptions(jakarta.faces.context.FacesContext context,
jakarta.faces.component.UIComponent component,
SelectItemsIterator<jakarta.faces.model.SelectItem> items) |
protected void |
renderSelect(jakarta.faces.context.FacesContext context,
jakarta.faces.component.UIComponent component) |
protected void |
writeDefaultSize(jakarta.faces.context.ResponseWriter writer,
int itemCount) |
getNonOnChangeBehaviors, getNonOnClickSelectBehaviors, getValue, setSubmittedValueaugmentIdReference, convertClientId, decodeBehaviors, encodeRecursive, getBehaviorParameters, getChildren, getCurrentValue, getEndTextToRender, getFacet, getForComponent, getFormattedValue, getFormattedValue, getMessageIter, getParamList, getPassThruBehaviors, getRendersChildren, isBehaviorSource, rendererParamsNotNull, shouldDecode, shouldEncode, shouldEncodeChildren, shouldWriteIdAttribute, writeIdAttributeIfNecessarypublic Object convertSelectManyValue(jakarta.faces.context.FacesContext context, jakarta.faces.component.UISelectMany uiSelectMany, String[] newValues) throws jakarta.faces.convert.ConverterException
jakarta.faces.convert.ConverterExceptionpublic Object convertSelectOneValue(jakarta.faces.context.FacesContext context, jakarta.faces.component.UISelectOne uiSelectOne, String newValue) throws jakarta.faces.convert.ConverterException
jakarta.faces.convert.ConverterExceptionpublic void decode(jakarta.faces.context.FacesContext context,
jakarta.faces.component.UIComponent component)
jakarta.faces.render.Renderer
Decode any new state of the specified UIComponent from the request contained in the specified
FacesContext, and store that state on the UIComponent.
During decoding, events may be enqueued for later processing (by event listeners that have registered an interest),
by calling queueEvent() on the associated UIComponent.
decode in class HtmlBasicRenderercontext - FacesContext for the request we are processingcomponent - UIComponent to be decoded.public void encodeBegin(jakarta.faces.context.FacesContext context,
jakarta.faces.component.UIComponent component)
throws IOException
jakarta.faces.render.Renderer
Render the beginning specified UIComponent to the output stream or writer associated with the response we are
creating. If the conversion attempted in a previous call to getConvertedValue() for this component
failed, the state information saved during execution of decode() should be used to reproduce the
incorrect input.
encodeBegin in class jakarta.faces.render.Renderercontext - FacesContext for the request we are processingcomponent - UIComponent to be renderedIOException - if an input/output error occurs while renderingpublic void encodeEnd(jakarta.faces.context.FacesContext context,
jakarta.faces.component.UIComponent component)
throws IOException
jakarta.faces.render.Renderer
Render the ending of the current state of the specified UIComponent, following the rules described for
encodeBegin() to acquire the appropriate value to be rendered.
encodeEnd in class HtmlBasicRenderercontext - FacesContext for the response we are creatingcomponent - UIComponent to be renderedIOException - if an input/output error occurs while renderingpublic Object getConvertedValue(jakarta.faces.context.FacesContext context, jakarta.faces.component.UIComponent component, Object submittedValue) throws jakarta.faces.convert.ConverterException
jakarta.faces.render.Renderer
Attempt to convert previously stored state information into an object of the type required for this component
(optionally using the registered Converter for this component, if there is one). If
conversion is successful, the new value should be returned from this method; if not, a ConverterException
should be thrown.
getConvertedValue in class HtmlBasicInputRenderercontext - FacesContext for the request we are processingcomponent - UIComponent to be decoded.submittedValue - a value stored on the component during decode.jakarta.faces.convert.ConverterException - if the submitted value cannot be converted successfully.protected Object convertSelectManyValuesForModel(jakarta.faces.context.FacesContext context, jakarta.faces.component.UISelectMany uiSelectMany, Class<?> modelType, String[] newValues)
protected Object convertSelectManyValuesForArray(jakarta.faces.context.FacesContext context, jakarta.faces.component.UISelectMany uiSelectMany, Class<?> elementType, String[] newValues) throws jakarta.faces.convert.ConverterException
jakarta.faces.convert.ConverterExceptionprotected Collection<Object> convertSelectManyValuesForCollection(jakarta.faces.context.FacesContext context, jakarta.faces.component.UISelectMany uiSelectMany, Class<? extends Collection<Object>> collectionType, String[] newValues)
protected boolean renderOption(jakarta.faces.context.FacesContext context,
jakarta.faces.component.UIComponent component,
jakarta.faces.component.UIComponent selectComponent,
jakarta.faces.convert.Converter<?> converter,
jakarta.faces.model.SelectItem curItem,
Object currentSelections,
Object[] submittedValues,
HtmlBasicRenderer.OptionComponentInfo optionInfo)
throws IOException
IOExceptionprotected void writeDefaultSize(jakarta.faces.context.ResponseWriter writer,
int itemCount)
throws IOException
IOExceptionprotected boolean containsaValue(Object valueArray)
protected Object getCurrentSelectedValues(jakarta.faces.component.UIComponent component)
protected String getMultipleText(jakarta.faces.component.UIComponent component)
protected Object[] getSubmittedSelectedValues(jakarta.faces.component.UIComponent component)
protected boolean isSelected(jakarta.faces.context.FacesContext context,
jakarta.faces.component.UIComponent component,
Object itemValue,
Object valueArray,
jakarta.faces.convert.Converter<?> converter)
protected int renderOptions(jakarta.faces.context.FacesContext context,
jakarta.faces.component.UIComponent component,
SelectItemsIterator<jakarta.faces.model.SelectItem> items)
throws IOException
IOExceptionprotected void renderSelect(jakarta.faces.context.FacesContext context,
jakarta.faces.component.UIComponent component)
throws IOException
IOExceptionprotected Object coerceToModelType(jakarta.faces.context.FacesContext ctx, Object value, Class<?> itemValueType)
protected Collection<Object> createCollection(Collection<Object> collection, Class<? extends Collection<Object>> fallBackType)
collection - a Collection instanceCollection instance or null if the instance cannot be createdprotected Collection<Object> cloneValue(Object value)
Utility method to invoke the the clone method on the provided value.
value - the value to cloneclone() or null if the value could not be cloned or does not
implement the Cloneable interfaceprotected Collection<Object> bestGuess(Class<? extends Collection<Object>> type, int initialSize)
type - the target model typeinitialSize - the initial size of the CollectionCollection instance that best matches typeprotected Collection<Object> createCollectionFromHint(Object collectionTypeHint)
Create a collection from the provided hint.
collectionTypeHint - the Collection type as either a String or Classprotected static boolean isHideNoSelection(jakarta.faces.component.UIComponent component)
Copyright © 2010–2022 JBoss by Red Hat. All rights reserved.