Class GroupByCellTextPainter
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.AbstractTextPainter
org.eclipse.nebula.widgets.nattable.painter.cell.TextPainter
org.eclipse.nebula.widgets.nattable.extension.glazedlists.groupBy.GroupByCellTextPainter
- All Implemented Interfaces:
ICellPainter
Specialized TextPainter that is used for grouping rows. It will only render
text in the tree column and in columns that contain group by summary values.
Extracted to a separate class to be able to create theme configurations where you are able to wrap this painter easily, instead of creating similar inner classes all the time.
-
Field Summary
Fields inherited from class org.eclipse.nebula.widgets.nattable.painter.cell.AbstractTextPainter
calculateByTextHeight, calculateByTextLength, DOT, EMPTY, LINE_SEPARATOR, lineSpacing, NEW_LINE_PATTERN, NEW_LINE_REGEX, paintBg, paintFg, spacing, wordWrapping, wrapText -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringgetTextToDisplay(ILayerCell cell, org.eclipse.swt.graphics.GC gc, int availableLength, String text) Computes dependent on the configuration of the TextPainter the text to display.Methods inherited from class org.eclipse.nebula.widgets.nattable.painter.cell.TextPainter
calculatePadding, getPreferredHeight, getPreferredWidth, isCalculateWrappedHeight, paintCell, performRowResize, setCalculateWrappedHeight, setNewMinLengthMethods inherited from class org.eclipse.nebula.widgets.nattable.painter.cell.AbstractTextPainter
convertDataType, getLengthFromCache, getLineSpacing, getNumberOfNewLines, isCalculateByTextHeight, isCalculateByTextLength, isCutText, isTrimText, isWordWrapping, isWrapText, paintDecoration, renderStrikethrough, renderUnderlined, resetGC, setCalculateByTextHeight, setCalculateByTextLength, setCutText, setLineSpacing, setStrikethrough, setTrimText, setUnderline, setupGCFromConfig, setWordWrapping, setWrapTextMethods inherited from class org.eclipse.nebula.widgets.nattable.painter.cell.BackgroundPainter
getBackgroundColourMethods inherited from class org.eclipse.nebula.widgets.nattable.painter.cell.CellPainterWrapper
getCellPainterAt, getWrappedPainter, getWrappedPainterBounds, setWrappedPainter
-
Constructor Details
-
GroupByCellTextPainter
public GroupByCellTextPainter()
-
-
Method Details
-
getTextToDisplay
protected String getTextToDisplay(ILayerCell cell, org.eclipse.swt.graphics.GC gc, int availableLength, String text) Description copied from class:AbstractTextPainterComputes dependent on the configuration of the TextPainter the text to display. If word wrapping is enabled new lines are inserted if the available space is not enough. If calculation of available space is enabled, the space is automatically widened for the text to display, and if no calculation is enabled the text is cut and modified to end with "..." to fit into the available space- Overrides:
getTextToDisplayin classAbstractTextPainter- Parameters:
cell- the current cell to paintgc- the current GCavailableLength- the available space for the text to displaytext- the text that should be modified for display- Returns:
- the modified text
-