Class IXtextFile.ModifyingUnitOfWork
- java.lang.Object
-
- org.eclipse.xtext.util.concurrent.IUnitOfWork.Void<org.eclipse.xtext.resource.XtextResource>
-
- com._1c.g5.ides.core.handle.xtext.IXtextFile.ModifyingUnitOfWork
-
- All Implemented Interfaces:
IXtextFile.IModifyingUnitOfWork<Object>
,org.eclipse.xtext.util.concurrent.IUnitOfWork<Object,org.eclipse.xtext.resource.XtextResource>
- Direct Known Subclasses:
IXtextFile.ModifyingUnitOfWorkWithDelegate
- Enclosing interface:
- IXtextFile
public abstract static class IXtextFile.ModifyingUnitOfWork extends org.eclipse.xtext.util.concurrent.IUnitOfWork.Void<org.eclipse.xtext.resource.XtextResource> implements IXtextFile.IModifyingUnitOfWork<Object>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.xtext.util.concurrent.IUnitOfWork
org.eclipse.xtext.util.concurrent.IUnitOfWork.Void<T extends Object>
-
-
Constructor Summary
Constructors Constructor Description ModifyingUnitOfWork()
Creates an undoable unit of work that will not be retried.ModifyingUnitOfWork(int maxRetries)
Creates an undoable unit of work that can be retried the given number of times.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
acceptUndoChange(org.eclipse.handly.buffer.IBufferChange undoChange)
Notification of an undo change.org.eclipse.handly.buffer.IBufferChange
getUndoChange()
org.eclipse.handly.buffer.IBufferChange
newBufferChange(org.eclipse.text.edits.TextEdit edit, org.eclipse.handly.snapshot.ISnapshot base)
Returns a new buffer change according to the given specifications.boolean
shouldRetry()
Returns whether the transaction should be retried if it has failed due to a stale snapshot.
-
-
-
Method Detail
-
newBufferChange
public org.eclipse.handly.buffer.IBufferChange newBufferChange(org.eclipse.text.edits.TextEdit edit, org.eclipse.handly.snapshot.ISnapshot base)
Description copied from interface:IXtextFile.IModifyingUnitOfWork
Returns a new buffer change according to the given specifications.- Specified by:
newBufferChange
in interfaceIXtextFile.IModifyingUnitOfWork<Object>
- Parameters:
edit
- the text edit (notnull
)base
- the snapshot on which the change is based (notnull
)- Returns:
- the created buffer change (never
null
)
-
acceptUndoChange
public void acceptUndoChange(org.eclipse.handly.buffer.IBufferChange undoChange)
Description copied from interface:IXtextFile.IModifyingUnitOfWork
Notification of an undo change.- Specified by:
acceptUndoChange
in interfaceIXtextFile.IModifyingUnitOfWork<Object>
- Parameters:
undoChange
- the undo change, ornull
if the change created by this unit of work was not undoable
-
getUndoChange
public final org.eclipse.handly.buffer.IBufferChange getUndoChange()
- Returns:
- the undo change, or
null
if the undo change has not been accepted yet or the change created by this unit of work was not undoable
-
shouldRetry
public boolean shouldRetry()
Description copied from interface:IXtextFile.IModifyingUnitOfWork
Returns whether the transaction should be retried if it has failed due to a stale snapshot. Note that iftrue
is always returned, it may lead to an infinite loop.- Specified by:
shouldRetry
in interfaceIXtextFile.IModifyingUnitOfWork<Object>
- Returns:
true
if the transaction should be retried,false
otherwise
-
-