public final class FaceletHandlerHelper extends Object
Helps generating custom tag handlers and custom tag attributes.
Modifier and Type | Field and Description |
---|---|
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(com.sun.facelets.FaceletContext context,
com.sun.facelets.tag.TagConfig tagConfig) |
Modifier and Type | Method and Description |
---|---|
static com.sun.facelets.tag.TagAttributes |
addTagAttribute(com.sun.facelets.tag.TagAttributes orig,
com.sun.facelets.tag.TagAttribute newAttr) |
com.sun.facelets.tag.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.
|
com.sun.facelets.tag.TagAttribute |
createAttribute(String name,
String value)
Creates an attribute with given name and value.
|
com.sun.facelets.tag.TagAttribute |
createIdAttribute(String base)
Creates a unique id and returns corresponding attribute, using given
string id as base.
|
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)
Generates a unique id from counters persisted in given map
|
String |
generateWidgetId(String widgetName) |
com.sun.facelets.FaceletHandler |
getAliasTagHandler(String tagConfigId,
Map<String,ValueExpression> variables,
List<String> blockedPatterns,
com.sun.facelets.FaceletHandler nextHandler) |
com.sun.facelets.tag.jsf.ConvertHandler |
getConvertHandler(String tagConfigId,
com.sun.facelets.tag.TagAttributes attributes,
com.sun.facelets.FaceletHandler nextHandler,
String converterId)
Returns a convert handler for this configuration.
|
com.sun.facelets.tag.jsf.ConvertHandler |
getConvertHandler(com.sun.facelets.tag.TagAttributes attributes,
com.sun.facelets.FaceletHandler nextHandler,
String converterId)
Deprecated.
since 5.4.2, use
getConvertHandler(String, TagAttributes, FaceletHandler, String)
instead. |
com.sun.facelets.tag.jsf.ComponentHandler |
getErrorComponentHandler(String errorMessage)
Deprecated.
since 5.4.2, use
getErrorComponentHandler(String, String)
instead. |
com.sun.facelets.tag.jsf.ComponentHandler |
getErrorComponentHandler(String tagConfigId,
String errorMessage)
Component handler that displays an error on interface
|
com.sun.facelets.tag.jsf.ComponentHandler |
getHtmlComponentHandler(String tagConfigId,
com.sun.facelets.tag.TagAttributes attributes,
com.sun.facelets.FaceletHandler nextHandler,
String componentType,
String rendererType)
Returns an html component handler for this configuration.
|
com.sun.facelets.tag.jsf.ComponentHandler |
getHtmlComponentHandler(com.sun.facelets.tag.TagAttributes attributes,
com.sun.facelets.FaceletHandler nextHandler,
String componentType,
String rendererType)
Deprecated.
since 5.4.2, use
getHtmlComponentHandler(String, TagAttributes, FaceletHandler, String, String)
instead. |
com.sun.facelets.tag.jsf.ComponentHandler |
getMessageComponentHandler(String id,
String forId,
String styleClass)
Deprecated.
since 5.4.2, use
getMessageComponentHandler(String, String, String, String)
instead. |
com.sun.facelets.tag.jsf.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 com.sun.facelets.tag.TagAttributes |
getTagAttributes(List<com.sun.facelets.tag.TagAttribute> attributes) |
List<com.sun.facelets.tag.TagAttribute> |
getTagAttributes(Map<String,Serializable> properties,
List<String> excludedProperties,
boolean useReferenceProperties,
String widgetType,
String widgetTypeCategory,
String widgetMode) |
com.sun.facelets.tag.TagAttributes |
getTagAttributes(String id,
Widget widget)
Creates tag attributes using given widget properties and field
definitions.
|
static com.sun.facelets.tag.TagAttributes |
getTagAttributes(com.sun.facelets.tag.TagAttribute... attributes) |
com.sun.facelets.tag.TagAttributes |
getTagAttributes(Widget widget) |
com.sun.facelets.tag.TagAttributes |
getTagAttributes(Widget widget,
List<String> excludedProperties,
boolean bindFirstFieldDefinition) |
com.sun.facelets.tag.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
|
com.sun.facelets.tag.TagAttributes |
getTagAttributes(WidgetSelectOption selectOption) |
com.sun.facelets.tag.jsf.ValidateHandler |
getValidateHandler(String tagConfigId,
com.sun.facelets.tag.TagAttributes attributes,
com.sun.facelets.FaceletHandler nextHandler,
String validatorId)
Returns a validate handler for this configuration.
|
com.sun.facelets.tag.jsf.ValidateHandler |
getValidateHandler(com.sun.facelets.tag.TagAttributes attributes,
com.sun.facelets.FaceletHandler nextHandler,
String validatorId)
Deprecated.
since 5.4.2, use
getValidateHandler(String, TagAttributes, FaceletHandler, String)
instead. |
boolean |
shouldCreateReferenceAttribute(String key,
Serializable value)
Returns true if a reference tag attribute should be created for given
property value.
|
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 DIR_PROPERTY
public static final String DIR_AUTO
public FaceletHandlerHelper(com.sun.facelets.FaceletContext context, com.sun.facelets.tag.TagConfig tagConfig)
public String generateUniqueId()
public String generateUniqueId(String base)
public static String generateUniqueId(String base, Map<String,Integer> counters)
public com.sun.facelets.tag.TagAttribute createIdAttribute(String base)
public com.sun.facelets.tag.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 com.sun.facelets.tag.TagAttributes getTagAttributes(com.sun.facelets.tag.TagAttribute... attributes)
public static com.sun.facelets.tag.TagAttributes getTagAttributes(List<com.sun.facelets.tag.TagAttribute> attributes)
public static com.sun.facelets.tag.TagAttributes addTagAttribute(com.sun.facelets.tag.TagAttributes orig, com.sun.facelets.tag.TagAttribute newAttr)
public com.sun.facelets.tag.TagAttributes copyTagAttributes(String id, String... names)
public com.sun.facelets.tag.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 com.sun.facelets.tag.TagAttributes getTagAttributes(Widget widget)
public com.sun.facelets.tag.TagAttributes getTagAttributes(Widget widget, List<String> excludedProperties, boolean bindFirstFieldDefinition)
public com.sun.facelets.tag.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<com.sun.facelets.tag.TagAttribute> getTagAttributes(Map<String,Serializable> properties, List<String> excludedProperties, boolean useReferenceProperties, String widgetType, String widgetTypeCategory, String widgetMode)
public com.sun.facelets.tag.TagAttributes getTagAttributes(WidgetSelectOption selectOption)
public Map<String,Serializable> getSelectOptionProperties(WidgetSelectOption selectOption)
@Deprecated public com.sun.facelets.tag.jsf.ComponentHandler getHtmlComponentHandler(com.sun.facelets.tag.TagAttributes attributes, com.sun.facelets.FaceletHandler nextHandler, String componentType, String rendererType)
getHtmlComponentHandler(String, TagAttributes, FaceletHandler, String, String)
instead.public com.sun.facelets.tag.jsf.ComponentHandler getHtmlComponentHandler(String tagConfigId, com.sun.facelets.tag.TagAttributes attributes, com.sun.facelets.FaceletHandler nextHandler, String componentType, String rendererType)
Next handler cannot be null, use LeafFaceletHandler
if no next
handler is needed.
@Deprecated public com.sun.facelets.tag.jsf.ComponentHandler getErrorComponentHandler(String errorMessage)
getErrorComponentHandler(String, String)
instead.public com.sun.facelets.tag.jsf.ComponentHandler getErrorComponentHandler(String tagConfigId, String errorMessage)
@Deprecated public com.sun.facelets.tag.jsf.ConvertHandler getConvertHandler(com.sun.facelets.tag.TagAttributes attributes, com.sun.facelets.FaceletHandler nextHandler, String converterId)
getConvertHandler(String, TagAttributes, FaceletHandler, String)
instead.public com.sun.facelets.tag.jsf.ConvertHandler getConvertHandler(String tagConfigId, com.sun.facelets.tag.TagAttributes attributes, com.sun.facelets.FaceletHandler nextHandler, String converterId)
Next handler cannot be null, use LeafFaceletHandler
if no next
handler is needed.
@Deprecated public com.sun.facelets.tag.jsf.ValidateHandler getValidateHandler(com.sun.facelets.tag.TagAttributes attributes, com.sun.facelets.FaceletHandler nextHandler, String validatorId)
getValidateHandler(String, TagAttributes, FaceletHandler, String)
instead.public com.sun.facelets.tag.jsf.ValidateHandler getValidateHandler(String tagConfigId, com.sun.facelets.tag.TagAttributes attributes, com.sun.facelets.FaceletHandler nextHandler, String validatorId)
Next handler cannot be null, use LeafFaceletHandler
if no next
handler is needed.
@Deprecated public com.sun.facelets.tag.jsf.ComponentHandler getMessageComponentHandler(String id, String forId, String styleClass)
getMessageComponentHandler(String, String, String, String)
instead.public com.sun.facelets.tag.jsf.ComponentHandler getMessageComponentHandler(String tagConfigId, String id, String forId, String styleClass)
Uses component type "javax.faces.HtmlMessage" and renderer type "javax.faces.Message".
Copyright © 2014 Nuxeo SA. All Rights Reserved.