Class SortIconPainter
- 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.sort.painter.SortIconPainter
-
- All Implemented Interfaces:
ICellPainter
public class SortIconPainter extends ImagePainter
Paints the triangular sort icon images. It is used to decorate column header cells to show the current sort state.
-
-
Field Summary
-
Fields inherited from class org.eclipse.nebula.widgets.nattable.painter.cell.ImagePainter
calculateByHeight, calculateByWidth
-
-
Constructor Summary
Constructors Constructor Description SortIconPainter()
Create a SortIconPainter that uses the default icons (black triangles) and renders the background.SortIconPainter(boolean paintBg)
Create a SortIconPainter that uses the default icons (black triangles).SortIconPainter(boolean paintBg, boolean invertIcons)
Create a SortIconPainter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.eclipse.swt.graphics.Image
getImage(ILayerCell cell, IConfigRegistry configRegistry)
protected org.eclipse.swt.graphics.Image
selectDownImage(int sortSequence)
Returns the sort icon that should be used to indicate descending sorting state.protected org.eclipse.swt.graphics.Image
selectUpImage(int sortSequence)
Returns the sort icon that should be used to indicate ascending sorting state.void
setSortImages(org.eclipse.swt.graphics.Image upImage0, org.eclipse.swt.graphics.Image upImage1, org.eclipse.swt.graphics.Image upImage2, org.eclipse.swt.graphics.Image downImage0, org.eclipse.swt.graphics.Image downImage1, org.eclipse.swt.graphics.Image downImage2)
Set the images that should be used to indicate the current sort state.-
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
-
SortIconPainter
public SortIconPainter()
Create a SortIconPainter that uses the default icons (black triangles) and renders the background.
-
SortIconPainter
public SortIconPainter(boolean paintBg)
Create a SortIconPainter that uses the default icons (black triangles).- Parameters:
paintBg
-true
if it should render the background itself,false
if the background rendering should be skipped in here.
-
SortIconPainter
public SortIconPainter(boolean paintBg, boolean invertIcons)
Create a SortIconPainter.- Parameters:
paintBg
-true
if it should render the background itself,false
if the background rendering should be skipped in here.invertIcons
- Specify whether the default icons should be used (black triangles) or if inverted icons should be used (white triangles).
-
-
Method Detail
-
getImage
protected org.eclipse.swt.graphics.Image getImage(ILayerCell cell, IConfigRegistry configRegistry)
- Overrides:
getImage
in classImagePainter
- Parameters:
cell
- TheILayerCell
for which thisImagePainter
is called.configRegistry
- The currentIConfigRegistry
to retrieve the cell style information from.- Returns:
- The
Image
that should be painted by thisImagePainter
.
-
selectUpImage
protected org.eclipse.swt.graphics.Image selectUpImage(int sortSequence)
Returns the sort icon that should be used to indicate ascending sorting state.- Parameters:
sortSequence
- The sort sequence number for which the sort icon is requested.- Returns:
- The sort icon that should be rendered to indicate the current sort state.
-
selectDownImage
protected org.eclipse.swt.graphics.Image selectDownImage(int sortSequence)
Returns the sort icon that should be used to indicate descending sorting state.- Parameters:
sortSequence
- The sort sequence number for which the sort icon is requested.- Returns:
- The sort icon that should be rendered to indicate the current sort state.
-
setSortImages
public void setSortImages(org.eclipse.swt.graphics.Image upImage0, org.eclipse.swt.graphics.Image upImage1, org.eclipse.swt.graphics.Image upImage2, org.eclipse.swt.graphics.Image downImage0, org.eclipse.swt.graphics.Image downImage1, org.eclipse.swt.graphics.Image downImage2)
Set the images that should be used to indicate the current sort state.- Parameters:
upImage0
- Image to be used to indicate first level ascending sorting.upImage1
- Image to be used to indicate second level ascending sorting.upImage2
- Image to be used to indicate third level ascending sorting.downImage0
- Image to be used to indicate first level descending sorting.downImage1
- Image to be used to indicate second level descending sorting.downImage2
- Image to be used to indicate third level descending sorting.
-
-