Package org.eclipse.handly.buffer
Interface IBufferChange
- All Known Implementing Classes:
BufferChange,BufferChangeOperation.UndoChange
public interface IBufferChange
Describes a text change to be applied to an
IBuffer.- See Also:
- Restriction:
- This interface is not intended to be extended by clients.
- Restriction:
- This interface is not intended to be implemented by clients.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intFlag indicating that applying a change to a buffer is supposed to create a corresponding undo change.static final intFlag indicating that neitherCREATE_UNDOnorUPDATE_REGIONSis set.static final intFlag indicating that edit regions in the change's edit tree will be updated to reflect their positions in the changed buffer. -
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(org.eclipse.text.edits.TextEdit edit) Tells whether this change contains the given edit.getBase()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.Returns the save mode associated with this change.intgetStyle()Returns the style flags associated with this change.
-
Field Details
-
NONE
static final int NONEFlag indicating that neitherCREATE_UNDOnorUPDATE_REGIONSis set.- See Also:
-
CREATE_UNDO
static final int CREATE_UNDOFlag indicating that applying a change to a buffer is supposed to create a corresponding undo change. If not specified,nullis returned fromIBuffer.applyChange(org.eclipse.handly.buffer.IBufferChange, org.eclipse.core.runtime.IProgressMonitor)method.- See Also:
-
UPDATE_REGIONS
static final int UPDATE_REGIONSFlag indicating that edit regions in the change's edit tree will be updated to reflect their positions in the changed buffer. If not specified, the edit regions will be arbitrary; it is even not guaranteed that the edit tree is still well formed after applying the change.- See Also:
-
-
Method Details
-
getEdit
org.eclipse.text.edits.TextEdit getEdit()Returns the edit tree associated with this change.- Returns:
- the change's edit tree (never
null)
-
contains
boolean contains(org.eclipse.text.edits.TextEdit edit) Tells whether this change contains the given edit. Note that, in general, this is orthogonal to whether the change's edit tree contains that edit. The edits that are not contained by the change must not be executed when the change is applied.- Parameters:
edit- a text edit- Returns:
trueif the change contains the given edit, andfalseotherwise
-
getBase
ISnapshot getBase()Returns the snapshot on which this change's edit tree is based, ornullif the snapshot is unknown.- Returns:
- the snapshot on which the change is based,
or
nullif unknown
-
getStyle
int getStyle()Returns the style flags associated with this change. May returnNONEor any combination ofCREATE_UNDOandUPDATE_REGIONSflags.- Returns:
- the change's style flags
-
getSaveMode
SaveMode getSaveMode()Returns the save mode associated with this change.- Returns:
- the change's save mode
-