com.sun.rave.web.ui.component.util.descriptors
Interface LayoutElement

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
LayoutAttribute, LayoutComponent, LayoutDefinition, LayoutElementBase, LayoutFacet, LayoutForEach, LayoutIf, LayoutMarkup, LayoutStaticText, LayoutWhile

public interface LayoutElement
extends java.io.Serializable

This interface is declares the methods required to be a LayoutElement. A LayoutElement is the building block of the tree structure which defines a layout for a particular component. There are different implementations of LayoutElement that provide various different types of functionality and data. Some examples are:


Method Summary
 void addChildLayoutElement(LayoutElement element)
          This method is used to add a LayoutElement.
 java.lang.Object dispatchHandlers(javax.faces.context.FacesContext context, java.lang.String eventType, java.util.EventObject event)
           This method iterates over the handlers and executes each one.
 java.lang.Object dispatchHandlers(HandlerContext handlerCtx, java.util.List handlers)
           
 void encode(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
          This method performs any encode action for this particular LayoutElement.
 java.util.List getChildLayoutElements()
          This method returns the child LayoutElements as a List.
 java.util.List getHandlers(java.lang.String type)
           This method retrieves the Handlers for the requested type.
 java.lang.String getId(javax.faces.context.FacesContext context, javax.faces.component.UIComponent parent)
          Accessor method for id.
 LayoutDefinition getLayoutDefinition()
          This method returns the LayoutDefinition.
 LayoutElement getParent()
          This method returns the parent LayoutElement.
 java.lang.String getUnevaluatedId()
           This method generally should not be used.
 void setHandlers(java.lang.String type, java.util.List handlers)
           This method associates 'type' with the given list of Handlers.
 

Method Detail

addChildLayoutElement

void addChildLayoutElement(LayoutElement element)
This method is used to add a LayoutElement. LayoutElements should be added sequentially in the order in which they are to be rendered.


getChildLayoutElements

java.util.List getChildLayoutElements()
This method returns the child LayoutElements as a List.

Returns:
List of LayoutElements

getParent

LayoutElement getParent()
This method returns the parent LayoutElement.

Returns:
parent LayoutElement

getLayoutDefinition

LayoutDefinition getLayoutDefinition()
This method returns the LayoutDefinition. If unable to, it will throw an Exception.

Returns:
The LayoutDefinition

getHandlers

java.util.List getHandlers(java.lang.String type)

This method retrieves the Handlers for the requested type.

Parameters:
type - The type of Handlers to retrieve.
Returns:
A List of Handlers.

setHandlers

void setHandlers(java.lang.String type,
                 java.util.List handlers)

This method associates 'type' with the given list of Handlers.

Parameters:
type - The String type for the List of Handlers
handlers - The List of Handlers

getId

java.lang.String getId(javax.faces.context.FacesContext context,
                       javax.faces.component.UIComponent parent)
Accessor method for id. This should always return a non-null value, it may return "" if id does not apply.

Returns:
a non-null id

getUnevaluatedId

java.lang.String getUnevaluatedId()

This method generally should not be used. It does not resolve expressions. Instead use getId(FacesContext, UIComponent).

Returns:
The unevaluated id.

encode

void encode(javax.faces.context.FacesContext context,
            javax.faces.component.UIComponent component)
            throws java.io.IOException
This method performs any encode action for this particular LayoutElement.

Parameters:
context - The FacesContext
component - The UIComponent
Throws:
java.io.IOException

dispatchHandlers

java.lang.Object dispatchHandlers(HandlerContext handlerCtx,
                                  java.util.List handlers)

dispatchHandlers

java.lang.Object dispatchHandlers(javax.faces.context.FacesContext context,
                                  java.lang.String eventType,
                                  java.util.EventObject event)

This method iterates over the handlers and executes each one. A HandlerContext will be created to pass to each Handler. The HandlerContext object is reused across all Handlers that are invoked; the setHandler(Handler) method is invoked with the correct Handler descriptor before the handler is executed.

Parameters:
context - The FacesContext
eventType - The event type which is being fired
event - An optional EventObject providing more detail
Returns:
By default, (null) is returned. However, if any of the handlers produce a non-null return value, then the value from the last handler to produces a non-null return value is returned.