|
||||||||||
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.descriptors.LayoutElementBase
com.sun.rave.web.ui.component.util.descriptors.LayoutComponent
public class LayoutComponent
This class defines a LayoutComponent. A LayoutComponent describes a
UIComponent to be instantiated. The method getType()
provides
a ComponentType
descriptor that is capable of providing a
ComponentFactory
to
perform the actual instantiation. This class also stores properties
and facets (children) to be set on a newly instantiated instance.
Field Summary | |
---|---|
static java.lang.String |
AFTER_CREATE
This is the "type" for handlers to be invoked to handle "afterCreate" functionality for this element. |
static java.lang.String |
BEFORE_CREATE
This is the "type" for handlers to be invoked to handle "beforeCreate" functionality for this element. |
static java.lang.String |
FACET_NAME
This defines the property key for specifying the facet name in which the component should be stored under in its parent UIComponent. |
Fields inherited from class com.sun.rave.web.ui.component.util.descriptors.LayoutElementBase |
---|
AFTER_ENCODE, BEFORE_ENCODE, ENCODE |
Constructor Summary | |
---|---|
LayoutComponent(LayoutElement parent,
java.lang.String id,
ComponentType type)
Constructor. |
Method Summary | |
---|---|
void |
addChildLayoutElement(LayoutElement element)
This method overrides LayoutElementBase.addChildLayoutElement(). |
void |
addOption(java.lang.String name,
java.lang.Object value)
This method adds an option to the LayoutComponent. |
void |
addOptions(java.util.Map map)
This method adds all the options in the given Map to the LayoutComponent. |
java.lang.Object |
afterCreate(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
This method is invoked after the Component described by this LayoutComponent is created. |
java.lang.Object |
beforeCreate(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent parent)
This method is invoked before the Component described by this LayoutComponent is created. |
boolean |
containsOption(java.lang.String name)
This method returns true/false based on whether the given option name has been set. |
protected boolean |
encodeThis(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
This method allows each LayoutElement to provide it's own encode functionality. |
javax.faces.component.UIComponent |
getChild(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent parent)
This method will find or create a UIComponent as
described by this LayoutComponent descriptor. |
java.lang.Object |
getEvaluatedOption(javax.faces.context.FacesContext ctx,
java.lang.String name,
javax.faces.component.UIComponent component)
Accessor method for an option. |
java.lang.Object |
getOption(java.lang.String name)
Accessor method for an option. |
java.util.Map |
getOptions()
This method returns the options as a Map. |
ComponentType |
getType()
Accessor for type. |
boolean |
isFacetChild()
This method returns true if the child should be added to the parent component as a facet. |
boolean |
isOverwrite()
Determines if this component should be created even if there is already an existing UIComponent . |
void |
setFacetChild(boolean facetChild)
This method sets whether the child UIComponent should
be set as a facet or a real child. |
void |
setOptions(java.util.Map options)
This method sets the Map of options. |
void |
setOverwrite(boolean value)
Determines if this component should be created even if there is already an existing UIComponent . |
Methods inherited from class com.sun.rave.web.ui.component.util.descriptors.LayoutElementBase |
---|
createHandlerContext, dispatchHandlers, dispatchHandlers, encode, encodeChild, getChildLayoutElements, getHandlers, getHandlers, getHandlersByTypeMap, getId, getLayoutDefinition, getParent, getUnevaluatedId, resolveValue, setHandlers, setHandlersByTypeMap, setParent |
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.descriptors.LayoutElement |
---|
dispatchHandlers, dispatchHandlers, encode, getChildLayoutElements, getHandlers, getId, getLayoutDefinition, getParent, getUnevaluatedId, setHandlers |
Field Detail |
---|
public static final java.lang.String AFTER_CREATE
This is the "type" for handlers to be invoked to handle "afterCreate" functionality for this element.
public static final java.lang.String BEFORE_CREATE
This is the "type" for handlers to be invoked to handle "beforeCreate" functionality for this element.
public static final java.lang.String FACET_NAME
This defines the property key for specifying the facet name in which the component should be stored under in its parent UIComponent.
Constructor Detail |
---|
public LayoutComponent(LayoutElement parent, java.lang.String id, ComponentType type)
Constructor.
Method Detail |
---|
public ComponentType getType()
Accessor for type.
public void setOverwrite(boolean value)
Determines if this component should be created even if there is
already an existing UIComponent
. It will "overwrite"
the existing component if this property is true.
public boolean isOverwrite()
Determines if this component should be created even if there is
already an existing UIComponent
. It will "overwrite"
the existing component if this property is true.
public void addChildLayoutElement(LayoutElement element)
This method overrides LayoutElementBase.addChildLayoutElement(). Child LayoutElements for LayoutComponent are limited to LayoutFacet objects. This method ensures that only LayoutFacet objects are added. If any other types are added, an IllegalArgumentException will be thrown.
addChildLayoutElement
in interface LayoutElement
addChildLayoutElement
in class LayoutElementBase
element
- The LayoutElement to add.
java.lang.IllegalArgumentException
- Thrown if LayoutElement is not a
LayoutFacetpublic void addOption(java.lang.String name, java.lang.Object value)
This method adds an option to the LayoutComponent. Options may be useful in constructing the LayoutComponent.
name
- The name of the optionvalue
- The value of the option (may be List or String)public void addOptions(java.util.Map map)
This method adds all the options in the given Map to the LayoutComponent. Options may be useful in constructing the LayoutComponent.
map
- The map of options to add.public java.lang.Object getOption(java.lang.String name)
Accessor method for an option. This method does not evaluate expressions.
name
- The option name to retrieve.
getEvaluatedOption(FacesContext, String, UIComponent)
public java.lang.Object getEvaluatedOption(javax.faces.context.FacesContext ctx, java.lang.String name, javax.faces.component.UIComponent component)
Accessor method for an option. This method evaluates our own expressions (not JSF expressions).
name
- The option name to retrievectx
- The FacesContextcomponent
- The UIComponent (may be null)
getOption(String)
public boolean containsOption(java.lang.String name)
This method returns true/false based on whether the given option name has been set.
name
- The option name to look for.
public void setOptions(java.util.Map options)
This method sets the Map of options.
options
- Map of options.public java.util.Map getOptions()
This method returns the options as a Map. This method does not evaluate expressions.
protected boolean encodeThis(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component) throws java.io.IOException
This method allows each LayoutElement to provide it's own encode functionality. If the LayoutComponent should render its children, this method should return true. Otherwise, this method should return false.
encodeThis
in class LayoutElementBase
context
- The FacesContextcomponent
- The UIComponent
java.io.IOException
public javax.faces.component.UIComponent getChild(javax.faces.context.FacesContext context, javax.faces.component.UIComponent parent) throws java.io.IOException
This method will find or create a UIComponent
as
described by this LayoutComponent
descriptor. If the
component already exists as a child or facet, it will be returned.
If it creates a new UIComponent
, it will typically be
added to the given parent UIComponent
as a facet (this
actually depends on the factory that instantiates the
UIComponent
).
context
- The FacesContext
parent
- The UIComponent
to serve as the parent to
search and to store the new UIComponent
.
UIComponent
requested (found or newly created)
java.io.IOException
public java.lang.Object beforeCreate(javax.faces.context.FacesContext context, javax.faces.component.UIComponent parent)
This method is invoked before the Component described by this LayoutComponent is created. This allows handlers registered for "beforeCreate" functionality to be invoked.
context
- The FacesContext
public java.lang.Object afterCreate(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
This method is invoked after the Component described by this LayoutComponent is created. This allows handlers registered for "afterCreate" functionality to be invoked.
context
- The FacesContext
public boolean isFacetChild()
This method returns true if the child should be added to the parent component as a facet. Otherwise, it returns false indicating that it should exist as a real child. The default is true.
public void setFacetChild(boolean facetChild)
This method sets whether the child UIComponent
should
be set as a facet or a real child.
facetChild
- True if the child UIComponent
should
be added as a facet.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |