org.enhydra.barracuda.core.comp
Class BTemplate

java.lang.Object
  |
  +--org.enhydra.barracuda.core.comp.AbstractBComponent
        |
        +--org.enhydra.barracuda.core.comp.BComponent
              |
              +--org.enhydra.barracuda.core.comp.BTemplate
All Implemented Interfaces:
BContainer, StateMap

public class BTemplate
extends BComponent

A BTemplate is used to process part of a DOM as a template--the component will look for directives and then query the models to return the data associated with a given key. BTemplate essentially brings "pull-mvc" to XMLC.

In the case of BTemplate, you will ALMOST ALWAYS need to manually bind it to a View, unless you happen to be returning it from a model (in which case this will be done for you automatically)


Field Summary
protected static org.apache.log4j.Logger logger
           
protected  java.util.HashMap templateModels
           
 
Fields inherited from class org.enhydra.barracuda.core.comp.BComponent
attrs, CACHING_MARKER, enabled, name, rs, VISIBILITY_MARKER, visible
 
Fields inherited from class org.enhydra.barracuda.core.comp.AbstractBComponent
children, dvc, isStepChild, parent, preventCaching, statemap, stepChildren, tempViews, validated, views
 
Constructor Summary
BTemplate()
          Public noargs constructor
BTemplate(TemplateModel imodel)
          Public constructor which creates the component and binds it to a specific model.
 
Method Summary
 void addModel(TemplateModel imodel)
          Add a model to the component.
 void addModels(java.util.List ilist)
          Add a whole list of models to the component.
 void destroyCycle()
          Destroy cycle.
 TemplateModel getModel(java.lang.String modelName)
          Get the model that backs the table
 java.util.List getModels()
          Get a list of models associated with this view
 void removeModel(java.lang.String modelName)
          Remove a model from the component by model name
 void removeModel(TemplateModel imodel)
          Remove a model from the component.
 
Methods inherited from class org.enhydra.barracuda.core.comp.BComponent
addView, getAttr, getAttrMap, getFirstView, getName, getRenderStrategy, getViews, isEnabled, isVisible, postRender, preRender, removeAllViews, removeView, render, render, renderView, renderView, setAttr, setEnabled, setEnabled, setName, setRenderStrategy, setView, setVisible, setVisible, supports
 
Methods inherited from class org.enhydra.barracuda.core.comp.AbstractBComponent
addChild, addStepChild, addStepChild, addTempView, findComponentMap, findRendererFactory, getChild, getChildren, getDefaultViewContext, getParent, getPreventCaching, getRenderer, getRenderer, getRootComponent, getState, getStateKeys, getStateValues, hasChildren, hasViews, initCycle, installRendererFactory, invalidate, isStepChild, printStackTrace, printStackTrace, printStackTrace, putState, removeAll, removeAllStepChildren, removeChild, removeChild, removeState, setDefaultViewContext, setParent, setPreventCaching, toRef, toString, toString, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

protected static org.apache.log4j.Logger logger

templateModels

protected java.util.HashMap templateModels
Constructor Detail

BTemplate

public BTemplate()
Public noargs constructor


BTemplate

public BTemplate(TemplateModel imodel)
Public constructor which creates the component and binds it to a specific model. You will need to manually set the View if you use this constructor.

Method Detail

addModel

public void addModel(TemplateModel imodel)
Add a model to the component. Unlike other components, the template component can have ant number of models...


addModels

public void addModels(java.util.List ilist)
Add a whole list of models to the component.


removeModel

public void removeModel(TemplateModel imodel)
Remove a model from the component.


removeModel

public void removeModel(java.lang.String modelName)
Remove a model from the component by model name


getModel

public TemplateModel getModel(java.lang.String modelName)
Get the model that backs the table

Returns:
the model that backs the table

getModels

public java.util.List getModels()
Get a list of models associated with this view

Returns:
a list of models associated with this view

destroyCycle

public void destroyCycle()
Destroy cycle. The component should use this cycle to perform any special cleanup.

Overrides:
destroyCycle in class AbstractBComponent


Copyright © 2001 Enhydra.org