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
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
ConstructorsConstructorDescriptionCreate 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
Modifier and TypeMethodDescriptionprotected org.eclipse.swt.graphics.ImagegetImage(ILayerCell cell, IConfigRegistry configRegistry) protected org.eclipse.swt.graphics.ImageselectDownImage(int sortSequence) Returns the sort icon that should be used to indicate descending sorting state.protected org.eclipse.swt.graphics.ImageselectUpImage(int sortSequence) Returns the sort icon that should be used to indicate ascending sorting state.voidsetSortImages(List<org.eclipse.swt.graphics.Image> upImages, List<org.eclipse.swt.graphics.Image> downImages) Set the images that should be used to indicate the current sort state.voidsetSortImages(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, setCalculateByWidthMethods inherited from class org.eclipse.nebula.widgets.nattable.painter.cell.BackgroundPainter
getBackgroundColourMethods inherited from class org.eclipse.nebula.widgets.nattable.painter.cell.CellPainterWrapper
getWrappedPainter, getWrappedPainterBounds, setWrappedPainter
-
Constructor Details
-
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-trueif it should render the background itself,falseif the background rendering should be skipped in here.
-
SortIconPainter
public SortIconPainter(boolean paintBg, boolean invertIcons) Create a SortIconPainter.- Parameters:
paintBg-trueif it should render the background itself,falseif 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 Details
-
getImage
- 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.
-
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.
-
setSortImages
public void setSortImages(List<org.eclipse.swt.graphics.Image> upImages, List<org.eclipse.swt.graphics.Image> downImages) Set the images that should be used to indicate the current sort state.- Parameters:
upImages- Images that should be used to indicate ascending sorting.downImages- Images that should be used to indicate descending sorting.- Since:
- 2.3
-