org.barracudamvc.core.event.helper
Class BTemplateViewHandler

java.lang.Object
  extended by org.barracudamvc.core.event.DefaultBaseEventListener
      extended by org.barracudamvc.core.event.helper.DefaultViewHandler
          extended by org.barracudamvc.core.event.helper.BTemplateViewHandler
All Implemented Interfaces:
EventListener, BaseEventListener

public abstract class BTemplateViewHandler
extends DefaultViewHandler

A custom implementation of the default view handler tailored for template components. All you have to do is instantiate the class with the name of the template and a reference to the model; it takes care of everything else.


Field Summary
protected  BTemplate templateComp
           
 
Fields inherited from class org.barracudamvc.core.event.helper.DefaultViewHandler
recycleChildren, vc
 
Fields inherited from class org.barracudamvc.core.event.DefaultBaseEventListener
idStr, localLogger
 
Constructor Summary
BTemplateViewHandler()
           
 
Method Summary
 BTemplate getBTemplate()
          Provide a handle to the underlying BTemplate component
abstract  Class getTemplateClass()
          Return an instance of the template class (must implement Document)
abstract  Object getTemplateModels()
          Return an instance of the template model; you can either return a single instance of a TemplateModel, -OR- you can return a List of TemplateModels
 Document handleViewEvent(BComponent root)
          Generate the view
 void postCompRender(BComponent root)
          The purpose of this method is to allow for optional post-component-render cycle processing (ie. to remove a value from the user's session).
 
Methods inherited from class org.barracudamvc.core.event.helper.DefaultViewHandler
cleanup, getDOMWriter, getIterator, getViewContext, handleViewEvent, preCompRender, setViewContext
 
Methods inherited from class org.barracudamvc.core.event.DefaultBaseEventListener
getListenerID, handleControlEvent, handleEvent, handleOtherEvent, isHandled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

templateComp

protected BTemplate templateComp
Constructor Detail

BTemplateViewHandler

public BTemplateViewHandler()
Method Detail

getTemplateModels

public abstract Object getTemplateModels()
Return an instance of the template model; you can either return a single instance of a TemplateModel, -OR- you can return a List of TemplateModels


getTemplateClass

public abstract Class getTemplateClass()
Return an instance of the template class (must implement Document)


getBTemplate

public BTemplate getBTemplate()
Provide a handle to the underlying BTemplate component


handleViewEvent

public Document handleViewEvent(BComponent root)
                         throws EventException,
                                javax.servlet.ServletException,
                                IOException
Generate the view

Specified by:
handleViewEvent in class DefaultViewHandler
Parameters:
root - the root component which will get rendered as a result of this request
Returns:
the Document to be rendered
Throws:
javax.servlet.ServletException
IOException
EventException

postCompRender

public void postCompRender(BComponent root)
Description copied from class: DefaultViewHandler
The purpose of this method is to allow for optional post-component-render cycle processing (ie. to remove a value from the user's session). If you need a reference to the view context, call getViewContext()

Overrides:
postCompRender in class DefaultViewHandler
Parameters:
root - the root component which will get rendered as a result of this request


Copyright © 2006 BarracudaMVC.org All Rights Reserved.