com.cc.framework.ui.painter.def.col
Class ColumnPainterBase

java.lang.Object
  extended bycom.cc.framework.ui.painter.def.col.ColumnPainterBase
All Implemented Interfaces:
ColumnPainter
Direct Known Subclasses:
ColumnButtonPainter, ColumnCheckboxPainter, ColumnCheckPainter, ColumnCommandPainter, ColumnDrilldownPainter, ColumnHtmlPainter, ColumnImagePainter, ColumnLinkPainter, ColumnRadioPainter, ColumnSelectPainter, ColumnTextareaPainter, ColumnTextPainter, ColumnTreePainter

public class ColumnPainterBase
extends java.lang.Object
implements ColumnPainter

Base Class for column painters

Version:
$Revision: 1.41 $
Author:
Harald Schulz

Constructor Summary
ColumnPainterBase()
          Constructor
 
Method Summary
protected  void addElement(org.apache.ecs.html.TD cellElement, CellPainterContext cpctx, ImageModel image, org.apache.ecs.ConcreteElement content)
          Helper to add a content with an optional image to the cell element
 void applyDesignRules(org.apache.ecs.html.TD cellElement, CellPainterContext cpctx)
          Applies all matching design rules to the cell
protected  org.apache.ecs.ConcreteElement applyStyle(org.apache.ecs.ConcreteElement element, ColumnDesignModel column)
          Applies the column styles to the HTML element
protected  org.apache.ecs.ConcreteElement applyStyle(org.apache.ecs.ConcreteElement element, ColumnDesignModel column, boolean addHandlers)
          Applies the column styles to the HTML element
protected  org.apache.ecs.ConcreteElement createCheckAllButton(PainterContext ctx, ColumnDesignModel column, SelectMode mode)
          Creates the check all button
protected  org.apache.ecs.ConcreteElement createCheckColumnButton(PainterContext ctx, ColumnDesignModel column)
          Creates the check all button
protected  java.util.Collection createHeaderButtons(PainterContext ctx, ColumnDesignModel column)
          Creates the buttons for the column header
protected  org.apache.ecs.ConcreteElement createUncheckAllButton(PainterContext ctx, ColumnDesignModel column, SelectMode mode)
          Creates the uncheck all button
protected  org.apache.ecs.ConcreteElement createUncheckColumnButton(PainterContext ctx, ColumnDesignModel column)
          Creates the uncheck all button
protected  java.lang.String getAnchor(ColumnDesignModel column, LineIterator iter)
          Returns the Anchor Attribute which should be included in a HyperLink
protected static java.lang.String getBodyContent(PainterContext ctx, ColumnDesignModel column, LineIterator iter)
          Try to find a previously registered JSP Body for this row bean
protected  ImageModel getHeaderImage(ColumnHeaderDesignModel header)
          Returns the Image of a column header
protected  java.lang.String getLinkName(ColumnDesignModel column, LineIterator iter)
          Returns the Anchor name Attribute which should be included in a HyperLink
protected  java.lang.String getTarget(ColumnDesignModel column, LineIterator iter)
          Returns the Target Attribute which should be included in a HyperLink
protected  java.lang.String getTooltip(CellPainterContext cpctx)
          Returns the localized and HTML encoded Tooltip Attribute which should be used for the row
protected  java.lang.String getTooltip(PainterContext ctx, ColumnDesignModel column, LineIterator iter)
          Deprecated. use getTooltip(CellPainterContext) instead
protected  boolean isDisabled(CellPainterContext cpctx)
          Checks if the column or cell is disabled or not
protected  boolean isEditable(CellPainterContext cpctx)
          Checks if the column or cell is editable or not
protected  boolean isEditable(PainterContext ctx, ColumnDesignModel column, LineIterator iter)
          Deprecated. use isEditable(CellPainterContext) instead
 void paintCell(org.apache.ecs.html.TD cellElement, CellPainterContext cpctx)
          Paints a single Cell
 void paintCell(org.apache.ecs.html.TD cellElement, PainterContext ctx, ColumnDesignModel column, LineIterator iter)
          Deprecated. please use or overwrite paintCell(TD, CellPainterContext)
protected  void paintEmptyCell(org.apache.ecs.html.TD cellElement, CellPainterContext cpctx)
          The column painter will call this method to render an empty cell
 void paintHeader(org.apache.ecs.html.TD headerElement, CellPainterContext cpctx)
          Paints the column header
 void paintHeader(org.apache.ecs.html.TD headerElement, PainterContext ctx, ColumnDesignModel column)
          Deprecated. please use or overwrite paintHeader(TD, CellPainterContext)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColumnPainterBase

public ColumnPainterBase()
Constructor

Method Detail

applyDesignRules

public void applyDesignRules(org.apache.ecs.html.TD cellElement,
                             CellPainterContext cpctx)
                      throws java.lang.Exception
Description copied from interface: ColumnPainter
Applies all matching design rules to the cell

Specified by:
applyDesignRules in interface ColumnPainter
Parameters:
cellElement - the cell element
cpctx - the cell painter context
Throws:
java.lang.Exception - When an error occurs
See Also:
ColumnPainter.applyDesignRules(org.apache.ecs.html.TD, com.cc.framework.ui.painter.def.CellPainterContext)

paintCell

public void paintCell(org.apache.ecs.html.TD cellElement,
                      CellPainterContext cpctx)
               throws java.lang.Exception
Description copied from interface: ColumnPainter
Paints a single Cell

Specified by:
paintCell in interface ColumnPainter
Parameters:
cellElement - The cell element
cpctx - the cell painter context
Throws:
java.lang.Exception - When an error occurs
See Also:
ColumnPainter.paintCell( org.apache.ecs.html.TD, com.cc.framework.ui.painter.def.CellPainterContext)

paintEmptyCell

protected void paintEmptyCell(org.apache.ecs.html.TD cellElement,
                              CellPainterContext cpctx)
                       throws java.lang.Exception
The column painter will call this method to render an empty cell

Parameters:
cellElement - The cell element
cpctx - the cell painter context
Throws:
java.lang.Exception - When an error occurs

paintHeader

public void paintHeader(org.apache.ecs.html.TD headerElement,
                        CellPainterContext cpctx)
                 throws java.lang.Exception
Description copied from interface: ColumnPainter
Paints the column header

Specified by:
paintHeader in interface ColumnPainter
Parameters:
headerElement - The header cell
cpctx - the cell painter context
Throws:
java.lang.Exception - When an error occurs
See Also:
ColumnPainter.paintHeader( org.apache.ecs.html.TD, com.cc.framework.ui.painter.def.CellPainterContext)

paintCell

public final void paintCell(org.apache.ecs.html.TD cellElement,
                            PainterContext ctx,
                            ColumnDesignModel column,
                            LineIterator iter)
                     throws java.lang.Exception
Deprecated. please use or overwrite paintCell(TD, CellPainterContext)

Creates a Cell

Parameters:
cellElement - The cell element
ctx - the painter context
column - the columns design model
iter - the row iterator positioned on the current row bean
Throws:
java.lang.Exception - When an error occurs

getBodyContent

protected static java.lang.String getBodyContent(PainterContext ctx,
                                                 ColumnDesignModel column,
                                                 LineIterator iter)
Try to find a previously registered JSP Body for this row bean

Parameters:
ctx - the painter context
column - the columns design model
iter - the iterator with the current row bean
Returns:
Body content or null

applyStyle

protected org.apache.ecs.ConcreteElement applyStyle(org.apache.ecs.ConcreteElement element,
                                                    ColumnDesignModel column)
Applies the column styles to the HTML element

Parameters:
element - HTML element
column - Column
Returns:
the HTML element

applyStyle

protected org.apache.ecs.ConcreteElement applyStyle(org.apache.ecs.ConcreteElement element,
                                                    ColumnDesignModel column,
                                                    boolean addHandlers)
Applies the column styles to the HTML element

Parameters:
element - HTML element
column - Column
addHandlers - This flag indicates that all script handlers should be added to the element
Returns:
the HTML element

createHeaderButtons

protected java.util.Collection createHeaderButtons(PainterContext ctx,
                                                   ColumnDesignModel column)
Creates the buttons for the column header

Parameters:
ctx - the painter context
column - the columns design model
Returns:
collection of ConcreteElement Items

getHeaderImage

protected ImageModel getHeaderImage(ColumnHeaderDesignModel header)
Returns the Image of a column header

Parameters:
header - the header design model
Returns:
ImageModel

paintHeader

public final void paintHeader(org.apache.ecs.html.TD headerElement,
                              PainterContext ctx,
                              ColumnDesignModel column)
                       throws java.lang.Exception
Deprecated. please use or overwrite paintHeader(TD, CellPainterContext)

Creates the column header

Parameters:
headerElement - The header element
ctx - the painter context
column - the columns design model
Throws:
java.lang.Exception - When an error occurs

createCheckAllButton

protected org.apache.ecs.ConcreteElement createCheckAllButton(PainterContext ctx,
                                                              ColumnDesignModel column,
                                                              SelectMode mode)
Creates the check all button

Parameters:
ctx - the painter context
column - the columns design model
mode - the select mode of the list
Returns:
ConcreteElement

createUncheckAllButton

protected org.apache.ecs.ConcreteElement createUncheckAllButton(PainterContext ctx,
                                                                ColumnDesignModel column,
                                                                SelectMode mode)
Creates the uncheck all button

Parameters:
ctx - the painter context
column - the columns design model
mode - the select mode of the list
Returns:
ConcreteElement

createCheckColumnButton

protected org.apache.ecs.ConcreteElement createCheckColumnButton(PainterContext ctx,
                                                                 ColumnDesignModel column)
Creates the check all button

Parameters:
ctx - the painter context
column - the columns design model
Returns:
ConcreteElement

createUncheckColumnButton

protected org.apache.ecs.ConcreteElement createUncheckColumnButton(PainterContext ctx,
                                                                   ColumnDesignModel column)
Creates the uncheck all button

Parameters:
ctx - the painter context
column - the columns design model
Returns:
ConcreteElement

getTarget

protected java.lang.String getTarget(ColumnDesignModel column,
                                     LineIterator iter)
Returns the Target Attribute which should be included in a HyperLink

Parameters:
column - ColumnDesignModel
iter - LineIterator
Returns:
String

getAnchor

protected java.lang.String getAnchor(ColumnDesignModel column,
                                     LineIterator iter)
Returns the Anchor Attribute which should be included in a HyperLink

Parameters:
column - ColumnDesignModel
iter - LineIterator
Returns:
String

getLinkName

protected java.lang.String getLinkName(ColumnDesignModel column,
                                       LineIterator iter)
Returns the Anchor name Attribute which should be included in a HyperLink

Parameters:
column - ColumnDesignModel
iter - LineIterator
Returns:
String

getTooltip

protected java.lang.String getTooltip(PainterContext ctx,
                                      ColumnDesignModel column,
                                      LineIterator iter)
Deprecated. use getTooltip(CellPainterContext) instead

Returns the localized and HTML encoded Tooltip Attribute which should be used for the row

Parameters:
ctx - the painter context
column - ColumnDesignModel
iter - LineIterator
Returns:
String

getTooltip

protected java.lang.String getTooltip(CellPainterContext cpctx)
Returns the localized and HTML encoded Tooltip Attribute which should be used for the row

Parameters:
cpctx - the cell painter context
Returns:
String

isEditable

protected boolean isEditable(PainterContext ctx,
                             ColumnDesignModel column,
                             LineIterator iter)
Deprecated. use isEditable(CellPainterContext) instead

Checks if the column or cell is editable or not

Parameters:
ctx - the painter context
column - The column
iter - the iterator with the current row bean
Returns:
returns true if the cell is editable

isEditable

protected boolean isEditable(CellPainterContext cpctx)
Checks if the column or cell is editable or not

Parameters:
cpctx - the cell painter context
Returns:
returns true if the cell is editable

isDisabled

protected boolean isDisabled(CellPainterContext cpctx)
Checks if the column or cell is disabled or not

Parameters:
cpctx - the cell painter context
Returns:
returns true if the cell is editable

addElement

protected void addElement(org.apache.ecs.html.TD cellElement,
                          CellPainterContext cpctx,
                          ImageModel image,
                          org.apache.ecs.ConcreteElement content)
                   throws java.lang.Exception
Helper to add a content with an optional image to the cell element

Parameters:
cellElement - the cell element
cpctx - the cell painter context
image - optional image
content - the cells content
Throws:
java.lang.Exception - when an error occurs


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