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

java.lang.Object
  extended bycom.cc.framework.ui.painter.imp.PainterContextWrapper
      extended bycom.cc.framework.ui.painter.def.CellPainterContext
All Implemented Interfaces:
HttpContext, PainterContext, RequestContext

public class CellPainterContext
extends PainterContextWrapper
implements PainterContext

Painter context for cell elements. The purpose of this class is to reduce the number of arguments that have to be passed to the rendering methods. It also allows us to pass additional information to the column painters without breaking the interface.

Version:
$Revision$
Author:
Harald Schulz

Field Summary
private  ColumnDesignModel column
          The current column
private  int columnIndex
          the Index for the current column
private  int columns
          The number of columns
private  JoinMode joinMode
          This flag indicates a joined column
private  LineIterator lineIterator
          The line iterator with the current line
private  int pageIndex
          the index of the current page
private  ColumnPainter painter
          The column painter
private  int rowPageIndex
          the index of the current row form the top of the current page
private  int rowsPerPage
          The number of rows on the current page
private  SortOrder sortOrder
          The sort order of the current column
private  int tabIndex
          the Tab Index for a nested input field
 
Fields inherited from class com.cc.framework.ui.painter.imp.PainterContextWrapper
 
Constructor Summary
CellPainterContext(PainterContext painterContext)
          Creates a new Cell Painter Context object
 
Method Summary
 java.lang.Object getCellValue()
           
 ColumnDesignModel getColumn()
           
 int getColumnIndex()
           
 int getColumns()
           
 JoinMode getJoinMode()
           
 LineIterator getLineIterator()
          Returns the iterator which is positioned on the current Row Bean.
 int getPageIndex()
           
 ColumnPainter getPainter()
           
 PainterContext getPainterContext()
          Deprecated. the CellPainterContext implements now the PainterContext interface so this method is not required any longer. Just use CellPainterContext directly.
 int getRowPageIndex()
           
 int getRowsPerPage()
           
 SortOrder getSortOrder()
          Returns the sort order for the current column.
 int getTabIndex()
           
 boolean isJoined()
           
 void reset()
          This method releases all internal references
 void setColumn(ColumnDesignModel column, SortOrder sortOrder, ColumnPainter painter)
          Selects the current column.
 void setColumnIndex(int columnIndex)
           
 void setColumns(int columns)
           
 void setJoinMode(JoinMode joinMode)
           
 void setLineIterator(LineIterator lineIterator)
           
 void setPageIndex(int pageIndex)
           
 void setRowPageIndex(int rowPageIndex)
           
 void setRowsPerPage(int rowsPerPage)
           
 void setTabIndex(int tabIndex)
           
 void setTabIndex(OrientationType orientation, int tabIndexBase)
          Calculates the Tabulator index for the current cell based on the given keyboard navigation schema.
 
Methods inherited from class com.cc.framework.ui.painter.imp.PainterContextWrapper
attr, attr, attr, close, createActionPainter, createActionPainter, createImage, createImage, createImage, createImage, createInput, createInput, decorateURL, getAsString, getAttribute, getAttribute, getAwtColor, getColor, getControl, getElementName, getFrameworkString, getFrameworkString, getImage, getImage, getImage, getImageSrc, getImageSrc, getImageSrc, getLocale, getNestedContext, getPageContext, getPrincipal, getResourceDir, getServletContext, getSource, getSource, getStringResource, getStyleId, hasAttribute, html, html, html, isDisplayOnly, isRunAtClient, localize, localize, localize, localizeKey, open, popAttributes, pushAttributes, removeAttribute, removeHtml, removeHtml, request, response, session, setAttribute, setFactory, showComments, truncate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.cc.framework.ui.painter.PainterContext
attr, attr, attr, close, createActionPainter, createActionPainter, createImage, createImage, createImage, createImage, createInput, createInput, decorateURL, getAsString, getAttribute, getAwtColor, getColor, getControl, getElementName, getFrameworkString, getFrameworkString, getImage, getImage, getImage, getImageSrc, getImageSrc, getImageSrc, getLocale, getPageContext, getResourceDir, getSource, getSource, getStringResource, getStyleId, hasAttribute, html, html, html, isDisplayOnly, isRunAtClient, localize, localize, localize, localizeKey, open, popAttributes, pushAttributes, removeAttribute, removeHtml, removeHtml, setAttribute, setFactory, showComments, truncate
 
Methods inherited from interface com.cc.framework.adapter.RequestContext
getNestedContext, getPrincipal
 
Methods inherited from interface com.cc.framework.http.HttpContext
getAttribute, getServletContext, request, response, session
 

Field Detail

column

private ColumnDesignModel column
The current column


columnIndex

private int columnIndex
the Index for the current column


columns

private int columns
The number of columns


joinMode

private JoinMode joinMode
This flag indicates a joined column


lineIterator

private LineIterator lineIterator
The line iterator with the current line


rowPageIndex

private int rowPageIndex
the index of the current row form the top of the current page


rowsPerPage

private int rowsPerPage
The number of rows on the current page


pageIndex

private int pageIndex
the index of the current page


painter

private ColumnPainter painter
The column painter


sortOrder

private SortOrder sortOrder
The sort order of the current column


tabIndex

private int tabIndex
the Tab Index for a nested input field

Constructor Detail

CellPainterContext

public CellPainterContext(PainterContext painterContext)
Creates a new Cell Painter Context object

Parameters:
painterContext - The control's painter context
Method Detail

reset

public void reset()
This method releases all internal references


getPainterContext

public PainterContext getPainterContext()
Deprecated. the CellPainterContext implements now the PainterContext interface so this method is not required any longer. Just use CellPainterContext directly.

Returns:
returns the PainterContext

getColumn

public ColumnDesignModel getColumn()
Returns:
The Columns Design Model

getCellValue

public java.lang.Object getCellValue()
Returns:
returns the value of the selected cell

getColumnIndex

public int getColumnIndex()
Returns:
Returns the Index for the current column

getColumns

public int getColumns()
Returns:
Returns the number of columns.

getLineIterator

public LineIterator getLineIterator()
Returns the iterator which is positioned on the current Row Bean.

Returns:
Line Iterator

getRowPageIndex

public int getRowPageIndex()
Returns:
Returns the index of the current Line form the top of the current page

getRowsPerPage

public int getRowsPerPage()
Returns:
Returns the number of lines per page or -1 if the number of lines is not limited

getPageIndex

public int getPageIndex()
Returns:
Returns the index of the current page

getPainter

public ColumnPainter getPainter()
Returns:
Returns the column painter.

getSortOrder

public SortOrder getSortOrder()
Returns the sort order for the current column.

Returns:
SortOrder

getTabIndex

public int getTabIndex()
Returns:
Returns the Tab Index for a nested input field

isJoined

public boolean isJoined()
Returns:
Returns true when the cell should be joined to the previous cell

getJoinMode

public JoinMode getJoinMode()
Returns:
returns the column join mode

setColumn

public void setColumn(ColumnDesignModel column,
                      SortOrder sortOrder,
                      ColumnPainter painter)
Selects the current column. This will internally increment the column index and reset the join attribute

Parameters:
column - The column to set.
sortOrder - The sortOrder to set.
painter - The column painter to set.

setColumnIndex

public void setColumnIndex(int columnIndex)
Parameters:
columnIndex - The columnIndex to set.

setColumns

public void setColumns(int columns)
Parameters:
columns - The number of columns to set.

setJoinMode

public void setJoinMode(JoinMode joinMode)
Parameters:
joinMode - The column join mode

setLineIterator

public void setLineIterator(LineIterator lineIterator)
Parameters:
lineIterator - The lineIterator to set.

setRowPageIndex

public void setRowPageIndex(int rowPageIndex)
Parameters:
rowPageIndex - The linePageIndex to set.

setRowsPerPage

public void setRowsPerPage(int rowsPerPage)
Parameters:
rowsPerPage - The rows per page to set. -1 if the number of rows is not limited

setPageIndex

public void setPageIndex(int pageIndex)
Parameters:
pageIndex - The pageIndex to set.

setTabIndex

public void setTabIndex(int tabIndex)
Parameters:
tabIndex - The tabIndex to set.

setTabIndex

public void setTabIndex(OrientationType orientation,
                        int tabIndexBase)
Calculates the Tabulator index for the current cell based on the given keyboard navigation schema.

Parameters:
orientation - Tabulator orientation in this grid
tabIndexBase - The Tabulator base index. That is the index for the first cell of the grid


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