public final class FaceletHandlerHelper extends Object
Helps generating custom tag handlers and custom tag attributes.
Modifier and Type | Field and Description |
---|---|
static String |
DEV_CONTAINER_ID_SUFFIX |
static String |
DEV_MODE_DISABLED_VARIABLE |
static String |
DEV_REGION_ID_SUFFIX |
static String |
DIR_AUTO |
static String |
DIR_PROPERTY |
static String |
LAYOUT_ID_PREFIX |
static String |
MESSAGE_ID_SUFFIX |
static String |
WIDGET_ID_PREFIX |
Constructor and Description |
---|
FaceletHandlerHelper(javax.faces.view.facelets.FaceletContext context,
javax.faces.view.facelets.TagConfig tagConfig) |
Modifier and Type | Method and Description |
---|---|
static javax.faces.view.facelets.TagAttributes |
addTagAttribute(javax.faces.view.facelets.TagAttributes orig,
javax.faces.view.facelets.TagAttribute newAttr) |
javax.faces.view.facelets.TagAttributes |
copyTagAttributes(String id,
String... names)
Copies tag attributes with given names from the tag config, using given id as base for the id attribute.
|
javax.faces.view.facelets.TagAttribute |
createAttribute(String name,
String value)
Creates an attribute with given name and value.
|
javax.faces.view.facelets.TagAttribute |
createIdAttribute(String base)
Creates a unique id and returns corresponding attribute, using given string id as base.
|
String |
generateDevContainerId(String widgetName) |
String |
generateDevRegionId(String widgetName) |
String |
generateLayoutId(String layoutName) |
String |
generateMessageId(String widgetName) |
String |
generateUniqueId()
Returns a id unique within the facelet context.
|
String |
generateUniqueId(String base)
Returns a id unique within the facelet context using given id as base.
|
static String |
generateUniqueId(String base,
Map<String,Integer> counters)
Deprecated.
since 7.2, see
NuxeoLayoutIdManagerBean |
protected static String |
generateValidIdString(String base) |
String |
generateWidgetId(String widgetName) |
javax.faces.view.facelets.FaceletHandler |
getAliasTagHandler(String tagConfigId,
Map<String,javax.el.ValueExpression> variables,
List<String> blockedPatterns,
javax.faces.view.facelets.FaceletHandler nextHandler) |
javax.faces.view.facelets.ConverterHandler |
getConvertHandler(String tagConfigId,
javax.faces.view.facelets.TagAttributes attributes,
javax.faces.view.facelets.FaceletHandler nextHandler,
String converterId)
Returns a convert handler for this configuration.
|
javax.faces.view.facelets.ConverterHandler |
getConvertHandler(javax.faces.view.facelets.TagAttributes attributes,
javax.faces.view.facelets.FaceletHandler nextHandler,
String converterId)
Deprecated.
since 5.4.2, use
getConvertHandler(String, TagAttributes, FaceletHandler, String)
instead. |
javax.faces.view.facelets.FaceletHandler |
getDisableDevModeTagHandler(String tagConfigId,
javax.faces.view.facelets.FaceletHandler nextHandler) |
javax.faces.view.facelets.ComponentHandler |
getErrorComponentHandler(String errorMessage)
Deprecated.
since 5.4.2, use
getErrorComponentHandler(String, String) instead. |
javax.faces.view.facelets.ComponentHandler |
getErrorComponentHandler(String tagConfigId,
String errorMessage)
Component handler that displays an error on interface
|
javax.faces.view.facelets.ComponentHandler |
getHtmlComponentHandler(String tagConfigId,
javax.faces.view.facelets.TagAttributes attributes,
javax.faces.view.facelets.FaceletHandler nextHandler,
String componentType,
String rendererType)
Returns an html component handler for this configuration.
|
javax.faces.view.facelets.ComponentHandler |
getHtmlComponentHandler(javax.faces.view.facelets.TagAttributes attributes,
javax.faces.view.facelets.FaceletHandler nextHandler,
String componentType,
String rendererType)
Deprecated.
since 5.4.2, use
getHtmlComponentHandler(String, TagAttributes, FaceletHandler, String, String)
instead. |
javax.faces.view.facelets.ComponentHandler |
getMessageComponentHandler(String id,
String forId,
String styleClass)
Deprecated.
since 5.4.2, use
getMessageComponentHandler(String, String, String, String) instead. |
javax.faces.view.facelets.ComponentHandler |
getMessageComponentHandler(String tagConfigId,
String id,
String forId,
String styleClass)
Returns a message component handler with given attributes.
|
Map<String,Serializable> |
getSelectOptionProperties(WidgetSelectOption selectOption) |
static javax.faces.view.facelets.TagAttributes |
getTagAttributes(List<javax.faces.view.facelets.TagAttribute> attributes) |
List<javax.faces.view.facelets.TagAttribute> |
getTagAttributes(Map<String,Serializable> properties,
List<String> excludedProperties,
boolean useReferenceProperties,
String widgetType,
String widgetTypeCategory,
String widgetMode) |
javax.faces.view.facelets.TagAttributes |
getTagAttributes(String id,
Widget widget)
Creates tag attributes using given widget properties and field definitions.
|
static javax.faces.view.facelets.TagAttributes |
getTagAttributes(javax.faces.view.facelets.TagAttribute... attributes) |
javax.faces.view.facelets.TagAttributes |
getTagAttributes(Widget widget) |
javax.faces.view.facelets.TagAttributes |
getTagAttributes(Widget widget,
List<String> excludedProperties,
boolean bindFirstFieldDefinition) |
javax.faces.view.facelets.TagAttributes |
getTagAttributes(Widget widget,
List<String> excludedProperties,
boolean bindFirstFieldDefinition,
boolean defaultToValue)
Return tag attributes for this widget, including value mapping from field definitions and properties
|
javax.faces.view.facelets.TagAttributes |
getTagAttributes(WidgetSelectOption selectOption) |
javax.faces.view.facelets.TagAttributes |
getTagAttributes(WidgetSelectOption selectOption,
Map<String,Serializable> additionalProps) |
javax.faces.view.facelets.ValidatorHandler |
getValidateHandler(String tagConfigId,
javax.faces.view.facelets.TagAttributes attributes,
javax.faces.view.facelets.FaceletHandler nextHandler,
String validatorId)
Returns a validate handler for this configuration.
|
javax.faces.view.facelets.ValidatorHandler |
getValidateHandler(javax.faces.view.facelets.TagAttributes attributes,
javax.faces.view.facelets.FaceletHandler nextHandler,
String validatorId)
Deprecated.
since 5.4.2, use
getValidateHandler(String, TagAttributes, FaceletHandler, String)
instead. |
static boolean |
isDevModeEnabled(javax.faces.view.facelets.FaceletContext ctx) |
protected static NuxeoLayoutManagerBean |
lookupBean(javax.faces.context.FacesContext ctx) |
protected static NuxeoLayoutIdManagerBean |
lookupIdBean(javax.faces.context.FacesContext ctx) |
boolean |
shouldCreateReferenceAttribute(String key,
Serializable value)
Returns true if a reference tag attribute should be created for given property value.
|
protected static String |
stripUniqueIdBase(String base)
Strips given base of any ending counter that would conflict with potential already generated unique ids
|
public static final String LAYOUT_ID_PREFIX
public static final String WIDGET_ID_PREFIX
public static final String MESSAGE_ID_SUFFIX
public static final String DEV_CONTAINER_ID_SUFFIX
public static final String DEV_REGION_ID_SUFFIX
public static String DEV_MODE_DISABLED_VARIABLE
public static final String DIR_PROPERTY
public static final String DIR_AUTO
public FaceletHandlerHelper(javax.faces.view.facelets.FaceletContext context, javax.faces.view.facelets.TagConfig tagConfig)
public String generateUniqueId()
public String generateUniqueId(String base)
protected static NuxeoLayoutIdManagerBean lookupIdBean(javax.faces.context.FacesContext ctx)
protected static String stripUniqueIdBase(String base)
@Deprecated public static String generateUniqueId(String base, Map<String,Integer> counters)
NuxeoLayoutIdManagerBean
protected static String generateValidIdString(String base)
IllegalArgumentException
- if the given string is null or empty.public String generateWidgetId(String widgetName)
public String generateLayoutId(String layoutName)
public String generateMessageId(String widgetName)
public String generateDevRegionId(String widgetName)
public String generateDevContainerId(String widgetName)
public javax.faces.view.facelets.TagAttribute createIdAttribute(String base)
public javax.faces.view.facelets.TagAttribute createAttribute(String name, String value)
The attribute namespace is assumed to be empty.
public boolean shouldCreateReferenceAttribute(String key, Serializable value)
Reference tag attributes are using a non-literal EL expression so that this property value is not kept (cached) in the component on ajax refresh.
Of course property values already representing an expression cannot be mapped as is because they would need to be resolved twice.
Converters and validators cannot be referenced either because components expect corresponding value expressions
to resolve to a Converter
or Validator
instance (instead of the converter of validator id).
public static javax.faces.view.facelets.TagAttributes getTagAttributes(javax.faces.view.facelets.TagAttribute... attributes)
public static javax.faces.view.facelets.TagAttributes getTagAttributes(List<javax.faces.view.facelets.TagAttribute> attributes)
public static javax.faces.view.facelets.TagAttributes addTagAttribute(javax.faces.view.facelets.TagAttributes orig, javax.faces.view.facelets.TagAttribute newAttr)
public javax.faces.view.facelets.TagAttributes copyTagAttributes(String id, String... names)
public javax.faces.view.facelets.TagAttributes getTagAttributes(String id, Widget widget)
Assumes the "value" attribute has to be computed from the first field definition, using the "value" expression (see widget type tag handler exposed values).
public javax.faces.view.facelets.TagAttributes getTagAttributes(Widget widget)
public javax.faces.view.facelets.TagAttributes getTagAttributes(Widget widget, List<String> excludedProperties, boolean bindFirstFieldDefinition)
public javax.faces.view.facelets.TagAttributes getTagAttributes(Widget widget, List<String> excludedProperties, boolean bindFirstFieldDefinition, boolean defaultToValue)
widget
- the widget to generate tag attributes forexcludedProperties
- the properties to exclude from tag attributesbindFirstFieldDefinition
- if true, the first field definition will be bound to the tag attribute named
"value"defaultToValue
- if true, and there are no field definitions, tag attribute named "value" will be mapped to
the current widget value name (e.g the layout value in most cases, or the parent widget value if
widget is a sub widget)public List<javax.faces.view.facelets.TagAttribute> getTagAttributes(Map<String,Serializable> properties, List<String> excludedProperties, boolean useReferenceProperties, String widgetType, String widgetTypeCategory, String widgetMode)
public javax.faces.view.facelets.TagAttributes getTagAttributes(WidgetSelectOption selectOption, Map<String,Serializable> additionalProps)
public javax.faces.view.facelets.TagAttributes getTagAttributes(WidgetSelectOption selectOption)
public Map<String,Serializable> getSelectOptionProperties(WidgetSelectOption selectOption)
@Deprecated public javax.faces.view.facelets.ComponentHandler getHtmlComponentHandler(javax.faces.view.facelets.TagAttributes attributes, javax.faces.view.facelets.FaceletHandler nextHandler, String componentType, String rendererType)
getHtmlComponentHandler(String, TagAttributes, FaceletHandler, String, String)
instead.public javax.faces.view.facelets.ComponentHandler getHtmlComponentHandler(String tagConfigId, javax.faces.view.facelets.TagAttributes attributes, javax.faces.view.facelets.FaceletHandler nextHandler, String componentType, String rendererType)
Next handler cannot be null, use LeafFaceletHandler
if no next
handler is needed.
@Deprecated public javax.faces.view.facelets.ComponentHandler getErrorComponentHandler(String errorMessage)
getErrorComponentHandler(String, String)
instead.public javax.faces.view.facelets.ComponentHandler getErrorComponentHandler(String tagConfigId, String errorMessage)
@Deprecated public javax.faces.view.facelets.ConverterHandler getConvertHandler(javax.faces.view.facelets.TagAttributes attributes, javax.faces.view.facelets.FaceletHandler nextHandler, String converterId)
getConvertHandler(String, TagAttributes, FaceletHandler, String)
instead.public javax.faces.view.facelets.ConverterHandler getConvertHandler(String tagConfigId, javax.faces.view.facelets.TagAttributes attributes, javax.faces.view.facelets.FaceletHandler nextHandler, String converterId)
Next handler cannot be null, use LeafFaceletHandler
if no next
handler is needed.
@Deprecated public javax.faces.view.facelets.ValidatorHandler getValidateHandler(javax.faces.view.facelets.TagAttributes attributes, javax.faces.view.facelets.FaceletHandler nextHandler, String validatorId)
getValidateHandler(String, TagAttributes, FaceletHandler, String)
instead.public javax.faces.view.facelets.ValidatorHandler getValidateHandler(String tagConfigId, javax.faces.view.facelets.TagAttributes attributes, javax.faces.view.facelets.FaceletHandler nextHandler, String validatorId)
Next handler cannot be null, use LeafFaceletHandler
if no next
handler is needed.
@Deprecated public javax.faces.view.facelets.ComponentHandler getMessageComponentHandler(String id, String forId, String styleClass)
getMessageComponentHandler(String, String, String, String)
instead.public javax.faces.view.facelets.ComponentHandler getMessageComponentHandler(String tagConfigId, String id, String forId, String styleClass)
Uses component type "javax.faces.HtmlMessage" and renderer type "javax.faces.Message".
public javax.faces.view.facelets.FaceletHandler getAliasTagHandler(String tagConfigId, Map<String,javax.el.ValueExpression> variables, List<String> blockedPatterns, javax.faces.view.facelets.FaceletHandler nextHandler)
public static boolean isDevModeEnabled(javax.faces.view.facelets.FaceletContext ctx)
protected static NuxeoLayoutManagerBean lookupBean(javax.faces.context.FacesContext ctx)
public javax.faces.view.facelets.FaceletHandler getDisableDevModeTagHandler(String tagConfigId, javax.faces.view.facelets.FaceletHandler nextHandler)
Copyright © 2015 Nuxeo SA. All rights reserved.