|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.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 ICellStyleProvider
row
- row of the cellcolumn
- col of the cell
public void setRowCellStyle(IRow row, ICellStyle style)
setRowCellStyle
in interface ICellStyleProvider
row
- rowstyle
- cell stylepublic ICellStyle getRowCellStyle(IRow row, boolean create)
getRowCellStyle
in interface ICellStyleProvider
row
- 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 ICellStyleProvider
column
- columnstyle
- stylepublic ICellStyle getColumnCellStyle(IColumn column, boolean create)
getColumnCellStyle
in interface ICellStyleProvider
column
- 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 ICellStyleProvider
row
- 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 ICellStyleProvider
row
- row of the cellcolumn
- column of the cellstyle
- style to usepublic ICellStyle getDefaultCellStyle()
getDefaultCellStyle
in interface ICellStyleProvider
public void setDefaultCellStyle(ICellStyle cellStyle)
setDefaultCellStyle
in interface ICellStyleProvider
cellStyle
- cell style to use as the default cell stylepublic void addCellStyleListener(ICellStyleListener csl)
addCellStyleListener
in interface ICellStyleProvider
csl
- listenerpublic void remCellStyleListener(ICellStyleListener csl)
remCellStyleListener
in interface ICellStyleProvider
csl
- listener to removeprotected 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.PropertyChangeListener
public IStyleStrategy getStyleStrategy()
getStyleStrategy
in interface ICellStyleProvider
null
public void setStyleStrategy(IStyleStrategy startegy)
setStyleStrategy
in interface ICellStyleProvider
startegy
- strategy to usepublic void setBackground(IRow row, org.eclipse.swt.graphics.RGB background)
setBackground
in interface ICellStyleProvider
row
- rowbackground
- background colorpublic void setBackground(IColumn column, org.eclipse.swt.graphics.RGB background)
setBackground
in interface ICellStyleProvider
column
- columnbackground
- background colorpublic void setBackground(IRow row, IColumn column, org.eclipse.swt.graphics.RGB background)
setBackground
in interface ICellStyleProvider
row
- row of th cellcolumn
- column of the cellbackground
- background colorpublic void setForeground(IRow row, org.eclipse.swt.graphics.RGB foreground)
setForeground
in interface ICellStyleProvider
row
- rowforeground
- background colorpublic void setForeground(IColumn column, org.eclipse.swt.graphics.RGB foreground)
setForeground
in interface ICellStyleProvider
column
- columnforeground
- foreground colorpublic void setForeground(IRow row, IColumn column, org.eclipse.swt.graphics.RGB foreground)
setForeground
in interface ICellStyleProvider
row
- row of th cellcolumn
- column of the cellforeground
- foreground colorpublic void setHorizontalAlignment(IRow row, ITableViewState.HAlignment alignment)
setHorizontalAlignment
in interface ICellStyleProvider
row
- rowalignment
- horizontal alignmentpublic void setHorizontalAlignment(IColumn column, ITableViewState.HAlignment alignment)
setHorizontalAlignment
in interface ICellStyleProvider
column
- columnalignment
- horizontal alignmentpublic void setHorizontalAlignment(IRow row, IColumn column, ITableViewState.HAlignment alignment)
setHorizontalAlignment
in interface ICellStyleProvider
row
- row of th cellcolumn
- column of the cellalignment
- horizontal alignmentpublic void setVerticalAlignment(IRow row, ITableViewState.VAlignment alignment)
setVerticalAlignment
in interface ICellStyleProvider
row
- rowalignment
- vertical alignmentpublic void setVerticalAlignment(IColumn column, ITableViewState.VAlignment alignment)
setVerticalAlignment
in interface ICellStyleProvider
column
- columnalignment
- vertical alignmentpublic void setVerticalAlignment(IRow row, IColumn column, ITableViewState.VAlignment alignment)
setVerticalAlignment
in interface ICellStyleProvider
row
- row of th cellcolumn
- column of the cellalignment
- vertical alignmentpublic void setFont(IRow row, org.eclipse.swt.graphics.FontData fontdata)
setFont
in interface ICellStyleProvider
row
- rowfontdata
- font data for the font to usepublic void setFont(IColumn column, org.eclipse.swt.graphics.FontData fontdata)
setFont
in interface ICellStyleProvider
column
- columnfontdata
- font data for the font to usepublic void setFont(IRow row, IColumn column, org.eclipse.swt.graphics.FontData fontdata)
setFont
in interface ICellStyleProvider
row
- 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 |