com.primix.tapestry
Class BaseComponent

java.lang.Object
  |
  +--com.primix.tapestry.AbstractComponent
        |
        +--com.primix.tapestry.BaseComponent
All Implemented Interfaces:
IComponent, IRender
Direct Known Subclasses:
AbstractPage, BookLink, Border, Border, Borrow, Browser, ExceptionDisplay, Palette, PersonLink, Portlet, Selector, ShowEngine, ShowInspector, ShowLogging, ShowProperties, ShowSpecification, ShowTemplate, ViewTabs

public class BaseComponent
extends AbstractComponent

Base implementation for most components that use an HTML template.

Version:
$Id: BaseComponent.java,v 1.24 2001/09/12 20:45:12 hship Exp $
Author:
Howard Ship

Field Summary
protected  IRender[] outer
           
protected static int OUTER_INIT_SIZE
           
protected  int outerCount
           
 
Fields inherited from class com.primix.tapestry.AbstractComponent
id, page, specification, wrapped, wrappedCount
 
Constructor Summary
BaseComponent()
           
 
Method Summary
protected  void addOuter(IRender element)
          Adds an element as an outer element for the receiver.
 void finishLoad(IPageLoader loader, ComponentSpecification specification)
          Loads the template for the component, and invokes AbstractComponent.finishLoad().
protected  void readTemplate(IPageLoader loader)
          Reads the receiver's template and figures out which elements wrap which other elements.
 void render(IResponseWriter writer, IRequestCycle cycle)
          Renders the top level components contained by the receiver.
 
Methods inherited from class com.primix.tapestry.AbstractComponent
addAsset, addComponent, addWrapped, cleanupAfterRender, cleanupComponent, finishLoad, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, generateAttributes, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getChangeObserver, getComponent, getComponents, getContainer, getExtendedId, getId, getIdPath, getListeners, getPage, getSpecification, prepareForRender, renderWrapped, reset, setBinding, setContainer, setId, setPage, setSpecification, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OUTER_INIT_SIZE

protected static final int OUTER_INIT_SIZE

outerCount

protected int outerCount

outer

protected IRender[] outer
Constructor Detail

BaseComponent

public BaseComponent()
Method Detail

addOuter

protected 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.

readTemplate

protected void readTemplate(IPageLoader loader)
                     throws PageLoaderException
Reads the receiver's template and figures out which elements wrap which other elements.

This is coded as a single, big, ugly method for efficiency.


render

public void render(IResponseWriter writer,
                   IRequestCycle cycle)
            throws RequestCycleException
Renders the top level components contained by the receiver.

finishLoad

public void finishLoad(IPageLoader loader,
                       ComponentSpecification specification)
                throws PageLoaderException
Loads the template for the component, and invokes AbstractComponent.finishLoad(). Subclasses must invoke this method first, before adding any additional behavior.
Overrides:
finishLoad in class AbstractComponent