com.sun.rave.web.ui.component
Class TemplateComponentBase

java.lang.Object
  extended byjavax.faces.component.UIComponent
      extended byjavax.faces.component.UIComponentBase
          extended bycom.sun.rave.web.ui.component.TemplateComponentBase
All Implemented Interfaces:
ChildManager, javax.faces.component.NamingContainer, javax.faces.component.StateHolder, TemplateComponent
Direct Known Subclasses:
PropertyBase, PropertySheetBase, PropertySheetSectionBase, TreeNodeBase

public abstract class TemplateComponentBase
extends javax.faces.component.UIComponentBase
implements TemplateComponent

This abstract class provides base functionality for components that work in conjunction with the TemplateRenderer. It provides a default implementation of the TemplateComponent interface.

Author:
Ken Paulsen (ken.paulsen@sun.com)
See Also:
TemplateRenderer, TemplateComponent

Field Summary
 
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
 
Constructor Summary
TemplateComponentBase()
           
 
Method Summary
 javax.faces.component.UIComponent getChild(javax.faces.context.FacesContext context, com.sun.rave.web.ui.component.util.descriptors.LayoutComponent descriptor)
          This method will find the request child UIComponent by id (the id is obtained from the given LayoutComponent).
 javax.faces.component.UIComponent getChild(javax.faces.context.FacesContext context, java.lang.String id)
          This method will find the request child UIComponent by id.
 com.sun.rave.web.ui.component.util.descriptors.LayoutDefinition getLayoutDefinition(javax.faces.context.FacesContext context)
          This method returns the LayoutDefinition associated with this component.
 java.lang.String getLayoutDefinitionKey()
          This method returns the LayoutDefinitionKey for this component.
 void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
          This method restores the state for this component.
 java.lang.Object saveState(javax.faces.context.FacesContext context)
          This method saves the state for this component.
 void setLayoutDefinitionKey(java.lang.String key)
          This method sets the LayoutDefinition key for this component.
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
 
Methods inherited from class javax.faces.component.UIComponent
getFamily
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplateComponentBase

public TemplateComponentBase()
Method Detail

getChild

public javax.faces.component.UIComponent getChild(javax.faces.context.FacesContext context,
                                                  java.lang.String id)
This method will find the request child UIComponent by id. If it is not found, it will attempt to create it if it can find a LayoutElement describing it.

Specified by:
getChild in interface TemplateComponent
Parameters:
context - The FacesContext
id - The UIComponent id to search for
Returns:
The requested UIComponent

getChild

public javax.faces.component.UIComponent getChild(javax.faces.context.FacesContext context,
                                                  com.sun.rave.web.ui.component.util.descriptors.LayoutComponent descriptor)
This method will find the request child UIComponent by id (the id is obtained from the given LayoutComponent). If it is not found, it will attempt to create it from the supplied LayoutElement.

Specified by:
getChild in interface ChildManager
Parameters:
descriptor - The LayoutElement describing the UIComponent
context - FacesContext
Returns:
The requested UIComponent

getLayoutDefinition

public com.sun.rave.web.ui.component.util.descriptors.LayoutDefinition getLayoutDefinition(javax.faces.context.FacesContext context)
This method returns the LayoutDefinition associated with this component.

Specified by:
getLayoutDefinition in interface TemplateComponent
Parameters:
context - The FacesContext
Returns:
LayoutDefinition associated with this component.

saveState

public java.lang.Object saveState(javax.faces.context.FacesContext context)
This method saves the state for this component. It relies on the super class to save its own sate, this method will invoke super.saveState().

Specified by:
saveState in interface javax.faces.component.StateHolder
Parameters:
context - The FacesContext
Returns:
The serialized State

restoreState

public void restoreState(javax.faces.context.FacesContext context,
                         java.lang.Object state)
This method restores the state for this component. It will invoke the super class to restore its state.

Specified by:
restoreState in interface javax.faces.component.StateHolder
Parameters:
context - The FacesContext
state - The serialized State

getLayoutDefinitionKey

public java.lang.String getLayoutDefinitionKey()
This method returns the LayoutDefinitionKey for this component.

Specified by:
getLayoutDefinitionKey in interface TemplateComponent
Returns:
key The key to use in the LayoutDefinitionManager

setLayoutDefinitionKey

public void setLayoutDefinitionKey(java.lang.String key)
This method sets the LayoutDefinition key for this component.

Specified by:
setLayoutDefinitionKey in interface TemplateComponent
Parameters:
key - The key to use in the LayoutDefinitionManager