Class CopySelectionLayerPainter
- java.lang.Object
-
- org.eclipse.nebula.widgets.nattable.painter.layer.CellLayerPainter
-
- org.eclipse.nebula.widgets.nattable.painter.layer.GridLineCellLayerPainter
-
- org.eclipse.nebula.widgets.nattable.selection.SelectionLayerPainter
-
- org.eclipse.nebula.widgets.nattable.formula.CopySelectionLayerPainter
-
- All Implemented Interfaces:
ILayerPainter
public class CopySelectionLayerPainter extends SelectionLayerPainter
SpecializedSelectionLayerPainter
that renders a border around cells that are currently in the stored in theInternalCellClipboard
.Note: Needs to be set to the
SelectionLayer
in order to work correctly.- Since:
- 1.4
-
-
Field Summary
Fields Modifier and Type Field Description protected InternalCellClipboard
clipboard
-
Fields inherited from class org.eclipse.nebula.widgets.nattable.painter.layer.GridLineCellLayerPainter
gridLineWidth, renderGridLines
-
-
Constructor Summary
Constructors Constructor Description CopySelectionLayerPainter(InternalCellClipboard clipboard)
Create aCopySelectionLayerPainter
that renders gray grid lines and uses the default clipping behavior.CopySelectionLayerPainter(InternalCellClipboard clipboard, boolean clipLeft, boolean clipTop)
Create aCopySelectionLayerPainter
that renders gray grid lines and uses the specified clipping behavior.CopySelectionLayerPainter(InternalCellClipboard clipboard, org.eclipse.swt.graphics.Color gridColor)
Create aCopySelectionLayerPainter
that renders gray grid lines and uses the default clipping behavior.CopySelectionLayerPainter(InternalCellClipboard clipboard, org.eclipse.swt.graphics.Color gridColor, boolean clipLeft, boolean clipTop)
Create aCopySelectionLayerPainter
that renders grid lines in the specified color and uses the specified clipping behavior.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BorderStyle
getCopyBorderStyle(IConfigRegistry configRegistry)
Get the border style that should be used to render the border for cells that are currently copied to theInternalCellClipboard
.void
paintLayer(ILayer natLayer, org.eclipse.swt.graphics.GC gc, int xOffset, int yOffset, org.eclipse.swt.graphics.Rectangle pixelRectangle, IConfigRegistry configRegistry)
-
Methods inherited from class org.eclipse.nebula.widgets.nattable.selection.SelectionLayerPainter
fixBoundsInGridLines, getBorderCells, getBorderStyle, isInCurrentLayer
-
Methods inherited from class org.eclipse.nebula.widgets.nattable.painter.layer.GridLineCellLayerPainter
adjustCellBounds, drawGridLines, getGridColor
-
Methods inherited from class org.eclipse.nebula.widgets.nattable.painter.layer.CellLayerPainter
getPositionRectangleFromPixelRectangle, getStartXOfColumnPosition, getStartYOfRowPosition, isClipLeft, isClipTop, paintCell
-
-
-
-
Field Detail
-
clipboard
protected InternalCellClipboard clipboard
-
-
Constructor Detail
-
CopySelectionLayerPainter
public CopySelectionLayerPainter(InternalCellClipboard clipboard)
Create aCopySelectionLayerPainter
that renders gray grid lines and uses the default clipping behavior.- Parameters:
clipboard
- TheInternalCellClipboard
that stores the cells that are currently copied.
-
CopySelectionLayerPainter
public CopySelectionLayerPainter(InternalCellClipboard clipboard, org.eclipse.swt.graphics.Color gridColor)
Create aCopySelectionLayerPainter
that renders gray grid lines and uses the default clipping behavior.- Parameters:
clipboard
- TheInternalCellClipboard
that stores the cells that are currently copied.gridColor
- The color that should be used to render the grid lines.
-
CopySelectionLayerPainter
public CopySelectionLayerPainter(InternalCellClipboard clipboard, org.eclipse.swt.graphics.Color gridColor, boolean clipLeft, boolean clipTop)
Create aCopySelectionLayerPainter
that renders grid lines in the specified color and uses the specified clipping behavior.- Parameters:
clipboard
- TheInternalCellClipboard
that stores the cells that are currently copied.gridColor
- The color that should be used to render the grid lines.clipLeft
- Configure the rendering behavior when cells overlap. If set totrue
the left cell will be clipped, if set tofalse
the right cell will be clipped. The default value isfalse
.clipTop
- Configure the rendering behavior when cells overlap. If set totrue
the top cell will be clipped, if set tofalse
the bottom cell will be clipped. The default value isfalse
.
-
CopySelectionLayerPainter
public CopySelectionLayerPainter(InternalCellClipboard clipboard, boolean clipLeft, boolean clipTop)
Create aCopySelectionLayerPainter
that renders gray grid lines and uses the specified clipping behavior.- Parameters:
clipboard
- TheInternalCellClipboard
that stores the cells that are currently copied.clipLeft
- Configure the rendering behavior when cells overlap. If set totrue
the left cell will be clipped, if set tofalse
the right cell will be clipped. The default value isfalse
.clipTop
- Configure the rendering behavior when cells overlap. If set totrue
the top cell will be clipped, if set tofalse
the bottom cell will be clipped. The default value isfalse
.
-
-
Method Detail
-
paintLayer
public void paintLayer(ILayer natLayer, org.eclipse.swt.graphics.GC gc, int xOffset, int yOffset, org.eclipse.swt.graphics.Rectangle pixelRectangle, IConfigRegistry configRegistry)
- Specified by:
paintLayer
in interfaceILayerPainter
- Overrides:
paintLayer
in classSelectionLayerPainter
- Parameters:
natLayer
- The layer to paint.gc
- GC used for paintingxOffset
- x offset of the layer from the origin of the tableyOffset
- y offset of the layer from the origin of the tablepixelRectangle
- area the layer can paint inconfigRegistry
-IConfigRegistry
in use by NatTable. Useful for looking up associated painters.
-
getCopyBorderStyle
protected BorderStyle getCopyBorderStyle(IConfigRegistry configRegistry)
Get the border style that should be used to render the border for cells that are currently copied to theInternalCellClipboard
. Checks theConfigRegistry
for a registeredIStyle
for theSelectionStyleLabels.COPY_BORDER_STYLE
label. If none is registered, a default line style will be used to render the border.- Parameters:
configRegistry
- TheConfigRegistry
to retrieve the style information from.- Returns:
- The
BorderStyle
that should be used for rendering the copy border. - Since:
- 1.6
-
-