// foldingSetter.takeSnapshot();
// Loop over each line, performing the right trim
IRewriteTarget target= (IRewriteTarget)editor.getAdapter(IRewriteTarget.class);
if (target != null)
target.beginCompoundChange();
int currentLine = 0;
while (currentLine < doc.getNumberOfLines()) {
int offset = doc.getLineOffset(currentLine);
int length = doc.getLineLength(currentLine);
oldText = doc.get(offset, length);