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
Specialized
SelectionLayerPainter that renders a border around cells
that are currently in the stored in the InternalCellClipboard.
Note: Needs to be set to the SelectionLayer in order to work
correctly.
- Since:
- 1.4
-
Field Summary
FieldsFields inherited from class org.eclipse.nebula.widgets.nattable.painter.layer.GridLineCellLayerPainter
gridLineWidth, renderGridLines -
Constructor Summary
ConstructorsConstructorDescriptionCopySelectionLayerPainter(InternalCellClipboard clipboard) Create aCopySelectionLayerPainterthat renders gray grid lines and uses the default clipping behavior.CopySelectionLayerPainter(InternalCellClipboard clipboard, boolean clipLeft, boolean clipTop) Create aCopySelectionLayerPainterthat renders gray grid lines and uses the specified clipping behavior.CopySelectionLayerPainter(InternalCellClipboard clipboard, org.eclipse.swt.graphics.Color gridColor) Create aCopySelectionLayerPainterthat renders gray grid lines and uses the default clipping behavior.CopySelectionLayerPainter(InternalCellClipboard clipboard, org.eclipse.swt.graphics.Color gridColor, boolean clipLeft, boolean clipTop) Create aCopySelectionLayerPainterthat renders grid lines in the specified color and uses the specified clipping behavior. -
Method Summary
Modifier and TypeMethodDescriptionprotected BorderStylegetCopyBorderStyle(IConfigRegistry configRegistry) Get the border style that should be used to render the border for cells that are currently copied to theInternalCellClipboard.voidpaintLayer(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, isInCurrentLayerMethods inherited from class org.eclipse.nebula.widgets.nattable.painter.layer.GridLineCellLayerPainter
adjustCellBounds, drawGridLines, getGridColorMethods inherited from class org.eclipse.nebula.widgets.nattable.painter.layer.CellLayerPainter
getPositionRectangleFromPixelRectangle, getStartXOfColumnPosition, getStartYOfRowPosition, isClipLeft, isClipTop, paintCell
-
Field Details
-
clipboard
-
-
Constructor Details
-
CopySelectionLayerPainter
Create aCopySelectionLayerPainterthat renders gray grid lines and uses the default clipping behavior.- Parameters:
clipboard- TheInternalCellClipboardthat stores the cells that are currently copied.
-
CopySelectionLayerPainter
public CopySelectionLayerPainter(InternalCellClipboard clipboard, org.eclipse.swt.graphics.Color gridColor) Create aCopySelectionLayerPainterthat renders gray grid lines and uses the default clipping behavior.- Parameters:
clipboard- TheInternalCellClipboardthat 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 aCopySelectionLayerPainterthat renders grid lines in the specified color and uses the specified clipping behavior.- Parameters:
clipboard- TheInternalCellClipboardthat 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 totruethe left cell will be clipped, if set tofalsethe right cell will be clipped. The default value isfalse.clipTop- Configure the rendering behavior when cells overlap. If set totruethe top cell will be clipped, if set tofalsethe bottom cell will be clipped. The default value isfalse.
-
CopySelectionLayerPainter
public CopySelectionLayerPainter(InternalCellClipboard clipboard, boolean clipLeft, boolean clipTop) Create aCopySelectionLayerPainterthat renders gray grid lines and uses the specified clipping behavior.- Parameters:
clipboard- TheInternalCellClipboardthat stores the cells that are currently copied.clipLeft- Configure the rendering behavior when cells overlap. If set totruethe left cell will be clipped, if set tofalsethe right cell will be clipped. The default value isfalse.clipTop- Configure the rendering behavior when cells overlap. If set totruethe top cell will be clipped, if set tofalsethe bottom cell will be clipped. The default value isfalse.
-
-
Method Details
-
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:
paintLayerin interfaceILayerPainter- Overrides:
paintLayerin 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-IConfigRegistryin use by NatTable. Useful for looking up associated painters.
-
getCopyBorderStyle
Get the border style that should be used to render the border for cells that are currently copied to theInternalCellClipboard. Checks theConfigRegistryfor a registeredIStylefor theSelectionStyleLabels.COPY_BORDER_STYLElabel. If none is registered, a default line style will be used to render the border.- Parameters:
configRegistry- TheConfigRegistryto retrieve the style information from.- Returns:
- The
BorderStylethat should be used for rendering the copy border. - Since:
- 1.6
-