|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.rave.web.ui.component.util.factories.ComponentFactoryBase
public abstract class ComponentFactoryBase
This abstract class provides common functionality for UIComponent factories.
Constructor Summary | |
---|---|
ComponentFactoryBase()
|
Method Summary | |
---|---|
protected void |
addChild(javax.faces.context.FacesContext context,
LayoutComponent descriptor,
javax.faces.component.UIComponent parent,
javax.faces.component.UIComponent child)
This method associates the given child with the given parent. |
protected java.lang.Object |
getEvaluatedOption(javax.faces.context.FacesContext context,
LayoutComponent desc,
javax.faces.component.UIComponent parent,
java.lang.String key,
boolean required)
Deprecated. I *think* only the LayoutComponent version of this should be used... |
protected void |
setOptions(javax.faces.context.FacesContext context,
LayoutComponent desc,
javax.faces.component.UIComponent comp)
This method iterates through the Map of options. |
protected void |
storeInstanceHandlers(LayoutComponent desc,
javax.faces.component.UIComponent comp)
This method is responsible for interating over the "instance" handlers and applying them to the UIComponent. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.sun.rave.web.ui.component.util.factories.ComponentFactory |
---|
create |
Constructor Detail |
---|
public ComponentFactoryBase()
Method Detail |
---|
protected void setOptions(javax.faces.context.FacesContext context, LayoutComponent desc, javax.faces.component.UIComponent comp)
This method iterates through the Map of options. It looks at each one, if it contians an EL expression, it sets a value binding. Otherwise, it calls setAttribute() on the component (which in turn will invoke the bean setter if there is one).
This method also interates through the child LayoutElement
s
of the given LayoutComponent
descriptor and adds Facets or
children as appropriate.
context
- The FacesContext
desc
- The LayoutComponent
descriptor associated with
the requested UIComponent
.comp
- The UIComponent
protected void storeInstanceHandlers(LayoutComponent desc, javax.faces.component.UIComponent comp)
This method is responsible for interating over the "instance"
handlers and applying them to the UIComponent. An "instance"
handler is one that is defined outside a renderer, or a
nested component within a renderer. In other words, a handler
that would not get fired by the TemplateRenderer. By passing this
in via the UIComponent, code that is aware of events (see
LayoutElementBase
)
may find these events and fire them. These may vary per "instance"
of a particular component (i.e. TreeNode
) unlike the
handlers defined in a TemplateRender's XML (which are shared and
therefor should not change dynamically).
desc
- The descriptor potentially containing handlers to copy.comp
- The UIComponent instance to store the handlers.protected void addChild(javax.faces.context.FacesContext context, LayoutComponent descriptor, javax.faces.component.UIComponent parent, javax.faces.component.UIComponent child)
This method associates the given child with the given parent. By using this method we centralize the code so that if we decide later to add it as a real child it can be done in one place.
context
- The FacesContext
descriptor
- The LayoutComponent
descriptor associated
with the requested UIComponent
.parent
- The parent UIComponent
child
- The child UIComponent
protected java.lang.Object getEvaluatedOption(javax.faces.context.FacesContext context, LayoutComponent desc, javax.faces.component.UIComponent parent, java.lang.String key, boolean required)
This method is to be used by subclasses to retrieve a pre-evalated option by name. Since this is in the context of a factory, these options usually needed during the creation of the UIComponent. Therefor the parent UIComponent is typically passed in because of the lack of existence of the child UIComponent.
This method does not currently resolve #{} expressions.
context
- The FacesContextdesc
- The LayoutComponent descriptor holding the optionsparent
- Usually the parent UIComponent, only used when
resolving $...{...} expressionskey
- The option name to pull from desc
required
- A flag indicating if a value for the property must
exist. If true and the property value is null, an
IllegalArgumentException will be thrown.
java.lang.IllegalArgumentException
- Thrown if property is required but
has a null value (or not found).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |