Class PercentageBarDecorator
java.lang.Object
org.eclipse.nebula.widgets.nattable.painter.cell.AbstractCellPainter
org.eclipse.nebula.widgets.nattable.painter.cell.CellPainterWrapper
org.eclipse.nebula.widgets.nattable.painter.cell.decorator.PercentageBarDecorator
- All Implemented Interfaces:
ICellPainter
Draws a rectangular bar in cell proportional to the value of the cell.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ConfigAttribute<org.eclipse.swt.graphics.Color>
static final ConfigAttribute<org.eclipse.swt.graphics.Color>
static final ConfigAttribute<org.eclipse.swt.graphics.Color>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Number
convertDataType
(ILayerCell cell, IConfigRegistry configRegistry) Converts the data type to aNumber
.void
paintCell
(ILayerCell cell, org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle rectangle, IConfigRegistry configRegistry) Methods inherited from class org.eclipse.nebula.widgets.nattable.painter.cell.CellPainterWrapper
getCellPainterAt, getPreferredHeight, getPreferredWidth, getWrappedPainter, getWrappedPainterBounds, setWrappedPainter
-
Field Details
-
PERCENTAGE_BAR_COMPLETE_REGION_START_COLOR
public static final ConfigAttribute<org.eclipse.swt.graphics.Color> PERCENTAGE_BAR_COMPLETE_REGION_START_COLOR -
PERCENTAGE_BAR_COMPLETE_REGION_END_COLOR
public static final ConfigAttribute<org.eclipse.swt.graphics.Color> PERCENTAGE_BAR_COMPLETE_REGION_END_COLOR -
PERCENTAGE_BAR_INCOMPLETE_REGION_COLOR
public static final ConfigAttribute<org.eclipse.swt.graphics.Color> PERCENTAGE_BAR_INCOMPLETE_REGION_COLOR
-
-
Constructor Details
-
PercentageBarDecorator
-
-
Method Details
-
paintCell
public void paintCell(ILayerCell cell, org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle rectangle, IConfigRegistry configRegistry) - Specified by:
paintCell
in interfaceICellPainter
- Overrides:
paintCell
in classCellPainterWrapper
-
convertDataType
- Parameters:
cell
- The cell for which theNumber
value is requested.configRegistry
- TheIConfigRegistry
to retrieve theIDisplayConverter
for the cell.- Returns:
- The
Number
value to show. Should be a factor value <= 1.0 to be interpreted as a percentage. - Since:
- 2.3
-