use of org.eclipse.ltk.internal.core.refactoring.MultiStateUndoChange in project che by eclipse.
the class MultiStateTextFileChange method perform.
/*
* @see org.eclipse.ltk.core.refactoring.Change#perform(org.eclipse.core.runtime.IProgressMonitor)
*/
public final Change perform(final IProgressMonitor monitor) throws CoreException {
//$NON-NLS-1$
monitor.beginTask("", 3);
IDocument document = null;
try {
document = acquireDocument(new SubProgressMonitor(monitor, 1));
final LinkedList undoList = new LinkedList();
performChanges(document, undoList, false);
if (needsSaving())
fBuffer.commit(new SubProgressMonitor(monitor, 1), false);
return new MultiStateUndoChange(getName(), fFile, (UndoEdit[]) undoList.toArray(new UndoEdit[undoList.size()]), fContentStamp, fSaveMode);
} catch (BadLocationException exception) {
throw Changes.asCoreException(exception);
} finally {
if (document != null) {
releaseDocument(document, new SubProgressMonitor(monitor, 1));
}
monitor.done();
}
}
Aggregations