User Tools

Site Tools


wrap_multiple_changes_into_one_compound_change

Wrap Multiple Document Changes into one Compound Change

If multiple changes on a document of a TextViewer or SourceViewer should be undo/redo-able with a single action then it must be wrapped into a compound change.

IRewriteTarget target= viewer.getRewriteTarget();
target.beginCompoundChange();
try {
    ...
    doTheChanges();
    ...
} finally {
    target.endCompoundChange();
}

wrap_multiple_changes_into_one_compound_change.txt · Last modified: 2015/06/11 18:50 by mihael