Package org.zkoss.pivot.impl
Class SimplePivotRenderer
- java.lang.Object
-
- org.zkoss.pivot.impl.SimplePivotRenderer
-
- All Implemented Interfaces:
PivotRenderer
,PivotRendererExt
public class SimplePivotRenderer extends Object implements PivotRendererExt
A basic implementation of PivotRenderer.- Author:
- simonpai
-
-
Constructor Summary
Constructors Constructor Description SimplePivotRenderer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getColumnSize(Pivottable table, PivotHeaderContext colc, PivotField field)
Returns the column size in pixel.int
getRowSize(Pivottable table, PivotHeaderContext rowc, PivotField field)
Returns the row size in pixel.String
renderCell(Number data, Pivottable table, PivotHeaderContext rowContext, PivotHeaderContext columnContext, PivotField dataField)
Renders the content of each cell.String
renderCellSClass(Number data, Pivottable table, PivotHeaderContext rowContext, PivotHeaderContext columnContext, PivotField dataField)
Specify a CSS class on the cell.String
renderCellStyle(Number data, Pivottable table, PivotHeaderContext rowContext, PivotHeaderContext columnContext, PivotField dataField)
Specify the CSS style on the cell.String
renderDataField(PivotField field)
Renders the label of a data field, shown when there are multiple data fields.String
renderField(Object data, Pivottable table, PivotField field)
Renders the label of a header field in columns and rows.String
renderGrandTotalField(Pivottable table, PivotField field)
Renders the title of a grand total field.String
renderSubtotalField(Object data, Pivottable table, PivotField field, Calculator calculator)
Renders the label of a subtotal field.
-
-
-
Method Detail
-
renderCell
public String renderCell(Number data, Pivottable table, PivotHeaderContext rowContext, PivotHeaderContext columnContext, PivotField dataField)
Description copied from interface:PivotRenderer
Renders the content of each cell. (excluding row fields, column fields)- Specified by:
renderCell
in interfacePivotRenderer
- Parameters:
data
- data objectrowContext
- row header context objectcolumnContext
- column header context object- See Also:
PivotHeaderContext
-
getColumnSize
public int getColumnSize(Pivottable table, PivotHeaderContext colc, PivotField field)
Description copied from interface:PivotRenderer
Returns the column size in pixel.Note that the cell field always from 0 to m, and the returned value is never negative.
- Specified by:
getColumnSize
in interfacePivotRenderer
- Parameters:
table
- the Pivottablecolc
- information of the corresponding columnfield
- the field corresponds to the leaf column cell. Can be row, column, data field, or null (only in the case of grand total)
-
getRowSize
public int getRowSize(Pivottable table, PivotHeaderContext rowc, PivotField field)
Description copied from interface:PivotRenderer
Returns the row size in pixel.Note that the cell field always from 0 to m, and the returned value is never negative.
- Specified by:
getRowSize
in interfacePivotRenderer
- Parameters:
table
- the Pivottablerowc
- information of the corresponding rowfield
- the field corresponds to the leaf row cell. Can be row, column, data field, or null (only in the case of grand total)
-
renderField
public String renderField(Object data, Pivottable table, PivotField field)
Description copied from interface:PivotRenderer
Renders the label of a header field in columns and rows.- Specified by:
renderField
in interfacePivotRenderer
- Parameters:
data
- data objectfield
- PivotField- See Also:
PivotField
-
renderGrandTotalField
public String renderGrandTotalField(Pivottable table, PivotField field)
Description copied from interface:PivotRenderer
Renders the title of a grand total field.- Specified by:
renderGrandTotalField
in interfacePivotRenderer
field
- a data PivotField
-
renderSubtotalField
public String renderSubtotalField(Object data, Pivottable table, PivotField field, Calculator calculator)
Description copied from interface:PivotRenderer
Renders the label of a subtotal field.- Specified by:
renderSubtotalField
in interfacePivotRenderer
- Parameters:
data
- data objectfield
- PivotFieldcalculator
- the subtotal calculator- See Also:
PivotField
,Calculator
-
renderDataField
public String renderDataField(PivotField field)
Description copied from interface:PivotRenderer
Renders the label of a data field, shown when there are multiple data fields.- Specified by:
renderDataField
in interfacePivotRenderer
-
renderCellSClass
public String renderCellSClass(Number data, Pivottable table, PivotHeaderContext rowContext, PivotHeaderContext columnContext, PivotField dataField)
Description copied from interface:PivotRendererExt
Specify a CSS class on the cell.- Specified by:
renderCellSClass
in interfacePivotRendererExt
- Parameters:
data
- data objectrowContext
- row header context objectcolumnContext
- column header context object- Returns:
- a CSS class name, or null to ignore
- See Also:
PivotHeaderContext
-
renderCellStyle
public String renderCellStyle(Number data, Pivottable table, PivotHeaderContext rowContext, PivotHeaderContext columnContext, PivotField dataField)
Description copied from interface:PivotRendererExt
Specify the CSS style on the cell.- Specified by:
renderCellStyle
in interfacePivotRendererExt
- Parameters:
data
- data objectrowContext
- row header context objectcolumnContext
- column header context object- Returns:
- a CSS style string, or null to ignore
- See Also:
PivotHeaderContext
-
-