Class ColumnGroupHeaderTextPainter
- java.lang.Object
-
- org.eclipse.nebula.widgets.nattable.painter.cell.AbstractCellPainter
-
- org.eclipse.nebula.widgets.nattable.painter.cell.CellPainterWrapper
-
- org.eclipse.nebula.widgets.nattable.group.painter.ColumnGroupHeaderTextPainter
-
- All Implemented Interfaces:
ICellPainter
public class ColumnGroupHeaderTextPainter extends CellPainterWrapper
-
-
Constructor Summary
Constructors Constructor Description ColumnGroupHeaderTextPainter()
Creates the defaultColumnGroupHeaderTextPainter
that uses aTextPainter
as baseICellPainter
and decorate it with theColumnGroupExpandCollapseImagePainter
on the right edge of the cell.ColumnGroupHeaderTextPainter(ICellPainter interiorPainter)
Creates aColumnGroupHeaderTextPainter
that uses the givenICellPainter
as baseICellPainter
and decorate it with theColumnGroupExpandCollapseImagePainter
on the right edge of the cell.ColumnGroupHeaderTextPainter(ICellPainter interiorPainter, boolean paintBg, boolean interiorPainterToSpanFullWidth)
Creates aColumnGroupHeaderTextPainter
that uses the givenICellPainter
as baseICellPainter
and decorate it with theColumnGroupExpandCollapseImagePainter
on the right edge of the cell.ColumnGroupHeaderTextPainter(ICellPainter interiorPainter, CellEdgeEnum cellEdge)
Creates aColumnGroupHeaderTextPainter
that uses the givenICellPainter
as baseICellPainter
and decorate it with theColumnGroupExpandCollapseImagePainter
on the specified edge of the cell.ColumnGroupHeaderTextPainter(ICellPainter interiorPainter, CellEdgeEnum cellEdge, boolean paintBg, int spacing, boolean paintDecorationDependent)
ColumnGroupHeaderTextPainter(ICellPainter interiorPainter, CellEdgeEnum cellEdge, ICellPainter decoratorPainter)
Creates aColumnGroupHeaderTextPainter
that uses the givenICellPainter
as baseICellPainter
and decorate it with the givenICellPainter
to use for column group related decoration on the specified edge of the cell.ColumnGroupHeaderTextPainter(ICellPainter interiorPainter, CellEdgeEnum cellEdge, ICellPainter decoratorPainter, boolean paintBg, int spacing, boolean paintDecorationDependent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getPreferredHeight(ILayerCell cell, org.eclipse.swt.graphics.GC gc, IConfigRegistry configRegistry)
Get the preferred height of the cell when rendered by this painter.int
getPreferredWidth(ILayerCell cell, org.eclipse.swt.graphics.GC gc, IConfigRegistry configRegistry)
Preferred width is used during auto resize.-
Methods inherited from class org.eclipse.nebula.widgets.nattable.painter.cell.CellPainterWrapper
getCellPainterAt, getWrappedPainter, getWrappedPainterBounds, paintCell, setWrappedPainter
-
-
-
-
Constructor Detail
-
ColumnGroupHeaderTextPainter
public ColumnGroupHeaderTextPainter()
Creates the defaultColumnGroupHeaderTextPainter
that uses aTextPainter
as baseICellPainter
and decorate it with theColumnGroupExpandCollapseImagePainter
on the right edge of the cell.
-
ColumnGroupHeaderTextPainter
public ColumnGroupHeaderTextPainter(ICellPainter interiorPainter)
Creates aColumnGroupHeaderTextPainter
that uses the givenICellPainter
as baseICellPainter
and decorate it with theColumnGroupExpandCollapseImagePainter
on the right edge of the cell.- Parameters:
interiorPainter
- the baseICellPainter
to use
-
ColumnGroupHeaderTextPainter
public ColumnGroupHeaderTextPainter(ICellPainter interiorPainter, CellEdgeEnum cellEdge)
Creates aColumnGroupHeaderTextPainter
that uses the givenICellPainter
as baseICellPainter
and decorate it with theColumnGroupExpandCollapseImagePainter
on the specified edge of the cell.- Parameters:
interiorPainter
- the baseICellPainter
to usecellEdge
- the edge of the cell on which the column group indicator decoration should be applied
-
ColumnGroupHeaderTextPainter
public ColumnGroupHeaderTextPainter(ICellPainter interiorPainter, CellEdgeEnum cellEdge, ICellPainter decoratorPainter)
Creates aColumnGroupHeaderTextPainter
that uses the givenICellPainter
as baseICellPainter
and decorate it with the givenICellPainter
to use for column group related decoration on the specified edge of the cell.- Parameters:
interiorPainter
- the baseICellPainter
to usecellEdge
- the edge of the cell on which the column group indicator decoration should be applieddecoratorPainter
- theICellPainter
that should be used to paint the column group related decoration (by default theColumnGroupExpandCollapseImagePainter
will be used)
-
ColumnGroupHeaderTextPainter
public ColumnGroupHeaderTextPainter(ICellPainter interiorPainter, CellEdgeEnum cellEdge, boolean paintBg, int spacing, boolean paintDecorationDependent)
Creates aColumnGroupHeaderTextPainter
that uses the givenICellPainter
as baseICellPainter
. It will use theColumnGroupExpandCollapseImagePainter
as decorator for column group related decorations at the specified cell edge, which can be configured to render the background or not via method parameter. With the additional parameters, the behaviour of the createdCellPainterDecorator
can be configured in terms of rendering.- Parameters:
interiorPainter
- the baseICellPainter
to usecellEdge
- the edge of the cell on which the column group indicator decoration should be appliedpaintBg
- flag to configure whether theColumnGroupExpandCollapseImagePainter
should paint the background or notspacing
- the number of pixels that should be used as spacing between cell edge and decorationpaintDecorationDependent
- flag to configure if the baseICellPainter
should render decoration dependent or not. If it is set tofalse
, the base painter will always paint at the same coordinates, using the whole cell bounds,true
will cause the bounds of the cell to shrink for the base painter.
-
ColumnGroupHeaderTextPainter
public ColumnGroupHeaderTextPainter(ICellPainter interiorPainter, CellEdgeEnum cellEdge, ICellPainter decoratorPainter, boolean paintBg, int spacing, boolean paintDecorationDependent)
Creates aColumnGroupHeaderTextPainter
that uses the givenICellPainter
as baseICellPainter
. It will use the givenICellPainter
as decorator for column group related decorations at the specified cell edge, which can be configured to render the background or not via method parameter. With the additional parameters, the behaviour of the createdCellPainterDecorator
can be configured in terms of rendering.- Parameters:
interiorPainter
- the baseICellPainter
to usecellEdge
- the edge of the cell on which the column group indicator decoration should be applieddecoratorPainter
- theICellPainter
that should be used to paint the column group related decorationpaintBg
- flag to configure whether theCellPainterDecorator
should paint the background or notspacing
- the number of pixels that should be used as spacing between cell edge and decorationpaintDecorationDependent
- flag to configure if the baseICellPainter
should render decoration dependent or not. If it is set tofalse
, the base painter will always paint at the same coordinates, using the whole cell bounds,true
will cause the bounds of the cell to shrink for the base painter.
-
ColumnGroupHeaderTextPainter
public ColumnGroupHeaderTextPainter(ICellPainter interiorPainter, boolean paintBg, boolean interiorPainterToSpanFullWidth)
Creates aColumnGroupHeaderTextPainter
that uses the givenICellPainter
as baseICellPainter
and decorate it with theColumnGroupExpandCollapseImagePainter
on the right edge of the cell. This constructor gives the opportunity to configure the behaviour of theColumnGroupExpandCollapseImagePainter
and theCellPainterDecorator
for some attributes. Remains because of downwards compatibility.- Parameters:
interiorPainter
- the baseICellPainter
to usepaintBg
- flag to configure whether theColumnGroupExpandCollapseImagePainter
should paint the background or notinteriorPainterToSpanFullWidth
- flag to configure how the bounds of the base painter should be calculated
-
-
Method Detail
-
getPreferredWidth
public int getPreferredWidth(ILayerCell cell, org.eclipse.swt.graphics.GC gc, IConfigRegistry configRegistry)
Preferred width is used during auto resize. Column groups do not participate in auto resize, since auto resizing is done by the column width. Hence, always return 0- Specified by:
getPreferredWidth
in interfaceICellPainter
- Overrides:
getPreferredWidth
in classCellPainterWrapper
- Parameters:
cell
- The cell for which the preferred width is requested.gc
- The GC that is used for rendering.configRegistry
- The IConfigRegistry that contains the configuration used for rendering.- Returns:
- The preferred width of the given cell when rendered by this painter.
-
getPreferredHeight
public int getPreferredHeight(ILayerCell cell, org.eclipse.swt.graphics.GC gc, IConfigRegistry configRegistry)
Description copied from interface:ICellPainter
Get the preferred height of the cell when rendered by this painter. Used for auto-resize.- Specified by:
getPreferredHeight
in interfaceICellPainter
- Overrides:
getPreferredHeight
in classCellPainterWrapper
- Parameters:
cell
- The cell for which the preferred height is requested.gc
- The GC that is used for rendering.configRegistry
- The IConfigRegistry that contains the configuration used for rendering.- Returns:
- The preferred height of the given cell when rendered by this painter.
-
-