|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.jaret.util.ui.table.renderer.DefaultCellStyleProvider
public class DefaultCellStyleProvider
A Default implementation of a CellStyleProvider. It will register itself with every cell style as a property change listener.
| Field Summary | |
|---|---|
protected java.util.Map<IRow,java.util.Map<IColumn,ICellStyle>> |
_cellMap
map combintaion storing the style of a cell . |
protected java.util.Map<IColumn,ICellStyle> |
_columnMap
map storing the column cell styles. |
protected ICellStyle |
_defaultCellStyle
the default cell style. |
protected ICellStyle |
_defaultCellStyleAlignRight
the default cell style aligned right. |
protected java.util.List<ICellStyleListener> |
_listeners
the listener list. |
protected java.util.Map<IRow,ICellStyle> |
_rowMap
map storing the row cell styles. |
protected IStyleStrategy |
_styleStrategy
style stategy. |
| Constructor Summary | |
|---|---|
DefaultCellStyleProvider()
Constructor. |
|
| Method Summary | |
|---|---|
void |
addCellStyleListener(ICellStyleListener csl)
Add a listener to listen on cell style changes. |
protected void |
fireCellStyleChanged(IRow row,
IColumn column,
ICellStyle cellStyle)
Inform listeners about a cell style change. |
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. |
protected java.util.List<IJaretTableCell> |
getStyleLocations(ICellStyle style)
Retrieve all cells that have a certain style. |
IStyleStrategy |
getStyleStrategy()
Retrieve a style strategy if set. |
void |
propertyChange(java.beans.PropertyChangeEvent event)
Listens to all styles and fires style changed for every location a style is used in. |
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 alignment)
Convenience method for setting the horizontal alignment. |
void |
setHorizontalAlignment(IRow row,
IColumn column,
ITableViewState.HAlignment alignment)
Convenience method for setting the horizontal alignment. |
void |
setHorizontalAlignment(IRow row,
ITableViewState.HAlignment alignment)
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 alignment)
Convenience method for setting the vertical alignment. |
void |
setVerticalAlignment(IRow row,
IColumn column,
ITableViewState.VAlignment alignment)
Convenience method for setting the vertical alignment. |
void |
setVerticalAlignment(IRow row,
ITableViewState.VAlignment alignment)
Convenience method for setting the vertical alignment. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.Map<IRow,ICellStyle> _rowMap
protected java.util.Map<IColumn,ICellStyle> _columnMap
protected java.util.Map<IRow,java.util.Map<IColumn,ICellStyle>> _cellMap
protected java.util.List<ICellStyleListener> _listeners
protected ICellStyle _defaultCellStyle
protected ICellStyle _defaultCellStyleAlignRight
protected IStyleStrategy _styleStrategy
| Constructor Detail |
|---|
public DefaultCellStyleProvider()
| Method Detail |
|---|
public ICellStyle getCellStyle(IRow row,
IColumn column)
getCellStyle in interface ICellStyleProviderrow - row of the cellcolumn - col of the cell
public void setRowCellStyle(IRow row,
ICellStyle style)
setRowCellStyle in interface ICellStyleProviderrow - rowstyle - cell style
public ICellStyle getRowCellStyle(IRow row,
boolean create)
getRowCellStyle in interface ICellStyleProviderrow - rowcreate - if true and no style has been set for the row, create a copy of the default cell style
public void setColumnCellStyle(IColumn column,
ICellStyle style)
setColumnCellStyle in interface ICellStyleProvidercolumn - columnstyle - style
public ICellStyle getColumnCellStyle(IColumn column,
boolean create)
getColumnCellStyle in interface ICellStyleProvidercolumn - columncreate - if true and no style has been set for the column, create a copy of the default cell style
public ICellStyle getCellSpecificStyle(IRow row,
IColumn column,
boolean create)
getCellSpecificStyle in interface ICellStyleProviderrow - row of the cellcolumn - column of the cellcreate - true will signal to create a new style object if necessary
public void setCellStyle(IRow row,
IColumn column,
ICellStyle style)
setCellStyle in interface ICellStyleProviderrow - row of the cellcolumn - column of the cellstyle - style to usepublic ICellStyle getDefaultCellStyle()
getDefaultCellStyle in interface ICellStyleProviderpublic void setDefaultCellStyle(ICellStyle cellStyle)
setDefaultCellStyle in interface ICellStyleProvidercellStyle - cell style to use as the default cell stylepublic void addCellStyleListener(ICellStyleListener csl)
addCellStyleListener in interface ICellStyleProvidercsl - listenerpublic void remCellStyleListener(ICellStyleListener csl)
remCellStyleListener in interface ICellStyleProvidercsl - listener to remove
protected void fireCellStyleChanged(IRow row,
IColumn column,
ICellStyle cellStyle)
row - row affectedcolumn - olumn affectedcellStyle - new styleprotected java.util.List<IJaretTableCell> getStyleLocations(ICellStyle style)
style - the style to search
public void propertyChange(java.beans.PropertyChangeEvent event)
propertyChange in interface java.beans.PropertyChangeListenerpublic IStyleStrategy getStyleStrategy()
getStyleStrategy in interface ICellStyleProvidernullpublic void setStyleStrategy(IStyleStrategy startegy)
setStyleStrategy in interface ICellStyleProviderstartegy - strategy to use
public void setBackground(IRow row,
org.eclipse.swt.graphics.RGB background)
setBackground in interface ICellStyleProviderrow - rowbackground - background color
public void setBackground(IColumn column,
org.eclipse.swt.graphics.RGB background)
setBackground in interface ICellStyleProvidercolumn - columnbackground - background color
public void setBackground(IRow row,
IColumn column,
org.eclipse.swt.graphics.RGB background)
setBackground in interface ICellStyleProviderrow - row of th cellcolumn - column of the cellbackground - background color
public void setForeground(IRow row,
org.eclipse.swt.graphics.RGB foreground)
setForeground in interface ICellStyleProviderrow - rowforeground - background color
public void setForeground(IColumn column,
org.eclipse.swt.graphics.RGB foreground)
setForeground in interface ICellStyleProvidercolumn - columnforeground - foreground color
public void setForeground(IRow row,
IColumn column,
org.eclipse.swt.graphics.RGB foreground)
setForeground in interface ICellStyleProviderrow - row of th cellcolumn - column of the cellforeground - foreground color
public void setHorizontalAlignment(IRow row,
ITableViewState.HAlignment alignment)
setHorizontalAlignment in interface ICellStyleProviderrow - rowalignment - horizontal alignment
public void setHorizontalAlignment(IColumn column,
ITableViewState.HAlignment alignment)
setHorizontalAlignment in interface ICellStyleProvidercolumn - columnalignment - horizontal alignment
public void setHorizontalAlignment(IRow row,
IColumn column,
ITableViewState.HAlignment alignment)
setHorizontalAlignment in interface ICellStyleProviderrow - row of th cellcolumn - column of the cellalignment - horizontal alignment
public void setVerticalAlignment(IRow row,
ITableViewState.VAlignment alignment)
setVerticalAlignment in interface ICellStyleProviderrow - rowalignment - vertical alignment
public void setVerticalAlignment(IColumn column,
ITableViewState.VAlignment alignment)
setVerticalAlignment in interface ICellStyleProvidercolumn - columnalignment - vertical alignment
public void setVerticalAlignment(IRow row,
IColumn column,
ITableViewState.VAlignment alignment)
setVerticalAlignment in interface ICellStyleProviderrow - row of th cellcolumn - column of the cellalignment - vertical alignment
public void setFont(IRow row,
org.eclipse.swt.graphics.FontData fontdata)
setFont in interface ICellStyleProviderrow - rowfontdata - font data for the font to use
public void setFont(IColumn column,
org.eclipse.swt.graphics.FontData fontdata)
setFont in interface ICellStyleProvidercolumn - columnfontdata - font data for the font to use
public void setFont(IRow row,
IColumn column,
org.eclipse.swt.graphics.FontData fontdata)
setFont in interface ICellStyleProviderrow - row of th cellcolumn - column of the cellfontdata - font data for the font to use
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||