Assert.isTrue(fWhitespaceCharPainter == null);
ITextViewer viewer= getTextViewer();
if (viewer instanceof ITextViewerExtension2) {
if (fStore != null) {
fWhitespaceCharPainter= new WhitespaceCharacterPainter(viewer, fShowLeadingSpaces, fShowEnclosedSpaces, fShowTrailingSpaces, fShowLeadingIdeographicSpaces,
fShowEnclosedIdeographicSpaces, fShowTrailingIdeographicSpace, fShowLeadingTabs, fShowEnclosedTabs, fShowTrailingTabs, fShowCarriageReturn, fShowLineFeed, fAlpha);
} else {
fWhitespaceCharPainter= new WhitespaceCharacterPainter(viewer);
}
((ITextViewerExtension2)viewer).addPainter(fWhitespaceCharPainter);
}
}