org.barracudamvc.core.comp
Class DefaultTableView

java.lang.Object
  extended by org.barracudamvc.core.comp.DefaultView
      extended by org.barracudamvc.core.comp.DefaultTableView
All Implemented Interfaces:
Cloneable, TableView, View

public class DefaultTableView
extends DefaultView
implements TableView

This class provides the default implementation for a TableView. It provides a View for components to render themselves in. Unlike other views, the TableView provides convenience methods to access the header, body, and footer elements of the view.


Field Summary
protected  Element body
           
protected  Element caption
           
protected  Element footer
           
protected  Element header
           
protected static org.apache.log4j.Logger logger
           
 
Fields inherited from class org.barracudamvc.core.comp.DefaultView
node, templateNodes
 
Constructor Summary
DefaultTableView()
          Public noargs constructor.
DefaultTableView(Node node)
          Create a view and bind it to a node.
 
Method Summary
protected  void customSearchForTemplates(Node curnode)
          Here we are going to look for custom header, footer, and body elements
 Element getBodyElement()
          Get the body element from the particular Node that backs this view.
 Element getCaptionElement()
          Get the caption element from the particular Node that backs this view.
 Element getFooterElement()
          Get the footer element from the particular Node that backs this view.
 Element getHeaderElement()
          Get the header element from the particular Node that backs this view.
protected  void searchForTemplates(Node curnode)
          Instead of the parent behavior (which will only process the root node, not the children), here we need to iterate through all of them in order to call customSearchForTemplates() on every node.
 String toString()
          Get a String describing the view
 
Methods inherited from class org.barracudamvc.core.comp.DefaultView
clone, getName, getNode, setName, setNode
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.barracudamvc.core.comp.View
clone, getName, getNode, setName, setNode
 

Field Detail

logger

protected static final org.apache.log4j.Logger logger

header

protected Element header

body

protected Element body

footer

protected Element footer

caption

protected Element caption
Constructor Detail

DefaultTableView

public DefaultTableView()
Public noargs constructor. This creates a view which is not bound to any particular node. You must bind the view to a node before you can actually use it for anything


DefaultTableView

public DefaultTableView(Node node)
Create a view and bind it to a node.

Parameters:
node - the node the view should be bound to
Method Detail

getHeaderElement

public Element getHeaderElement()
Get the header element from the particular Node that backs this view.

Specified by:
getHeaderElement in interface TableView
Returns:
the header element (may be null if there is no recognized header)

getBodyElement

public Element getBodyElement()
Get the body element from the particular Node that backs this view. There will always be a body element. It will either correspond to the element or to the entire table (ie. the whole table is body)

Specified by:
getBodyElement in interface TableView
Returns:
the body element

getFooterElement

public Element getFooterElement()
Get the footer element from the particular Node that backs this view.

Specified by:
getFooterElement in interface TableView
Returns:
the footer element (may be null if there is no recognized footer)

getCaptionElement

public Element getCaptionElement()
Get the caption element from the particular Node that backs this view.

Specified by:
getCaptionElement in interface TableView
Returns:
the caption element (may be null if there is no recognized caption)

searchForTemplates

protected void searchForTemplates(Node curnode)
Instead of the parent behavior (which will only process the root node, not the children), here we need to iterate through all of them in order to call customSearchForTemplates() on every node. This used to be the default for all views; now it only happens for table views

Overrides:
searchForTemplates in class DefaultView

customSearchForTemplates

protected void customSearchForTemplates(Node curnode)
Here we are going to look for custom header, footer, and body elements

Overrides:
customSearchForTemplates in class DefaultView

toString

public String toString()
Description copied from class: DefaultView
Get a String describing the view

Overrides:
toString in class DefaultView


Copyright © 2006 BarracudaMVC.org All Rights Reserved.