public final class FaceletHandlerHelper extends Object
Helps generating custom tag handlers and custom tag attributes.
Modifier and Type | Field and Description |
---|---|
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.
|
String |
generateValidIdString(String base) |
String |
generateWidgetId(String widgetName) |
com.sun.facelets.FaceletHandler |
getAliasTagHandler(Map<String,ValueExpression> variables,
com.sun.facelets.FaceletHandler nextHandler)
Deprecated.
since 5.4.2, use
getAliasTagHandler(String, Map, FaceletHandler)
instead. |
com.sun.facelets.FaceletHandler |
getAliasTagHandler(String tagConfigId,
Map<String,ValueExpression> variables,
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,
boolean useReferenceProperties) |
List<com.sun.facelets.tag.TagAttribute> |
getTagAttributes(Map<String,Serializable> properties,
List<String> excludedProperties,
boolean useReferenceProperties) |
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(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 FaceletHandlerHelper(com.sun.facelets.FaceletContext context, com.sun.facelets.tag.TagConfig tagConfig)
public String generateUniqueId()
public String generateUniqueId(String base)
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, List<String> excludedProperties, boolean bindFirstFieldDefinition)
public com.sun.facelets.tag.TagAttributes getTagAttributes(Widget widget)
public List<com.sun.facelets.tag.TagAttribute> getTagAttributes(Map<String,Serializable> properties, List<String> excludedProperties, boolean useReferenceProperties)
public List<com.sun.facelets.tag.TagAttribute> getTagAttributes(Map<String,Serializable> properties, boolean useReferenceProperties)
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".
@Deprecated public com.sun.facelets.FaceletHandler getAliasTagHandler(Map<String,ValueExpression> variables, com.sun.facelets.FaceletHandler nextHandler)
getAliasTagHandler(String, Map, FaceletHandler)
instead.public com.sun.facelets.FaceletHandler getAliasTagHandler(String tagConfigId, Map<String,ValueExpression> variables, com.sun.facelets.FaceletHandler nextHandler)
Copyright © 2011 Nuxeo SA. All Rights Reserved.