Package org.eclipse.text.undo
Class DocumentUndoEvent
- java.lang.Object
-
- org.eclipse.text.undo.DocumentUndoEvent
-
public class DocumentUndoEvent extends Object
Describes document changes initiated by undo or redo.Clients are not supposed to subclass or create instances of this class.
- Since:
- 3.2
- See Also:
IDocumentUndoManager,IDocumentUndoListener- Restriction:
- This class is not intended to be subclassed by clients.
- Restriction:
- This class is not intended to be instantiated by clients.
-
-
Field Summary
Fields Modifier and Type Field Description static intABOUT_TO_REDOIndicates that the described document event is about to be redone.static intABOUT_TO_UNDOIndicates that the described document event is about to be undone.static intCOMPOUNDIndicates that the described document event is a compound undo or redo event.static intREDONEIndicates that the described document event has been redone.static intUNDONEIndicates that the described document event has been undone.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IDocumentgetDocument()Returns the changed document.intgetEventType()Returns the type of event that is occurring.intgetOffset()Returns the offset of the change.StringgetPreservedText()Returns the text that has been replaced.ObjectgetSource()Returns the source that triggered this event.StringgetText()Returns the text that has been inserted.booleanisCompound()Returns whether the change was a compound change or not.
-
-
-
Field Detail
-
ABOUT_TO_UNDO
public static final int ABOUT_TO_UNDO
Indicates that the described document event is about to be undone.- See Also:
- Constant Field Values
-
ABOUT_TO_REDO
public static final int ABOUT_TO_REDO
Indicates that the described document event is about to be redone.- See Also:
- Constant Field Values
-
UNDONE
public static final int UNDONE
Indicates that the described document event has been undone.- See Also:
- Constant Field Values
-
REDONE
public static final int REDONE
Indicates that the described document event has been redone.- See Also:
- Constant Field Values
-
COMPOUND
public static final int COMPOUND
Indicates that the described document event is a compound undo or redo event.- See Also:
- Constant Field Values
-
-
Method Detail
-
getDocument
public IDocument getDocument()
Returns the changed document.- Returns:
- the changed document
-
getOffset
public int getOffset()
Returns the offset of the change.- Returns:
- the offset of the change
-
getText
public String getText()
Returns the text that has been inserted.- Returns:
- the text that has been inserted
-
getPreservedText
public String getPreservedText()
Returns the text that has been replaced.- Returns:
- the text that has been replaced
-
getEventType
public int getEventType()
Returns the type of event that is occurring.- Returns:
- the bit mask that indicates the type (or types) of the event
-
getSource
public Object getSource()
Returns the source that triggered this event.- Returns:
- the source that triggered this event.
-
isCompound
public boolean isCompound()
Returns whether the change was a compound change or not.- Returns:
trueif the undo or redo change is a compound change,falseif it is not
-
-