public TextRegionsToString addReplacement( ITextSegment region, String replacement, String description) { text.add(region, getReplacement(region, replacement)); list.add( region, quote(region.getText(), 20) + " -> " + quote(replacement, 20) + ": " + description); return this; }
protected String getReplacement(ITextSegment region, String replacement) { String string = region.getText(); if (Strings.equal(string, replacement)) return "<" + region.getOffset() + "|" + replacement + ">"; return "<" + region.getOffset() + ":" + region.getLength() + "|" + replacement + ">"; }