org.enhydra.barracuda.core.comp
Class DefaultView

java.lang.Object
  |
  +--org.enhydra.barracuda.core.comp.DefaultView
All Implemented Interfaces:
java.lang.Cloneable, View
Direct Known Subclasses:
DefaultTableView, DefaultTemplateView

public class DefaultView
extends java.lang.Object
implements View

This interface defines a View for components to render themselves in. Similar to the java.awt.Graphics object in AWT and Swing.

Since:
1.0
Version:
%I%, %G%
Author:
Christian Cryder
, Stephen Peterson , Jacob Kjome

Field Summary
protected  org.enhydra.barracuda.core.comp.DefaultView.LocalElementFactory localFactory
           
protected static org.apache.log4j.Logger logger
           
protected  org.w3c.dom.Node node
           
protected  java.util.Map templateNodes
           
 
Constructor Summary
DefaultView()
          Default constructor to create a view
DefaultView(org.w3c.dom.Node node)
          Create a view and bind it to a node
DefaultView(java.lang.String name)
          Create a view and bind it to a node
DefaultView(java.lang.String name, org.w3c.dom.Node node)
          Create a view and bind it to a node
 
Method Summary
 java.lang.Object clone()
          When a view is cloned, the underlying node that backs the view is set to null; you MUST bind the newly cloned view to a node before you can use it.
protected  void customSearchForTemplates(org.w3c.dom.Node curnode)
          If you want to identify templates based on some custom mechanism, this is the method to override.
 ElementFactory getElementFactory()
          Get the element factory provided by this view
 java.lang.String getName()
          Get the name for this view
 org.w3c.dom.Node getNode()
          Get the specific DOM node the View is bound to
protected  void searchForTemplates(org.w3c.dom.Node curnode)
          Given a specific node, find any templates associated with it or its children.
 void setName(java.lang.String iname)
          Set the name for this view
 void setNode(org.w3c.dom.Node inode)
          Bind the view to a specific DOM node
 java.lang.String toString()
          Get a String describing the view
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

protected static org.apache.log4j.Logger logger

node

protected org.w3c.dom.Node node

templateNodes

protected java.util.Map templateNodes

localFactory

protected org.enhydra.barracuda.core.comp.DefaultView.LocalElementFactory localFactory
Constructor Detail

DefaultView

public DefaultView()
Default constructor to create a view


DefaultView

public DefaultView(java.lang.String name)
Create a view and bind it to a node

Parameters:
name - the name of the view

DefaultView

public DefaultView(org.w3c.dom.Node node)
Create a view and bind it to a node

Parameters:
node - the node to which the view is bound

DefaultView

public DefaultView(java.lang.String name,
                   org.w3c.dom.Node node)
Create a view and bind it to a node

Parameters:
name - the name of the view
node - the node to which the view is bound
Method Detail

setNode

public void setNode(org.w3c.dom.Node inode)
Bind the view to a specific DOM node

Specified by:
setNode in interface View

getNode

public org.w3c.dom.Node getNode()
Get the specific DOM node the View is bound to

Specified by:
getNode in interface View
Returns:
the specific DOM node the View is bound to

setName

public void setName(java.lang.String iname)
Set the name for this view

Specified by:
setName in interface View

getName

public java.lang.String getName()
Get the name for this view

Specified by:
getName in interface View
Returns:
the name for this view

getElementFactory

public ElementFactory getElementFactory()
Get the element factory provided by this view

Specified by:
getElementFactory in interface View
Returns:
the element factory provided by this view

toString

public java.lang.String toString()
Get a String describing the view

Overrides:
toString in class java.lang.Object

searchForTemplates

protected void searchForTemplates(org.w3c.dom.Node curnode)
Given a specific node, find any templates associated with it or its children.


customSearchForTemplates

protected void customSearchForTemplates(org.w3c.dom.Node curnode)
If you want to identify templates based on some custom mechanism, this is the method to override. Look at DefaultTableView for an example...


clone

public java.lang.Object clone()
When a view is cloned, the underlying node that backs the view is set to null; you MUST bind the newly cloned view to a node before you can use it.

Specified by:
clone in interface View
Overrides:
clone in class java.lang.Object


Copyright © 2001 Enhydra.org