org.eclipse.nebula.widgets.nattable.group.painter
Class ColumnGroupHeaderTextPainter

java.lang.Object
  extended by org.eclipse.nebula.widgets.nattable.painter.cell.AbstractCellPainter
      extended by org.eclipse.nebula.widgets.nattable.painter.cell.CellPainterWrapper
          extended by org.eclipse.nebula.widgets.nattable.group.painter.ColumnGroupHeaderTextPainter
All Implemented Interfaces:
ICellPainter

public class ColumnGroupHeaderTextPainter
extends CellPainterWrapper


Constructor Summary
ColumnGroupHeaderTextPainter()
          Creates the default ColumnGroupHeaderTextPainter that uses a TextPainter as base ICellPainter and decorate it with the ColumnGroupExpandCollapseImagePainter on the right edge of the cell.
ColumnGroupHeaderTextPainter(ColumnGroupModel columnGroupModel)
          Deprecated. Use constructor without ColumnGroupModel reference
ColumnGroupHeaderTextPainter(ColumnGroupModel columnGroupModel, ICellPainter interiorPainter)
          Deprecated. Use constructor without ColumnGroupModel reference
ColumnGroupHeaderTextPainter(ColumnGroupModel columnGroupModel, ICellPainter interiorPainter, boolean paintBg, boolean interiorPainterToSpanFullWidth)
          Deprecated. Use constructor without ColumnGroupModel reference
ColumnGroupHeaderTextPainter(ColumnGroupModel columnGroupModel, ICellPainter interiorPainter, CellEdgeEnum cellEdge)
          Deprecated. Use constructor without ColumnGroupModel reference
ColumnGroupHeaderTextPainter(ColumnGroupModel columnGroupModel, ICellPainter interiorPainter, CellEdgeEnum cellEdge, boolean paintBg, int spacing, boolean paintDecorationDependent)
          Deprecated. Use constructor without ColumnGroupModel reference
ColumnGroupHeaderTextPainter(ICellPainter interiorPainter)
          Creates a ColumnGroupHeaderTextPainter that uses the given ICellPainter as base ICellPainter and decorate it with the ColumnGroupExpandCollapseImagePainter on the right edge of the cell.
ColumnGroupHeaderTextPainter(ICellPainter interiorPainter, boolean paintBg, boolean interiorPainterToSpanFullWidth)
          Creates a ColumnGroupHeaderTextPainter that uses the given ICellPainter as base ICellPainter and decorate it with the ColumnGroupExpandCollapseImagePainter on the right edge of the cell.
ColumnGroupHeaderTextPainter(ICellPainter interiorPainter, CellEdgeEnum cellEdge)
          Creates a ColumnGroupHeaderTextPainter that uses the given ICellPainter as base ICellPainter and decorate it with the ColumnGroupExpandCollapseImagePainter on the specified edge of the cell.
ColumnGroupHeaderTextPainter(ICellPainter interiorPainter, CellEdgeEnum cellEdge, boolean paintBg, int spacing, boolean paintDecorationDependent)
          Creates a ColumnGroupHeaderTextPainter that uses the given ICellPainter as base ICellPainter.
ColumnGroupHeaderTextPainter(ICellPainter interiorPainter, CellEdgeEnum cellEdge, ICellPainter decoratorPainter)
          Creates a ColumnGroupHeaderTextPainter that uses the given ICellPainter as base ICellPainter and decorate it with the given ICellPainter 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)
          Creates a ColumnGroupHeaderTextPainter that uses the given ICellPainter as base ICellPainter.
 
Method Summary
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColumnGroupHeaderTextPainter

@Deprecated
public ColumnGroupHeaderTextPainter(ColumnGroupModel columnGroupModel)
Deprecated. Use constructor without ColumnGroupModel reference

Creates the default ColumnGroupHeaderTextPainter that uses a TextPainter as base ICellPainter and decorate it with the ColumnGroupExpandCollapseImagePainter on the right edge of the cell.

Parameters:
columnGroupModel - the column group model that is used by the grid

ColumnGroupHeaderTextPainter

@Deprecated
public ColumnGroupHeaderTextPainter(ColumnGroupModel columnGroupModel,
                                               ICellPainter interiorPainter)
Deprecated. Use constructor without ColumnGroupModel reference

Creates a ColumnGroupHeaderTextPainter that uses the given ICellPainter as base ICellPainter and decorate it with the ColumnGroupExpandCollapseImagePainter on the right edge of the cell.

Parameters:
columnGroupModel - the column group model that is used by the grid
interiorPainter - the base ICellPainter to use

ColumnGroupHeaderTextPainter

@Deprecated
public ColumnGroupHeaderTextPainter(ColumnGroupModel columnGroupModel,
                                               ICellPainter interiorPainter,
                                               CellEdgeEnum cellEdge)
Deprecated. Use constructor without ColumnGroupModel reference

Creates a ColumnGroupHeaderTextPainter that uses the given ICellPainter as base ICellPainter and decorate it with the ColumnGroupExpandCollapseImagePainter on the specified edge of the cell.

Parameters:
columnGroupModel - the column group model that is used by the grid
interiorPainter - the base ICellPainter to use
cellEdge - the edge of the cell on which the column group indicator decoration should be applied

ColumnGroupHeaderTextPainter

public ColumnGroupHeaderTextPainter()
Creates the default ColumnGroupHeaderTextPainter that uses a TextPainter as base ICellPainter and decorate it with the ColumnGroupExpandCollapseImagePainter on the right edge of the cell.


ColumnGroupHeaderTextPainter

public ColumnGroupHeaderTextPainter(ICellPainter interiorPainter)
Creates a ColumnGroupHeaderTextPainter that uses the given ICellPainter as base ICellPainter and decorate it with the ColumnGroupExpandCollapseImagePainter on the right edge of the cell.

Parameters:
interiorPainter - the base ICellPainter to use

ColumnGroupHeaderTextPainter

public ColumnGroupHeaderTextPainter(ICellPainter interiorPainter,
                                    CellEdgeEnum cellEdge)
Creates a ColumnGroupHeaderTextPainter that uses the given ICellPainter as base ICellPainter and decorate it with the ColumnGroupExpandCollapseImagePainter on the specified edge of the cell.

Parameters:
interiorPainter - the base ICellPainter to use
cellEdge - 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 a ColumnGroupHeaderTextPainter that uses the given ICellPainter as base ICellPainter and decorate it with the given ICellPainter to use for column group related decoration on the specified edge of the cell.

Parameters:
interiorPainter - the base ICellPainter to use
cellEdge - the edge of the cell on which the column group indicator decoration should be applied
decoratorPainter - the ICellPainter that should be used to paint the column group related decoration (by default the ColumnGroupExpandCollapseImagePainter will be used)

ColumnGroupHeaderTextPainter

@Deprecated
public ColumnGroupHeaderTextPainter(ColumnGroupModel columnGroupModel,
                                               ICellPainter interiorPainter,
                                               CellEdgeEnum cellEdge,
                                               boolean paintBg,
                                               int spacing,
                                               boolean paintDecorationDependent)
Deprecated. Use constructor without ColumnGroupModel reference

Creates a ColumnGroupHeaderTextPainter that uses the given ICellPainter as base ICellPainter. It will use the ColumnGroupExpandCollapseImagePainter 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 created CellPainterDecorator can be configured in terms of rendering.

Parameters:
columnGroupModel - the column group model that is used by the grid
interiorPainter - the base ICellPainter to use
cellEdge - the edge of the cell on which the column group indicator decoration should be applied
paintBg - flag to configure whether the ColumnGroupExpandCollapseImagePainter should paint the background or not
spacing - the number of pixels that should be used as spacing between cell edge and decoration
paintDecorationDependent - flag to configure if the base ICellPainter should render decoration dependent or not. If it is set to false, 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

@Deprecated
public ColumnGroupHeaderTextPainter(ColumnGroupModel columnGroupModel,
                                               ICellPainter interiorPainter,
                                               boolean paintBg,
                                               boolean interiorPainterToSpanFullWidth)
Deprecated. Use constructor without ColumnGroupModel reference

Creates a ColumnGroupHeaderTextPainter that uses the given ICellPainter as base ICellPainter and decorate it with the ColumnGroupExpandCollapseImagePainter on the right edge of the cell. This constructor gives the opportunity to configure the behaviour of the ColumnGroupExpandCollapseImagePainter and the CellPainterDecorator for some attributes. Remains because of downwards compatibility.

Parameters:
columnGroupModel - the column group model that is used by the grid
interiorPainter - the base ICellPainter to use
paintBg - flag to configure whether the ColumnGroupExpandCollapseImagePainter should paint the background or not
interiorPainterToSpanFullWidth - flag to configure how the bounds of the base painter should be calculated

ColumnGroupHeaderTextPainter

public ColumnGroupHeaderTextPainter(ICellPainter interiorPainter,
                                    CellEdgeEnum cellEdge,
                                    boolean paintBg,
                                    int spacing,
                                    boolean paintDecorationDependent)
Creates a ColumnGroupHeaderTextPainter that uses the given ICellPainter as base ICellPainter. It will use the ColumnGroupExpandCollapseImagePainter 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 created CellPainterDecorator can be configured in terms of rendering.

Parameters:
interiorPainter - the base ICellPainter to use
cellEdge - the edge of the cell on which the column group indicator decoration should be applied
paintBg - flag to configure whether the ColumnGroupExpandCollapseImagePainter should paint the background or not
spacing - the number of pixels that should be used as spacing between cell edge and decoration
paintDecorationDependent - flag to configure if the base ICellPainter should render decoration dependent or not. If it is set to false, 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 a ColumnGroupHeaderTextPainter that uses the given ICellPainter as base ICellPainter. It will use the given ICellPainter 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 created CellPainterDecorator can be configured in terms of rendering.

Parameters:
interiorPainter - the base ICellPainter to use
cellEdge - the edge of the cell on which the column group indicator decoration should be applied
decoratorPainter - the ICellPainter that should be used to paint the column group related decoration
paintBg - flag to configure whether the CellPainterDecorator should paint the background or not
spacing - the number of pixels that should be used as spacing between cell edge and decoration
paintDecorationDependent - flag to configure if the base ICellPainter should render decoration dependent or not. If it is set to false, 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 a ColumnGroupHeaderTextPainter that uses the given ICellPainter as base ICellPainter and decorate it with the ColumnGroupExpandCollapseImagePainter on the right edge of the cell. This constructor gives the opportunity to configure the behaviour of the ColumnGroupExpandCollapseImagePainter and the CellPainterDecorator for some attributes. Remains because of downwards compatibility.

Parameters:
interiorPainter - the base ICellPainter to use
paintBg - flag to configure whether the ColumnGroupExpandCollapseImagePainter should paint the background or not
interiorPainterToSpanFullWidth - 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 interface ICellPainter
Overrides:
getPreferredWidth in class CellPainterWrapper
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 interface ICellPainter
Overrides:
getPreferredHeight in class CellPainterWrapper
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.


Copyright © 2015. All rights reserved.