com.sun.rave.web.ui.component.util.descriptors
Class LayoutFacet

java.lang.Object
  extended by com.sun.rave.web.ui.component.util.descriptors.LayoutElementBase
      extended by com.sun.rave.web.ui.component.util.descriptors.LayoutFacet
All Implemented Interfaces:
LayoutElement, java.io.Serializable

public class LayoutFacet
extends LayoutElementBase
implements LayoutElement

This class defines the descriptor for LayoutFacet. A LayoutFacet descriptor provides information needed to attempt to obtain a Facet from the UIComponent. If the Facet doesn't exist, it also has the opportunity to provide a "default" in place of the facet.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.sun.rave.web.ui.component.util.descriptors.LayoutElementBase
AFTER_ENCODE, BEFORE_ENCODE, ENCODE
 
Constructor Summary
LayoutFacet(LayoutElement parent, java.lang.String id)
          Constructor
 
Method Summary
protected  boolean encodeThis(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
          This method looks for the facet on the component.
 boolean isRendered()
           Returns whether this LayoutFacet should be rendered.
 void setRendered(boolean render)
           
 
Methods inherited from class com.sun.rave.web.ui.component.util.descriptors.LayoutElementBase
addChildLayoutElement, 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
addChildLayoutElement, dispatchHandlers, dispatchHandlers, encode, getChildLayoutElements, getHandlers, getId, getLayoutDefinition, getParent, getUnevaluatedId, setHandlers
 

Constructor Detail

LayoutFacet

public LayoutFacet(LayoutElement parent,
                   java.lang.String id)
Constructor

Method Detail

isRendered

public boolean isRendered()

Returns whether this LayoutFacet should be rendered. When this component is used to specify an actual facet (i.e. specifies a UIComponent), it should not be rendred. When it defines a place holder for a facet, then it should be rendered.

Returns:
true if encodeThis(FacesContext, UIComponent) should execute

setRendered

public void setRendered(boolean render)

encodeThis

protected boolean encodeThis(javax.faces.context.FacesContext context,
                             javax.faces.component.UIComponent component)
                      throws java.io.IOException

This method looks for the facet on the component. If found, it renders it and returns false (so children will not be rendered). If not found, it returns true so that children will be rendered. Children of a LayoutFacet represent the default value for the Facet.

Specified by:
encodeThis in class LayoutElementBase
Parameters:
context - The FacesContext
parent - The parent UIComponent
Returns:
true if children are to be rendered, false otherwise.
Throws:
java.io.IOException