| java.lang.Object com.sun.rave.web.ui.component.util.descriptors.LayoutElementBase
All known Subclasses: com.sun.rave.web.ui.component.util.descriptors.LayoutDefinition, com.sun.rave.web.ui.component.util.descriptors.LayoutForEach, com.sun.rave.web.ui.component.util.descriptors.LayoutAttribute, com.sun.rave.web.ui.component.util.descriptors.LayoutStaticText, com.sun.rave.web.ui.component.util.descriptors.LayoutIf, com.sun.rave.web.ui.component.util.descriptors.LayoutComponent, com.sun.rave.web.ui.component.util.descriptors.LayoutFacet, com.sun.rave.web.ui.component.util.descriptors.LayoutMarkup,
LayoutElementBase | abstract public class LayoutElementBase implements LayoutElement(Code) | | This class provides some common functionality between the various types
of LayoutElements. It is the base class of most implementations (perhaps
all).
author: Ken Paulsen (ken.paulsen@sun.com) |
Method Summary | |
public void | addChildLayoutElement(LayoutElement element) This method is used to add a LayoutElement. | protected HandlerContext | createHandlerContext(FacesContext context, EventObject event, String eventType) This method is responsible for creating a new HandlerContext. | public Object | dispatchHandlers(FacesContext context, String eventType, EventObject event) This method iterates over the handlers and executes each one. | public Object | dispatchHandlers(HandlerContext handlerCtx, List handlers) As currently implemented, this method is essentially a utility
method. | public void | encode(FacesContext context, UIComponent component) This is the base implementation for encode. | public static void | encodeChild(FacesContext context, UIComponent component) This method is a convenience method for encoding the given
UIComponent . | abstract protected boolean | encodeThis(FacesContext context, UIComponent component) This method allows each LayoutElement to provide it's own encode
functionality. | public List | getChildLayoutElements() This method returns the LayoutElements as a List. | public List | getHandlers(String type) | public List | getHandlers(String type, UIComponent comp) This method retrieves the Handlers for the requested type. | public Map | getHandlersByTypeMap() | public String | getId(FacesContext context, UIComponent parent) Accessor method for id. | public LayoutDefinition | getLayoutDefinition() This method walks to the top-most LayoutElement, which should be a
LayoutDefinition. | public LayoutElement | getParent() This method returns the parent LayoutElement. | public String | getUnevaluatedId() This method generally should not be used. | public Object | resolveValue(FacesContext context, UIComponent parent, String value) This method will attempt to resolve EL strings in the given
value.
Parameters: context - The FacesContext Parameters: parent - The parent UIComponent . | public void | setHandlers(String type, List handlers) | public void | setHandlersByTypeMap(Map map) This method provides a means to set the "handlersByType" Map.
Normally this is done for each type individually via
LayoutElementBase.setHandlers(String,List) . | protected void | setParent(LayoutElement parent) This method sets the parent LayoutElement. |
AFTER_ENCODE | final public static String AFTER_ENCODE(Code) | | This is the "type" for handlers to be invoked after the encoding
of this element.
|
BEFORE_ENCODE | final public static String BEFORE_ENCODE(Code) | | This is the "type" for handlers to be invoked before the encoding
of this element.
|
ENCODE | final public static String ENCODE(Code) | | This is the "type" for handlers to be invoked during the encoding
of this element. This occurs before any child LayoutElements are
invoked and only if child Elements are to be invoked.
|
LayoutElementBase | protected LayoutElementBase(LayoutElement parent, String id)(Code) | | Constructor
Parameters: parent - The parent LayoutElement Parameters: id - Identifier for this LayoutElement |
addChildLayoutElement | public void addChildLayoutElement(LayoutElement element)(Code) | | This method is used to add a LayoutElement. LayoutElements should be
added sequentially in the order in which they are to be rendered.
Parameters: element - The LayoutElement to add as a child |
createHandlerContext | protected HandlerContext createHandlerContext(FacesContext context, EventObject event, String eventType)(Code) | | This method is responsible for creating a new HandlerContext. It
does not set the Handler descriptor. This is done right before a
Handler is invoked. This allows the HandlerContext object to be
reused.
Parameters: context - The FacesContext |
dispatchHandlers | public Object dispatchHandlers(FacesContext context, String eventType, EventObject event)(Code) | | 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 Parameters: eventType - The event type which is being fired Parameters: event - An optional EventObject providing more detail By default, (null) is returned. However, if any of thehandlers produce a non-null return value, then the value fromthe last handler to produces a non-null return value isreturned. |
dispatchHandlers | public Object dispatchHandlers(HandlerContext handlerCtx, List handlers)(Code) | | As currently implemented, this method is essentially a utility
method. May want to rethink this.
|
encode | public void encode(FacesContext context, UIComponent component) throws IOException(Code) | | This is the base implementation for encode. Typically each type of
LayoutElement wants to do something specific then conditionally have
its children rendered. This method invokes the abstract method
"encodeThis" to do specific functionality, it the walks the children
and renders them, if encodeThis returns true. It skips the children
if encodeThis returns false.
Parameters: context - The FacesContext Parameters: component - The UIComponent |
encodeChild | public static void encodeChild(FacesContext context, UIComponent component) throws IOException(Code) | | This method is a convenience method for encoding the given
UIComponent . It calls the appropriate encoding
methods on the component and calls itself recursively for all
UIComponent children that do not render their own
children.
Parameters: context - FacesContext Parameters: component - UIComponent to encode |
encodeThis | abstract protected boolean encodeThis(FacesContext context, UIComponent component) throws IOException(Code) | | This method allows each LayoutElement to provide it's own encode
functionality. If the LayoutElement should render its
children, this method should return true. Otherwise, this method
should return false.
Parameters: context - The FacesContext Parameters: component - The UIComponent true if children are to be rendered, false otherwise. |
getChildLayoutElements | public List getChildLayoutElements()(Code) | | This method returns the LayoutElements as a List.
List of LayoutElements |
getHandlers | public List getHandlers(String type)(Code) | | This method retrieves the Handlers for the requested type.
Parameters: type - The type of Handlers to retrieve. A List of Handlers. |
getHandlers | public List getHandlers(String type, UIComponent comp)(Code) | | This method retrieves the Handlers for the requested type. But
also includes any handlers that are associated with the instance
(i.e. the UIComponent).
Parameters: type - The type of Handler s to retrieve. Parameters: event - The associated UIComponent (or null). A List of Handlers. |
getHandlersByTypeMap | public Map getHandlersByTypeMap()(Code) | | This method provides access to the "handlersByType"
Map .
|
getId | public String getId(FacesContext context, UIComponent parent)(Code) | | Accessor method for id. This returns a non-null value, it may
return "" if id is not set or does not apply.
This method will also attempt to resolve EL strings.
Parameters: context - The FacesContext Parameters: parent - The parent UIComponent . This is usedbecause the current UIComponent is typicallyunknown (or not even created yet). a non-null id |
getLayoutDefinition | public LayoutDefinition getLayoutDefinition()(Code) | | This method walks to the top-most LayoutElement, which should be a
LayoutDefinition. If not, it will throw an Exception.
The LayoutDefinition |
getParent | public LayoutElement getParent()(Code) | | This method returns the parent LayoutElement.
parent LayoutElement |
resolveValue | public Object resolveValue(FacesContext context, UIComponent parent, String value)(Code) | | This method will attempt to resolve EL strings in the given
value.
Parameters: context - The FacesContext Parameters: parent - The parent UIComponent . This is usedbecause the current UIComponent is typicallyunknown (or not even created yet). Parameters: value - The String to resolve The evaluated value (may be null). |
setHandlers | public void setHandlers(String type, List handlers)(Code) | | This method associates 'type' with the given list of Handlers.
Parameters: type - The String type for the List of Handlers Parameters: handlers - The List of Handlers |
setHandlersByTypeMap | public void setHandlersByTypeMap(Map map)(Code) | | This method provides a means to set the "handlersByType" Map.
Normally this is done for each type individually via
LayoutElementBase.setHandlers(String,List) . This Map may not be null (null
will be ignored) and should contain entries that map to
List s of
Handler s.
|
setParent | protected void setParent(LayoutElement parent)(Code) | | This method sets the parent LayoutElement.
Parameters: parent - Parent LayoutElement |
|
|