org.apache.tapestry
Class BaseComponent

java.lang.Object
  extended by org.apache.hivemind.impl.BaseLocatable
      extended by org.apache.tapestry.AbstractComponent
          extended by org.apache.tapestry.BaseComponent
All Implemented Interfaces:
org.apache.hivemind.Locatable, org.apache.hivemind.LocationHolder, IComponent, IDirectEvent, Component, IRender, ITemplateComponent
Direct Known Subclasses:
AbstractPage, AbstractTableViewComponent, CheckboxGroup, ControlCheckbox, ControlledCheckbox, ExceptionDisplay, InspectorButton, MaskEdit, Palette, RequestDisplay, Selector, ShowEngine, ShowProperties, ShowSpecification, ShowTemplate, SimpleTableColumnComponent, SimpleTableColumnFormComponent, SimpleTableColumnSortImage, SimpleTableColumnSortLink, Table, TableView, Timeout, Tree, TreeDataView, TreeNodeView, TreeTable, TreeTableDataView, TreeTableNodeViewDelegator, TreeView, ViewTabs, XTile

public abstract class BaseComponent
extends AbstractComponent
implements ITemplateComponent

Base implementation for most components that use an HTML template.

Author:
Howard Lewis Ship

Field Summary
 
Fields inherited from class org.apache.tapestry.AbstractComponent
_body, _bodyCount
 
Constructor Summary
BaseComponent()
           
 
Method Summary
 void addOuter(IRender element)
          Adds an element as an outer element for the receiver.
 void finishLoad(IRequestCycle cycle, IPageLoader loader, IComponentSpecification specification)
          Loads the template for the component, then invokes AbstractComponent.finishLoad(IRequestCycle, IPageLoader, IComponentSpecification).
 IRender[] getContainedRenderers()
          Returns the list of of IRender elements contained by this component.
 IRender[] getInnerRenderers()
          In some rare cases a component has both outer and inner renderers - such as with BaseComponent.
protected  void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
          Renders the top level components contained by the receiver.
 
Methods inherited from class org.apache.tapestry.AbstractComponent
addAsset, addBody, addComponent, checkActiveLock, cleanupAfterRender, enterActiveState, equals, finishLoad, generateClientId, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getBody, getBodyCount, getBoundId, getClientId, getComponent, getComponents, getContainedComponent, getContainer, getEventInvoker, getExtendedId, getId, getIdPath, getListeners, getMessages, getNamespace, getPage, getRenderWorker, getSpecification, getSpecifiedId, getTemplateTagName, hasEvents, hashCode, isInActiveState, isParameterBound, isRendering, isStateful, pageEndRender, peekClientId, prepareForRender, render, renderBody, renderIdAttribute, renderInformalParameters, setBinding, setClientId, setContainedComponent, setContainer, setHasEvents, setId, setNamespace, setPage, setTemplateTagName, toString, triggerEvent
 
Methods inherited from class org.apache.hivemind.impl.BaseLocatable
getLocation, setLocation
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.tapestry.IComponent
addAsset, addBody, addComponent, enterActiveState, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getClientId, getComponent, getComponents, getContainedComponent, getContainer, getEventInvoker, getExtendedId, getId, getIdPath, getListeners, getMessages, getNamespace, getPage, getSpecification, getSpecifiedId, getTemplateTagName, isRendering, peekClientId, renderBody, setBinding, setClientId, setContainedComponent, setContainer, setId, setNamespace, setPage, setTemplateTagName
 
Methods inherited from interface org.apache.tapestry.IRender
render
 
Methods inherited from interface org.apache.hivemind.LocationHolder
setLocation
 
Methods inherited from interface org.apache.hivemind.Locatable
getLocation
 

Constructor Detail

BaseComponent

public BaseComponent()
Method Detail

addOuter

public void addOuter(IRender element)
Adds an element as an outer element for the receiver. Outer elements are elements that should be directly rendered by the receiver's render() method. That is, they are top-level elements on the HTML template.

Specified by:
addOuter in interface ITemplateComponent

getContainedRenderers

public IRender[] getContainedRenderers()
Description copied from interface: Component
Returns the list of of IRender elements contained by this component. Ie whatever has been added via IComponent.addBody(IRender).

Specified by:
getContainedRenderers in interface Component
Overrides:
getContainedRenderers in class AbstractComponent
Returns:
The values, if any. Null otherwise.

getInnerRenderers

public IRender[] getInnerRenderers()
Description copied from interface: Component
In some rare cases a component has both outer and inner renderers - such as with BaseComponent. This value should return the normal inner renderers most components do in those instances while the other Component.getContainedRenderers() should return the outer renderers.

Specified by:
getInnerRenderers in interface Component
Overrides:
getInnerRenderers in class AbstractComponent
Returns:
The inner renderers if this component supports more than one type, null otherwise.

renderComponent

protected void renderComponent(IMarkupWriter writer,
                               IRequestCycle cycle)
Renders the top level components contained by the receiver.

Specified by:
renderComponent in class AbstractComponent
Since:
2.0.3

finishLoad

public void finishLoad(IRequestCycle cycle,
                       IPageLoader loader,
                       IComponentSpecification specification)
Loads the template for the component, then invokes AbstractComponent.finishLoad(IRequestCycle, IPageLoader, IComponentSpecification). Subclasses must invoke this method first, before adding any additional behavior, though its usually simpler to override AbstractComponent.finishLoad()instead.

Specified by:
finishLoad in interface IComponent
Overrides:
finishLoad in class AbstractComponent


Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.