Package org.eclipse.jface.text
Class RewriteSessionEditProcessor
- java.lang.Object
-
- org.eclipse.text.edits.TextEditProcessor
-
- org.eclipse.jface.text.RewriteSessionEditProcessor
-
public final class RewriteSessionEditProcessor extends TextEditProcessor
A text edit processor that brackets the application of edits into a document rewrite session.- Since:
- 3.3
-
-
Constructor Summary
Constructors Constructor Description RewriteSessionEditProcessor(IDocument document, TextEdit root, int style)Constructs a new edit processor for the given document.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static booleanisLargeEdit(TextEdit edit)Returnstrueif the passed edit is considered large,falseotherwise.UndoEditperformEdits()Executes the text edits.-
Methods inherited from class org.eclipse.text.edits.TextEditProcessor
canPerformEdits, considerEdit, getDocument, getRoot, getStyle
-
-
-
-
Constructor Detail
-
RewriteSessionEditProcessor
public RewriteSessionEditProcessor(IDocument document, TextEdit root, int style)
Constructs a new edit processor for the given document.- Parameters:
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_UNDOorTextEdit.UPDATE_REGIONS)
-
-
Method Detail
-
performEdits
public UndoEdit performEdits() throws MalformedTreeException, BadLocationException
Description copied from class:TextEditProcessorExecutes the text edits.- Overrides:
performEditsin classTextEditProcessor- Returns:
- an object representing the undo of the executed edits
- Throws:
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.
-
isLargeEdit
public static boolean isLargeEdit(TextEdit edit)
Returnstrueif the passed edit is considered large,falseotherwise.- Parameters:
edit- the edit to check- Returns:
trueifeditis considered large,falseotherwise- Since:
- 3.3
-
-