Class CheckBoxPainter
- 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.BackgroundPainter
-
- org.eclipse.nebula.widgets.nattable.painter.cell.ImagePainter
-
- org.eclipse.nebula.widgets.nattable.painter.cell.CheckBoxPainter
-
- All Implemented Interfaces:
ICellPainter
- Direct Known Subclasses:
DisabledCheckboxPainter
public class CheckBoxPainter extends ImagePainter
Specialization ofImagePainterthat renders a checkbox based on a boolean value.
-
-
Field Summary
-
Fields inherited from class org.eclipse.nebula.widgets.nattable.painter.cell.ImagePainter
calculateByHeight, calculateByWidth
-
-
Constructor Summary
Constructors Constructor Description CheckBoxPainter()Create a newCheckBoxPainterwith the default images.CheckBoxPainter(boolean paintBg)Create a newCheckBoxPainterwith the default images.CheckBoxPainter(boolean paintBg, boolean invertIcons)Create a newCheckBoxPainterwith the default images.CheckBoxPainter(org.eclipse.swt.graphics.Image checkedImg, org.eclipse.swt.graphics.Image uncheckedImg)Create a newCheckBoxPainterwith the given images for rendering a checked/unchecked state.CheckBoxPainter(org.eclipse.swt.graphics.Image checkedImg, org.eclipse.swt.graphics.Image uncheckedImg, boolean paintBg)Create a newCheckBoxPainterwith the given images for rendering a checked/unchecked state.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BooleanconvertDataType(ILayerCell cell, IConfigRegistry configRegistry)org.eclipse.swt.graphics.ImagegetImage(boolean checked)protected org.eclipse.swt.graphics.ImagegetImage(ILayerCell cell, IConfigRegistry configRegistry)intgetPreferredHeight(boolean checked)intgetPreferredWidth(boolean checked)protected booleanisChecked(ILayerCell cell, IConfigRegistry configRegistry)voidpaintIconImage(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle rectangle, int yOffset, boolean checked)-
Methods inherited from class org.eclipse.nebula.widgets.nattable.painter.cell.ImagePainter
getCellPainterAt, getPreferredHeight, getPreferredWidth, isCalculateByHeight, isCalculateByWidth, paintCell, setCalculateByHeight, setCalculateByWidth
-
Methods inherited from class org.eclipse.nebula.widgets.nattable.painter.cell.BackgroundPainter
getBackgroundColour
-
Methods inherited from class org.eclipse.nebula.widgets.nattable.painter.cell.CellPainterWrapper
getWrappedPainter, getWrappedPainterBounds, setWrappedPainter
-
-
-
-
Constructor Detail
-
CheckBoxPainter
public CheckBoxPainter()
Create a newCheckBoxPainterwith the default images.
-
CheckBoxPainter
public CheckBoxPainter(boolean paintBg)
Create a newCheckBoxPainterwith the default images.- Parameters:
paintBg-trueif this painter should itself paint the background,falseif background painting should be skipped.- Since:
- 1.4
-
CheckBoxPainter
public CheckBoxPainter(boolean paintBg, boolean invertIcons)Create a newCheckBoxPainterwith the default images.- Parameters:
paintBg-trueif this painter should itself paint the background,falseif background painting should be skipped.invertIcons- Specify whether the default icons should be used (black check mark) or if inverted icons should be used (white check mark).- Since:
- 2.0
-
CheckBoxPainter
public CheckBoxPainter(org.eclipse.swt.graphics.Image checkedImg, org.eclipse.swt.graphics.Image uncheckedImg)Create a newCheckBoxPainterwith the given images for rendering a checked/unchecked state.- Parameters:
checkedImg- The image to render the checked state (true).uncheckedImg- The image to render the unchecked state (false)
-
CheckBoxPainter
public CheckBoxPainter(org.eclipse.swt.graphics.Image checkedImg, org.eclipse.swt.graphics.Image uncheckedImg, boolean paintBg)Create a newCheckBoxPainterwith the given images for rendering a checked/unchecked state.- Parameters:
checkedImg- The image to render the checked state (true).uncheckedImg- The image to render the unchecked state (false)paintBg-trueif this painter should itself paint the background,falseif background painting should be skipped.- Since:
- 1.4
-
-
Method Detail
-
getPreferredWidth
public int getPreferredWidth(boolean checked)
-
getPreferredHeight
public int getPreferredHeight(boolean checked)
-
paintIconImage
public void paintIconImage(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle rectangle, int yOffset, boolean checked)
-
getImage
public org.eclipse.swt.graphics.Image getImage(boolean checked)
-
getImage
protected org.eclipse.swt.graphics.Image getImage(ILayerCell cell, IConfigRegistry configRegistry)
- Overrides:
getImagein classImagePainter- Parameters:
cell- TheILayerCellfor which thisImagePainteris called.configRegistry- The currentIConfigRegistryto retrieve the cell style information from.- Returns:
- The
Imagethat should be painted by thisImagePainter.
-
isChecked
protected boolean isChecked(ILayerCell cell, IConfigRegistry configRegistry)
-
convertDataType
protected Boolean convertDataType(ILayerCell cell, IConfigRegistry configRegistry)
-
-