Package org.eclipse.handly.text
Class DocumentChange
- java.lang.Object
-
- org.eclipse.handly.text.DocumentChange
-
- All Implemented Interfaces:
IDocumentChange
- Direct Known Subclasses:
DocumentChangeOperation.UndoChange
public class DocumentChange extends java.lang.Object implements IDocumentChange
Default implementation ofIDocumentChange.
-
-
Field Summary
-
Fields inherited from interface org.eclipse.handly.text.IDocumentChange
CREATE_UNDO, NONE, UPDATE_REGIONS
-
-
Constructor Summary
Constructors Constructor Description DocumentChange(org.eclipse.text.edits.TextEdit edit)Creates a new document change with the given text edit andCREATE_UNDO|UPDATE_REGIONSstyle.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ISnapshotgetBase()Returns the snapshot on which this change's edit tree is based, ornullif the snapshot is unknown.org.eclipse.text.edits.TextEditgetEdit()Returns the edit tree associated with this change.intgetStyle()Returns the style flags associated with this change.voidsetBase(ISnapshot base)Sets the snapshot on which this change is based.voidsetStyle(int style)Sets the style flags for this change.
-
-
-
Method Detail
-
setBase
public void setBase(ISnapshot base)
Sets the snapshot on which this change is based.- Parameters:
base- the snapshot on which the change is based, ornullif unknown
-
setStyle
public void setStyle(int style)
Sets the style flags for this change. Valid flags areIDocumentChange.NONEor any combination ofIDocumentChange.CREATE_UNDOandIDocumentChange.UPDATE_REGIONS.- Parameters:
style- style flags
-
getEdit
public org.eclipse.text.edits.TextEdit getEdit()
Description copied from interface:IDocumentChangeReturns the edit tree associated with this change.- Specified by:
getEditin interfaceIDocumentChange- Returns:
- the change's edit tree (never
null)
-
getBase
public ISnapshot getBase()
Description copied from interface:IDocumentChangeReturns the snapshot on which this change's edit tree is based, ornullif the snapshot is unknown.- Specified by:
getBasein interfaceIDocumentChange- Returns:
- the snapshot on which the change is based,
or
nullif unknown
-
getStyle
public int getStyle()
Description copied from interface:IDocumentChangeReturns the style flags associated with this change. May returnIDocumentChange.NONEor any combination ofIDocumentChange.CREATE_UNDOandIDocumentChange.UPDATE_REGIONSflags.- Specified by:
getStylein interfaceIDocumentChange- Returns:
- the change's style flags
-
-