Class PasswordTextPainter
- 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.painter.cell.PasswordTextPainter
-
- All Implemented Interfaces:
ICellPainter
public class PasswordTextPainter extends TextPainter
SpecializedTextPainter
that will paint the text that should be showed within a cell anonymized. Like inPasswordCellEditor
every character will be replaced with another echo character. The echo character can be configured by setting the attributeCellStyleAttributes.PASSWORD_ECHO_CHAR
to the cell style to use. If no echo character is configured, the bullet character will be used as echo character.- See Also:
PasswordCellEditor
-
-
Field Summary
-
Fields inherited from class org.eclipse.nebula.widgets.nattable.painter.cell.AbstractTextPainter
calculateByTextHeight, calculateByTextLength, DOT, EMPTY, LINE_SEPARATOR, lineSpacing, NEW_LINE_REGEX, paintBg, paintFg, spacing, wordWrapping, wrapText
-
-
Constructor Summary
Constructors Constructor Description PasswordTextPainter()
PasswordTextPainter(boolean wrapText, boolean paintBg)
PasswordTextPainter(boolean wrapText, boolean paintBg, boolean calculate)
PasswordTextPainter(boolean wrapText, boolean paintBg, int spacing)
PasswordTextPainter(boolean wrapText, boolean paintBg, int spacing, boolean calculate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
getTextToDisplay(ILayerCell cell, org.eclipse.swt.graphics.GC gc, int availableLength, String text)
Computes dependent on the configuration of the TextPainter the text to display.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.TextPainter
calculatePadding, getPreferredHeight, getPreferredWidth, isCalculateWrappedHeight, performRowResize, setCalculateWrappedHeight, setNewMinLength
-
Methods inherited from class org.eclipse.nebula.widgets.nattable.painter.cell.AbstractTextPainter
convertDataType, getLengthFromCache, getLineSpacing, getNumberOfNewLines, isCalculateByTextHeight, isCalculateByTextLength, isTrimText, isWordWrapping, isWrapText, paintDecoration, renderStrikethrough, renderUnderlined, resetGC, setCalculateByTextHeight, setCalculateByTextLength, setLineSpacing, setStrikethrough, setTrimText, setUnderline, setupGCFromConfig, setWordWrapping, setWrapText
-
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
getCellPainterAt, getWrappedPainter, getWrappedPainterBounds, setWrappedPainter
-
-
-
-
Constructor Detail
-
PasswordTextPainter
public PasswordTextPainter()
-
PasswordTextPainter
public PasswordTextPainter(boolean wrapText, boolean paintBg)
-
PasswordTextPainter
public PasswordTextPainter(boolean wrapText, boolean paintBg, int spacing)
-
PasswordTextPainter
public PasswordTextPainter(boolean wrapText, boolean paintBg, boolean calculate)
-
PasswordTextPainter
public PasswordTextPainter(boolean wrapText, boolean paintBg, int spacing, boolean calculate)
-
-
Method Detail
-
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 classTextPainter
-
getTextToDisplay
protected String getTextToDisplay(ILayerCell cell, org.eclipse.swt.graphics.GC gc, int availableLength, String text)
Description copied from class:AbstractTextPainter
Computes 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:
getTextToDisplay
in 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
-
-