org.richfaces.component
Class AbstractTreeDataModel

java.lang.Object
  extended by javax.faces.model.DataModel
      extended by org.ajax4jsf.ajax.repeat.ExtendedDataModel
          extended by org.richfaces.component.AbstractTreeDataModel
Direct Known Subclasses:
AbstractTreeDataModelStrategyWrapper, TreeDataModel

public abstract class AbstractTreeDataModel
extends org.ajax4jsf.ajax.repeat.ExtendedDataModel

Author:
Nick Belaevski - nbelaevski@exadel.com created 07.12.2006 Base class for all tree data models

Field Summary
static char SEPARATOR
           
 
Constructor Summary
AbstractTreeDataModel()
           
 
Method Summary
 int getRowCount()
           
 int getRowIndex()
           
 java.lang.Object getWrappedData()
           
abstract  boolean isLeaf()
          returns whether this node is leaf
protected  void processElement(javax.faces.context.FacesContext context, org.ajax4jsf.ajax.repeat.DataVisitor dataVisitor, java.lang.Object argument, TreeRowKey treeRowKey, boolean last)
          Processes concrete tree node.
 void setRowIndex(int rowIndex)
           
 void setWrappedData(java.lang.Object data)
           
 void walk(javax.faces.context.FacesContext context, org.ajax4jsf.ajax.repeat.DataVisitor dataVisitor, org.ajax4jsf.ajax.repeat.Range range, java.lang.Object argument)
           
abstract  void walk(javax.faces.context.FacesContext context, org.ajax4jsf.ajax.repeat.DataVisitor dataVisitor, org.ajax4jsf.ajax.repeat.Range range, TreeRowKey rowKey, java.lang.Object argument, boolean last)
          walk sub-model having row key argument as its root
abstract  void walkModel(javax.faces.context.FacesContext facesContext, org.ajax4jsf.ajax.repeat.DataVisitor visitor, TreeRange range, TreeRowKey key, java.lang.Object argument, boolean last)
          Walk backing sub-model having row key argument as its root.
 
Methods inherited from class org.ajax4jsf.ajax.repeat.ExtendedDataModel
getRowKey, getSerializableModel, setRowKey
 
Methods inherited from class javax.faces.model.DataModel
addDataModelListener, getDataModelListeners, getRowData, isRowAvailable, removeDataModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SEPARATOR

public static final char SEPARATOR
See Also:
Constant Field Values
Constructor Detail

AbstractTreeDataModel

public AbstractTreeDataModel()
Method Detail

getRowCount

public final int getRowCount()
Specified by:
getRowCount in class javax.faces.model.DataModel

getRowIndex

public final int getRowIndex()
Specified by:
getRowIndex in class javax.faces.model.DataModel

setRowIndex

public final void setRowIndex(int rowIndex)
Specified by:
setRowIndex in class javax.faces.model.DataModel

getWrappedData

public final java.lang.Object getWrappedData()
Specified by:
getWrappedData in class javax.faces.model.DataModel

setWrappedData

public final void setWrappedData(java.lang.Object data)
Specified by:
setWrappedData in class javax.faces.model.DataModel

walk

public final void walk(javax.faces.context.FacesContext context,
                       org.ajax4jsf.ajax.repeat.DataVisitor dataVisitor,
                       org.ajax4jsf.ajax.repeat.Range range,
                       java.lang.Object argument)
                throws java.io.IOException
Specified by:
walk in class org.ajax4jsf.ajax.repeat.ExtendedDataModel
Throws:
java.io.IOException

walk

public abstract void walk(javax.faces.context.FacesContext context,
                          org.ajax4jsf.ajax.repeat.DataVisitor dataVisitor,
                          org.ajax4jsf.ajax.repeat.Range range,
                          TreeRowKey rowKey,
                          java.lang.Object argument,
                          boolean last)
                   throws java.io.IOException
walk sub-model having row key argument as its root

Parameters:
context - faces context
dataVisitor - UIDataAdaptor.ComponentVisitor
range - TreeRange to constraint the walk
rowKey - row key to treat as root of sub-model
argument - implementation specific argument
last - boolean flag indicating whether we started our walk from last element
Throws:
java.io.IOException
See Also:
ExtendedDataModel#walk(FacesContext, DataVisitor, Range, Object)}

isLeaf

public abstract boolean isLeaf()
returns whether this node is leaf

Returns:

walkModel

public abstract void walkModel(javax.faces.context.FacesContext facesContext,
                               org.ajax4jsf.ajax.repeat.DataVisitor visitor,
                               TreeRange range,
                               TreeRowKey key,
                               java.lang.Object argument,
                               boolean last)
                        throws java.io.IOException
Walk backing sub-model having row key argument as its root. If there is no backing model configured, calling this method is equivalent to calling walk(FacesContext, DataVisitor, Range, TreeRowKey, Object, boolean)

Parameters:
facesContext - faces context
visitor - UIDataAdaptor.ComponentVisitor instance
range - TreeRange to constraint the walk
key - row key to treat as root of sub-model
argument - implementation-specific argument
Throws:
java.io.IOException
See Also:
#walk(FacesContext, DataVisitor, Range, TreeRowKey, Object, boolean)}

processElement

protected void processElement(javax.faces.context.FacesContext context,
                              org.ajax4jsf.ajax.repeat.DataVisitor dataVisitor,
                              java.lang.Object argument,
                              TreeRowKey treeRowKey,
                              boolean last)
                       throws java.io.IOException
Processes concrete tree node. Knows about LastElementAware interface and handles it properly. Checks if argument is instance of SubTreeChildrenAppender and if it is so does appending current element

Parameters:
context -
dataVisitor -
argument -
treeRowKey -
last -
Throws:
java.io.IOException


Copyright © 2007. All Rights Reserved.