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 |
bestGuess(Class<? extends Collection> type,
int initialSize) |
protected Collection |
cloneValue(Object value)
Utility method to invoke the the
clone method on the provided
value. |
protected Object |
coerceToModelType(javax.faces.context.FacesContext ctx,
Object value,
Class itemValueType) |
protected boolean |
containsaValue(Object valueArray) |
Object |
convertSelectManyValue(javax.faces.context.FacesContext context,
javax.faces.component.UISelectMany uiSelectMany,
String[] newValues) |
protected Object |
convertSelectManyValuesForArray(javax.faces.context.FacesContext context,
javax.faces.component.UISelectMany uiSelectMany,
Class elementType,
String[] newValues) |
protected Collection |
convertSelectManyValuesForCollection(javax.faces.context.FacesContext context,
javax.faces.component.UISelectMany uiSelectMany,
Class collectionType,
String[] newValues) |
protected Object |
convertSelectManyValuesForModel(javax.faces.context.FacesContext context,
javax.faces.component.UISelectMany uiSelectMany,
Class modelType,
String[] newValues) |
Object |
convertSelectOneValue(javax.faces.context.FacesContext context,
javax.faces.component.UISelectOne uiSelectOne,
String newValue) |
protected Collection |
createCollection(Collection collection,
Class<? extends Collection> fallBackType) |
protected Collection |
createCollectionFromHint(Object collectionTypeHint)
Create a collection from the provided hint.
|
void |
decode(javax.faces.context.FacesContext context,
javax.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(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
Render the beginning specified
UIComponent to the
output stream or writer associated with the response we are creating. |
void |
encodeEnd(javax.faces.context.FacesContext context,
javax.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(javax.faces.context.FacesContext context,
javax.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(javax.faces.component.UIComponent component) |
protected String |
getMultipleText(javax.faces.component.UIComponent component) |
protected Object[] |
getSubmittedSelectedValues(javax.faces.component.UIComponent component) |
protected static boolean |
isHideNoSelection(javax.faces.component.UIComponent component) |
protected boolean |
isSelected(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
Object itemValue,
Object valueArray,
javax.faces.convert.Converter converter) |
protected boolean |
renderOption(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
javax.faces.component.UIComponent selectComponent,
javax.faces.convert.Converter converter,
javax.faces.model.SelectItem curItem,
Object currentSelections,
Object[] submittedValues,
HtmlBasicRenderer.OptionComponentInfo optionInfo) |
protected int |
renderOptions(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
SelectItemsIterator<javax.faces.model.SelectItem> items) |
protected void |
renderSelect(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component) |
protected void |
writeDefaultSize(javax.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(javax.faces.context.FacesContext context, javax.faces.component.UISelectMany uiSelectMany, String[] newValues) throws javax.faces.convert.ConverterException
javax.faces.convert.ConverterExceptionpublic Object convertSelectOneValue(javax.faces.context.FacesContext context, javax.faces.component.UISelectOne uiSelectOne, String newValue) throws javax.faces.convert.ConverterException
javax.faces.convert.ConverterExceptionpublic void decode(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
javax.faces.render.RendererDecode 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(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
throws IOException
javax.faces.render.RendererRender 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 javax.faces.render.Renderercontext - FacesContext for the request we are processingcomponent - UIComponent to be renderedIOException - if an input/output error occurs while renderingpublic void encodeEnd(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
throws IOException
javax.faces.render.RendererRender 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(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, Object submittedValue) throws javax.faces.convert.ConverterException
javax.faces.render.RendererAttempt 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.javax.faces.convert.ConverterException - if the submitted value
cannot be converted successfully.protected Object convertSelectManyValuesForModel(javax.faces.context.FacesContext context, javax.faces.component.UISelectMany uiSelectMany, Class modelType, String[] newValues)
protected Object convertSelectManyValuesForArray(javax.faces.context.FacesContext context, javax.faces.component.UISelectMany uiSelectMany, Class elementType, String[] newValues) throws javax.faces.convert.ConverterException
javax.faces.convert.ConverterExceptionprotected Collection convertSelectManyValuesForCollection(javax.faces.context.FacesContext context, javax.faces.component.UISelectMany uiSelectMany, Class collectionType, String[] newValues)
protected boolean renderOption(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
javax.faces.component.UIComponent selectComponent,
javax.faces.convert.Converter converter,
javax.faces.model.SelectItem curItem,
Object currentSelections,
Object[] submittedValues,
HtmlBasicRenderer.OptionComponentInfo optionInfo)
throws IOException
IOExceptionprotected void writeDefaultSize(javax.faces.context.ResponseWriter writer,
int itemCount)
throws IOException
IOExceptionprotected boolean containsaValue(Object valueArray)
protected Object getCurrentSelectedValues(javax.faces.component.UIComponent component)
protected String getMultipleText(javax.faces.component.UIComponent component)
protected Object[] getSubmittedSelectedValues(javax.faces.component.UIComponent component)
protected boolean isSelected(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
Object itemValue,
Object valueArray,
javax.faces.convert.Converter converter)
protected int renderOptions(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
SelectItemsIterator<javax.faces.model.SelectItem> items)
throws IOException
IOExceptionprotected void renderSelect(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
throws IOException
IOExceptionprotected Object coerceToModelType(javax.faces.context.FacesContext ctx, Object value, Class itemValueType)
protected Collection createCollection(Collection collection, Class<? extends Collection> fallBackType)
collection - a Collection instanceCollection instance or null if the instance
cannot be createdprotected Collection 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 bestGuess(Class<? extends Collection> type, int initialSize)
type - the target model typeinitialSize - the initial size of the CollectionCollection instance that best matches
typeprotected Collection createCollectionFromHint(Object collectionTypeHint)
Create a collection from the provided hint.
collectionTypeHint - the Collection type as either a String or Classprotected static boolean isHideNoSelection(javax.faces.component.UIComponent component)
Copyright © 2010–2018 JBoss by Red Hat. All rights reserved.