com.cc.framework.ui.painter.def
Class DefTreePainter

java.lang.Object
  extended bycom.cc.framework.ui.painter.ControlPainter
      extended bycom.cc.framework.ui.painter.def.DefPainterBase
          extended bycom.cc.framework.ui.painter.def.DefTreePainter

public class DefTreePainter
extends DefPainterBase

Painter for the Tree Control

Since:
1.0
Version:
$Revision: 1.66 $
Author:
Harald Schulz

Field Summary
protected static int IMAGE_SIZE
          The size of the images
 
Fields inherited from class com.cc.framework.ui.painter.ControlPainter
log
 
Constructor Summary
DefTreePainter(PainterContext painterContext, TreeControl ctrl)
          Constructor for DefTreePainter
 
Method Summary
protected  java.lang.StringBuffer appendNodes(int indent, TreeNodeDataModel node)
          Appends the tree nodes as java scripting variables
protected  JavaScript createClientScript()
          Creates the Javascript needed to render the tree on the client
protected  org.apache.ecs.ConcreteElement createTreeLines(TreeLineIterator iter)
          Renders a Sub Tree of the Control.
protected  org.apache.ecs.ConcreteElement doCreateElement()
          Generates the needed HTML for the tree
protected  java.lang.String[] doCreateJSImageResourceArray()
          Creates the array which holds the images resources used by our JavaScript tree
protected  TreeControl getCtrl()
          Retrieves the control for this painter
protected  TreeDesignModel getDesignModel()
          Returns the DesignModel
 java.lang.String getElementClass(int type)
          The method returns the HTML style class required for a list or treelist control.
private  int getLevel(TreeNodeDataModel node)
           
protected  TreeGroupDataModel getRoot()
          Returns the Root-Element of the Tree
protected  java.lang.String getRowClass(boolean oddLine, boolean highlighted)
          Returns the class id for a even/odd row which is selected/deselected
 
Methods inherited from class com.cc.framework.ui.painter.def.DefPainterBase
createHelpElement, createHelpElement, doCreateHelpButton, doCreateHelpIcon
 
Methods inherited from class com.cc.framework.ui.painter.ControlPainter
ajaxPaint, attr, attr, attr, beginPaint, createActionPainter, createActionPainter, createElement, createImage, createImage, createImage, createInput, createInput, createSpacer, createSpacer, createSpacer, decorateURL, doAddDecorationsToRow, doAddDecorationsToRow, doAfterCreate, doAttachDecorations, doBeforeCreate, encodeURL, endPaint, forceControlName, getAsString, getAwtColor, getColor, getContextPath, getControlName, getDecorationsOnce, getElementName, getFramePainter, getFrameworkString, getFrameworkString, getImage, getImage, getImage, getImageSrc, getImageSrc, getImageSrc, getLocale, getPageContext, getPainterContext, getPrincipal, getRequest, getResponse, getSession, getSmartCaption, getSmartDetail, getSource, getSource, getStringResource, getStyleId, html, html, html, init, isRunAtClient, localize, localize, localize, paint, removeHtml, removeHtml, request, response, session, showComments
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IMAGE_SIZE

protected static final int IMAGE_SIZE
The size of the images

See Also:
Constant Field Values
Constructor Detail

DefTreePainter

public DefTreePainter(PainterContext painterContext,
                      TreeControl ctrl)
Constructor for DefTreePainter

Parameters:
painterContext - The PainterContext
ctrl - The Control to render
Method Detail

getCtrl

protected TreeControl getCtrl()
Retrieves the control for this painter

Returns:
Control

getDesignModel

protected TreeDesignModel getDesignModel()
Returns the DesignModel

Returns:
TreeDesignModel

getRoot

protected TreeGroupDataModel getRoot()
Returns the Root-Element of the Tree

Returns:
TreeGroupDataModel

createTreeLines

protected org.apache.ecs.ConcreteElement createTreeLines(TreeLineIterator iter)
Renders a Sub Tree of the Control. Included Sub Trees will be rendered recursive.

Parameters:
iter - TreeLineIterator
Returns:
ConcreteElement

getLevel

private int getLevel(TreeNodeDataModel node)

getRowClass

protected java.lang.String getRowClass(boolean oddLine,
                                       boolean highlighted)
Returns the class id for a even/odd row which is selected/deselected

Parameters:
oddLine - Indicates if its a odd row
highlighted - Flag which indicates if the row is highlighted
Returns:
HTML class for this row

doCreateElement

protected org.apache.ecs.ConcreteElement doCreateElement()
Generates the needed HTML for the tree

Specified by:
doCreateElement in class ControlPainter
Returns:
ConcreteElement

createClientScript

protected JavaScript createClientScript()
Creates the Javascript needed to render the tree on the client

Returns:
The Javascript fragment

doCreateJSImageResourceArray

protected java.lang.String[] doCreateJSImageResourceArray()
Creates the array which holds the images resources used by our JavaScript tree

Returns:
Array containing the images resources

appendNodes

protected java.lang.StringBuffer appendNodes(int indent,
                                             TreeNodeDataModel node)
Appends the tree nodes as java scripting variables

Parameters:
indent - Indent level of the node for pretty printing
node - the node
Returns:
returns the generated JavaScript code

getElementClass

public java.lang.String getElementClass(int type)
Description copied from class: ControlPainter
The method returns the HTML style class required for a list or treelist control.

Overrides:
getElementClass in class DefPainterBase
See Also:
ControlPainter.getElementClass(int)


Copyright © 2000-2005 SCC Informationssysteme GmbH. All Rights Reserved.