- Direct Known Subclasses:
public class TextEditProcessor extends Object
TextEditProcessormanages a set of edits and applies them as a whole to an
This class isn't intended to be subclassed.
- See Also:
- This class is not intended to be subclassed by clients.
Method SummaryModifier and TypeMethodDescription
booleanChecks if the processor can execute all its edits.
protected booleanTells whether this processor considers the given edit.Returns the document to be manipulated.
getRoot()Returns the edit processor's root edit.
getStyle()Returns the style bits of the text edit processorExecutes the text edits.
TextEditProcessorConstructs a new edit processor for the given document.
document- the document to manipulate
root- 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.
getDocumentpublic IDocument getDocument()Returns the document to be manipulated.
- the document
getRootpublic TextEdit getRoot()Returns the edit processor's root edit.
- the processor's root edit
getStylepublic int getStyle()Returns the style bits of the text edit processor
canPerformEditspublic boolean canPerformEdits()Checks if the processor can execute all its edits.
trueif the edits can be executed. Return
falseotherwise. One major reason why edits cannot be executed are wrong offset or length values of edits. Calling perform in this case will very likely end in a
performEditsExecutes the text edits.
- an object representing the undo of the executed edits
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.
considerEditprotected boolean considerEdit
(TextEdit edit)Tells whether this processor considers the given edit.
Note that this class isn't intended to be subclassed.
edit- the text edit
trueif this processor considers the given edit