de.jaret.util.ui.table.renderer
Interface ICellStyleProvider

All Known Implementing Classes:
DefaultCellStyleProvider

public interface ICellStyleProvider

Interface for a cell style supplier. The cell style provider is responsible for storing the individual cell styles. It is possible to define a single style for a row, a column or a specific cell. A default cell style is used whenever no specific cell style has been set.

The interface operates on cell styles. In some cases this is quite inconvenient so som econvience methods have been added to support direct setting of the properties.

Version:
$Id: ICellStyleProvider.java 347 2007-04-07 15:01:10Z olk $
Author:
Peter Kliem

Method Summary
 void addCellStyleListener(ICellStyleListener csl)
          Add a listener to listen on cell style changes.
 ICellStyle getCellSpecificStyle(IRow row, IColumn column, boolean create)
          Get the cell style defined for a single cell.
 ICellStyle getCellStyle(IRow row, IColumn column)
          Retrieve the cell style for a cell.
 ICellStyle getColumnCellStyle(IColumn column, boolean create)
          Retrieve the cell style for a column.
 ICellStyle getDefaultCellStyle()
          Retrieve the default cell style used for cells where no style has been set.
 ICellStyle getRowCellStyle(IRow row, boolean create)
          Retrieve the cell style for a row.
 IStyleStrategy getStyleStrategy()
          Retrieve a style strategy if set.
 void remCellStyleListener(ICellStyleListener csl)
          Remove a cell sytle listener.
 void setBackground(IColumn column, org.eclipse.swt.graphics.RGB background)
          Convenience method for setting the background of a column.
 void setBackground(IRow row, IColumn column, org.eclipse.swt.graphics.RGB background)
          Convenience method for setting the background of a cell.
 void setBackground(IRow row, org.eclipse.swt.graphics.RGB background)
          Convenience method for setting the background of a row.
 void setCellStyle(IRow row, IColumn column, ICellStyle style)
          Set the cell style to use for a specific cell.
 void setColumnCellStyle(IColumn column, ICellStyle style)
          Set the cell style for a column.
 void setDefaultCellStyle(ICellStyle cellStyle)
          Set the default cell style that is used whenever no specific style has been set for a cell, column or row.
 void setFont(IColumn column, org.eclipse.swt.graphics.FontData fontdata)
          Convenience method for setting the font.
 void setFont(IRow row, org.eclipse.swt.graphics.FontData fontdata)
          Convenience method for setting the font.
 void setFont(IRow row, IColumn column, org.eclipse.swt.graphics.FontData fontdata)
          Convenience method for setting the font.
 void setForeground(IColumn column, org.eclipse.swt.graphics.RGB foreground)
          Convenience method for setting the foreground of a column.
 void setForeground(IRow row, IColumn column, org.eclipse.swt.graphics.RGB foreground)
          Convenience method for setting the foreground of a cell.
 void setForeground(IRow row, org.eclipse.swt.graphics.RGB foreground)
          Convenience method for setting the foreground of a row.
 void setHorizontalAlignment(IColumn column, ITableViewState.HAlignment hAlignment)
          Convenience method for setting the horizontal alignment.
 void setHorizontalAlignment(IRow row, IColumn column, ITableViewState.HAlignment hAlignment)
          Convenience method for setting the horizontal alignment.
 void setHorizontalAlignment(IRow row, ITableViewState.HAlignment hAlignment)
          Convenience method for setting the horizontal alignment.
 void setRowCellStyle(IRow row, ICellStyle style)
          Set the cell style for a row.
 void setStyleStrategy(IStyleStrategy startegy)
          Set a style strategy to be involved when delivering styles.
 void setVerticalAlignment(IColumn column, ITableViewState.VAlignment vAlignment)
          Convenience method for setting the vertical alignment.
 void setVerticalAlignment(IRow row, IColumn column, ITableViewState.VAlignment vAlignment)
          Convenience method for setting the vertical alignment.
 void setVerticalAlignment(IRow row, ITableViewState.VAlignment vAlignment)
          Convenience method for setting the vertical alignment.
 

Method Detail

setStyleStrategy

void setStyleStrategy(IStyleStrategy startegy)
Set a style strategy to be involved when delivering styles.

Parameters:
startegy - strategy to use

getStyleStrategy

IStyleStrategy getStyleStrategy()
Retrieve a style strategy if set.

Returns:
the strategy or null

getCellStyle

ICellStyle getCellStyle(IRow row,
                        IColumn column)
Retrieve the cell style for a cell. This method should not create CellStyle objects.

Parameters:
row - row of the cell
column - col of the cell
Returns:
cell style for the specified cell

getCellSpecificStyle

ICellStyle getCellSpecificStyle(IRow row,
                                IColumn column,
                                boolean create)
Get the cell style defined for a single cell. Should create a new CellStyle object if create is true.

Parameters:
row - row of the cell
column - column of the cell
create - true will signal to create a new style object if necessary
Returns:
cell style for the cell

getColumnCellStyle

ICellStyle getColumnCellStyle(IColumn column,
                              boolean create)
Retrieve the cell style for a column.

Parameters:
column - column
create - if true and no style has been set for the column, create a copy of the default cell style
Returns:
the cellstyle for the colun which might be the default cell style if create is set to false

setColumnCellStyle

void setColumnCellStyle(IColumn column,
                        ICellStyle style)
Set the cell style for a column.

Parameters:
column - column
style - style

getRowCellStyle

ICellStyle getRowCellStyle(IRow row,
                           boolean create)
Retrieve the cell style for a row.

Parameters:
row - row
create - if true and no style has been set for the row, create a copy of the default cell style
Returns:
the cellstyle for the row which might be the default cell style if create is set to false

setRowCellStyle

void setRowCellStyle(IRow row,
                     ICellStyle style)
Set the cell style for a row.

Parameters:
row - row
style - cell style

setCellStyle

void setCellStyle(IRow row,
                  IColumn column,
                  ICellStyle style)
Set the cell style to use for a specific cell.

Parameters:
row - row of the cell
column - column of the cell
style - style to use

getDefaultCellStyle

ICellStyle getDefaultCellStyle()
Retrieve the default cell style used for cells where no style has been set. If the returned cell style is modified, this applies for all default styled cells.

Returns:
the default cell style.

setDefaultCellStyle

void setDefaultCellStyle(ICellStyle cellStyle)
Set the default cell style that is used whenever no specific style has been set for a cell, column or row.

Parameters:
cellStyle - cell style to use as the default cell style

addCellStyleListener

void addCellStyleListener(ICellStyleListener csl)
Add a listener to listen on cell style changes.

Parameters:
csl - listener

remCellStyleListener

void remCellStyleListener(ICellStyleListener csl)
Remove a cell sytle listener.

Parameters:
csl - listener to remove

setBackground

void setBackground(IRow row,
                   org.eclipse.swt.graphics.RGB background)
Convenience method for setting the background of a row. This method will manipulate or create a style.

Parameters:
row - row
background - background color

setBackground

void setBackground(IColumn column,
                   org.eclipse.swt.graphics.RGB background)
Convenience method for setting the background of a column. This method will manipulate or create a style.

Parameters:
column - column
background - background color

setBackground

void setBackground(IRow row,
                   IColumn column,
                   org.eclipse.swt.graphics.RGB background)
Convenience method for setting the background of a cell. This method will manipulate or create a style.

Parameters:
row - row of th cell
column - column of the cell
background - background color

setForeground

void setForeground(IRow row,
                   org.eclipse.swt.graphics.RGB foreground)
Convenience method for setting the foreground of a row. This method will manipulate or create a style.

Parameters:
row - row
foreground - background color

setForeground

void setForeground(IColumn column,
                   org.eclipse.swt.graphics.RGB foreground)
Convenience method for setting the foreground of a column. This method will manipulate or create a style.

Parameters:
column - column
foreground - foreground color

setForeground

void setForeground(IRow row,
                   IColumn column,
                   org.eclipse.swt.graphics.RGB foreground)
Convenience method for setting the foreground of a cell. This method will manipulate or create a style.

Parameters:
row - row of th cell
column - column of the cell
foreground - foreground color

setHorizontalAlignment

void setHorizontalAlignment(IRow row,
                            ITableViewState.HAlignment hAlignment)
Convenience method for setting the horizontal alignment. The method will create a cell style for the element or manipulate the already set style.

Parameters:
row - row
hAlignment - horizontal alignment

setHorizontalAlignment

void setHorizontalAlignment(IColumn column,
                            ITableViewState.HAlignment hAlignment)
Convenience method for setting the horizontal alignment. The method will create a cell style for the element or manipulate the already set style.

Parameters:
column - column
hAlignment - horizontal alignment

setHorizontalAlignment

void setHorizontalAlignment(IRow row,
                            IColumn column,
                            ITableViewState.HAlignment hAlignment)
Convenience method for setting the horizontal alignment. The method will create a cell style for the element or manipulate the already set style.

Parameters:
row - row of th cell
column - column of the cell
hAlignment - horizontal alignment

setVerticalAlignment

void setVerticalAlignment(IRow row,
                          ITableViewState.VAlignment vAlignment)
Convenience method for setting the vertical alignment. The method will create a cell style for the element or manipulate the already set style.

Parameters:
row - row
vAlignment - vertical alignment

setVerticalAlignment

void setVerticalAlignment(IColumn column,
                          ITableViewState.VAlignment vAlignment)
Convenience method for setting the vertical alignment. The method will create a cell style for the element or manipulate the already set style.

Parameters:
column - column
vAlignment - vertical alignment

setVerticalAlignment

void setVerticalAlignment(IRow row,
                          IColumn column,
                          ITableViewState.VAlignment vAlignment)
Convenience method for setting the vertical alignment. The method will create a cell style for the element or manipulate the already set style.

Parameters:
row - row of th cell
column - column of the cell
vAlignment - vertical alignment

setFont

void setFont(IRow row,
             org.eclipse.swt.graphics.FontData fontdata)
Convenience method for setting the font. The method will create a cell style for the element or manipulate the already set style.

Parameters:
row - row
fontdata - font data for the font to use

setFont

void setFont(IColumn column,
             org.eclipse.swt.graphics.FontData fontdata)
Convenience method for setting the font. The method will create a cell style for the element or manipulate the already set style.

Parameters:
column - column
fontdata - font data for the font to use

setFont

void setFont(IRow row,
             IColumn column,
             org.eclipse.swt.graphics.FontData fontdata)
Convenience method for setting the font. The method will create a cell style for the element or manipulate the already set style.

Parameters:
row - row of th cell
column - column of the cell
fontdata - font data for the font to use


Copyright © 2012. All Rights Reserved.