java.lang.Object
com.sun.facelets.tag.TagHandler
com.sun.facelets.tag.MetaTagHandler
com.sun.facelets.tag.jsf.ComponentHandler
- All Implemented Interfaces:
- com.sun.facelets.FaceletHandler
- public class ComponentHandler
- extends com.sun.facelets.tag.MetaTagHandler
Implementation of the tag logic used in the JSF specification. This is your
golden hammer for wiring UIComponents to Facelets.
- Version:
- $Id: ComponentHandler.java,v 1.14 2006/03/29 15:01:22 jhook Exp $
|
Method Summary |
void |
apply(com.sun.facelets.FaceletContext ctx,
javax.faces.component.UIComponent parent)
Method handles UIComponent tree creation in accordance with the JSF 1.2
spec. |
protected void |
applyNextHandler(com.sun.facelets.FaceletContext ctx,
javax.faces.component.UIComponent c)
|
protected javax.faces.component.UIComponent |
createComponent(com.sun.facelets.FaceletContext ctx)
If the binding attribute was specified, use that in conjuction with our
componentType String variable to call createComponent on the Application,
otherwise just pass the componentType String. |
protected com.sun.facelets.tag.MetaRuleset |
createMetaRuleset(java.lang.Class type)
Extend this method in order to add your own rules. |
protected java.lang.String |
getId(com.sun.facelets.FaceletContext ctx)
If the id TagAttribute was specified, get it's value, otherwise generate
a unique id from our tagId. |
protected void |
onComponentCreated(com.sun.facelets.FaceletContext ctx,
javax.faces.component.UIComponent c,
javax.faces.component.UIComponent parent)
A hook method for allowing developers to do additional processing once Facelets
creates the component. |
protected void |
onComponentPopulated(com.sun.facelets.FaceletContext ctx,
javax.faces.component.UIComponent c,
javax.faces.component.UIComponent parent)
|
log
private static final java.util.logging.Logger log
binding
private final com.sun.facelets.tag.TagAttribute binding
componentType
private final java.lang.String componentType
id
private final com.sun.facelets.tag.TagAttribute id
rendererType
private final java.lang.String rendererType
ComponentHandler
public ComponentHandler(ComponentConfig config)
apply
public final void apply(com.sun.facelets.FaceletContext ctx,
javax.faces.component.UIComponent parent)
throws java.io.IOException,
javax.faces.FacesException,
ELException
- Method handles UIComponent tree creation in accordance with the JSF 1.2
spec.
- First determines this UIComponent's id by calling
getId(FaceletContext) 55 .
- Search the parent for an existing UIComponent of the id we just
grabbed
- If found, mark its children
for deletion.
- If not found, call
createComponent 55 .
- Only here do we apply
attributes
- Set the UIComponent's id
- Set the RendererType of this instance
- Now apply the nextHandler, passing the UIComponent we've
created/found.
- Now add the UIComponent to the passed parent
- Lastly, if the UIComponent already existed (found), then
finalize for deletion.
createComponent
protected javax.faces.component.UIComponent createComponent(com.sun.facelets.FaceletContext ctx)
- If the binding attribute was specified, use that in conjuction with our
componentType String variable to call createComponent on the Application,
otherwise just pass the componentType String.
If the binding was used, then set the ValueExpression "binding" on the
created UIComponent.
getId
protected java.lang.String getId(com.sun.facelets.FaceletContext ctx)
- If the id TagAttribute was specified, get it's value, otherwise generate
a unique id from our tagId.
createMetaRuleset
protected com.sun.facelets.tag.MetaRuleset createMetaRuleset(java.lang.Class type)
- Description copied from class:
com.sun.facelets.tag.MetaTagHandler
- Extend this method in order to add your own rules.
onComponentCreated
protected void onComponentCreated(com.sun.facelets.FaceletContext ctx,
javax.faces.component.UIComponent c,
javax.faces.component.UIComponent parent)
- A hook method for allowing developers to do additional processing once Facelets
creates the component. The 'setAttributes' method is still perferred, but this
method will provide the parent UIComponent before it's been added to the tree and
before any children have been added to the newly created UIComponent.
onComponentPopulated
protected void onComponentPopulated(com.sun.facelets.FaceletContext ctx,
javax.faces.component.UIComponent c,
javax.faces.component.UIComponent parent)
applyNextHandler
protected void applyNextHandler(com.sun.facelets.FaceletContext ctx,
javax.faces.component.UIComponent c)
throws java.io.IOException,
javax.faces.FacesException,
ELException