public final class RewriteSessionEditProcessor extends TextEditProcessor
Constructor and Description |
---|
RewriteSessionEditProcessor(IDocument document,
TextEdit root,
int style)
Constructs a new edit processor for the given document.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
isLargeEdit(TextEdit edit)
Returns
true if the passed edit is considered large,
false otherwise. |
UndoEdit |
performEdits()
Executes the text edits.
|
canPerformEdits, considerEdit, getDocument, getRoot, getStyle
public RewriteSessionEditProcessor(IDocument document, TextEdit root, int style)
document
- the document to manipulateroot
- the root of the text edit tree describing the modifications. By passing a text
edit a a text edit processor the ownership of the edit is transfered to the text edit
processors. Clients must not modify the edit (e.g adding new children) any longer.style
- TextEdit.NONE
, TextEdit.CREATE_UNDO
or
TextEdit.UPDATE_REGIONS
)public UndoEdit performEdits() throws MalformedTreeException, BadLocationException
TextEditProcessor
performEdits
in class TextEditProcessor
MalformedTreeException
- is thrown if the edit tree isn't
in a valid state. This exception is thrown before any edit is executed.
So the document is still in its original state.BadLocationException
- is thrown if one of the edits in the
tree can't be executed. The state of the document is undefined if this
exception is thrown.public static boolean isLargeEdit(TextEdit edit)
true
if the passed edit is considered large,
false
otherwise.edit
- the edit to checktrue
if edit
is considered large,
false
otherwise
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.