public class CustomLineBorderDecorator extends CellPainterWrapper
NatTable
decorator class which is used to draw borders for cells whose LabelStack
contains border related labels.
Compared to the LineBorderDecorator which paints a border for every side of a cell, with this implementation you are free to choose for which side a border should be painted or not.
Modifier and Type | Field and Description |
---|---|
static String |
BOTTOM_LINE_BORDER_LABEL
Label for adding a border at the bottom of a cell.
|
static String |
LEFT_LINE_BORDER_LABEL
Label for adding a border at the left of a cell.
|
static String |
RIGHT_LINE_BORDER_LABEL
Label for adding a border at the right of a cell.
|
static String |
TOP_LINE_BORDER_LABEL
Label for adding a border at the top of a cell.
|
Constructor and Description |
---|
CustomLineBorderDecorator(ICellPainter interiorPainter)
Creates a new LabelLineBorderDecorator wrapping the given interior painter and no
default border style.
|
CustomLineBorderDecorator(ICellPainter interiorPainter,
BorderStyle defaultBorderStyle)
Creates a new LabelLineBorderDecorator wrapping the given interior painter using
the given BorderStyle as default.
|
Modifier and Type | Method and 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)
Get the preferred width of the cell when rendered by this painter.
|
void |
paintCell(ILayerCell cell,
org.eclipse.swt.graphics.GC gc,
org.eclipse.swt.graphics.Rectangle rectangle,
IConfigRegistry configRegistry) |
getCellPainterAt, getWrappedPainter, getWrappedPainterBounds, setWrappedPainter
public static final String TOP_LINE_BORDER_LABEL
public static final String BOTTOM_LINE_BORDER_LABEL
public static final String LEFT_LINE_BORDER_LABEL
public static final String RIGHT_LINE_BORDER_LABEL
public CustomLineBorderDecorator(ICellPainter interiorPainter)
interiorPainter
- The painter to be wrapped by this decorator.public CustomLineBorderDecorator(ICellPainter interiorPainter, BorderStyle defaultBorderStyle)
interiorPainter
- The painter to be wrapped by this decorator.defaultBorderStyle
- The BorderStyle to use as default if there is no BorderStyle
configured via cell styles. Can be null
.public int getPreferredWidth(ILayerCell cell, org.eclipse.swt.graphics.GC gc, IConfigRegistry configRegistry)
ICellPainter
getPreferredWidth
in interface ICellPainter
getPreferredWidth
in class CellPainterWrapper
public int getPreferredHeight(ILayerCell cell, org.eclipse.swt.graphics.GC gc, IConfigRegistry configRegistry)
ICellPainter
getPreferredHeight
in interface ICellPainter
getPreferredHeight
in class CellPainterWrapper
public void paintCell(ILayerCell cell, org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle rectangle, IConfigRegistry configRegistry)
paintCell
in interface ICellPainter
paintCell
in class CellPainterWrapper
Copyright © 2013. All Rights Reserved.