@Override public void configureWhitespace(WhitespaceReplacer leading, WhitespaceReplacer trailing) { if (noIndent) { leading.getFormatting().setNoIndentation(true); trailing.getFormatting().setNoIndentation(true); } }
@Override public void configureWhitespace(WhitespaceReplacer leading, WhitespaceReplacer trailing) { if (multiline) { enforceNewLine(leading); enforceNewLine(trailing); } else { enforceSingleSpace(leading); enforceSingleSpace(trailing); } }
/** */ protected void enforceNewLine(WhitespaceReplacer replacer) { if (replacer.getRegion().getOffset() <= 0) return; Integer min = replacer.getFormatting().getNewLineMin(); if (min == null || min < 1) replacer.getFormatting().setNewLinesMin(1); }
/** */ protected void enforceSingleSpace(WhitespaceReplacer replacer) { if (replacer.getRegion().getOffset() <= 0) return; String space = replacer.getFormatting().getSpace(); if (space == null || space.length() < 1) replacer.getFormatting().setSpace(" "); }
public ITextReplacer createWhitespaceReplacer(ITextSegment hiddens, IHiddenRegionFormatting formatting) { return new WhitespaceReplacer(hiddens, formatting); }