Package org.eclipse.handly.model.impl
Interface IWorkingCopyCallback
- All Known Implementing Classes:
DefaultWorkingCopyCallback
,WorkingCopyCallback
,XtextWorkingCopyCallback
public interface IWorkingCopyCallback
Receives notifications related to the lifecycle of a working copy
and intercepts calls related to reconciling of the working copy.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns whether the working copy needs reconciling, i.e., its buffer has been modified since the last time it was reconciled.void
Informs this callback that the working copy has been disposed.void
onInit
(IWorkingCopyInfo info) Informs this callback about the working copy it will work on.void
Reconciles the working copy.
-
Method Details
-
onInit
Informs this callback about the working copy it will work on. This method is called before any other method and marks the start of the callback's lifecycle.Clients should not call this method (the model implementation calls it at appropriate times).
- Parameters:
info
- the working copy info (nevernull
)- Throws:
org.eclipse.core.runtime.CoreException
- if this callback was not initialized successfully
-
onDispose
void onDispose()Informs this callback that the working copy has been disposed. This is the last method called on the callback and marks the end of the callback's lifecycle.Clients should not call this method (the model implementation calls it at appropriate times).
-
needsReconciling
boolean needsReconciling()Returns whether the working copy needs reconciling, i.e., its buffer has been modified since the last time it was reconciled.Clients should not call this method (the model implementation calls it at appropriate times).
- Returns:
true
if the working copy needs reconciling, andfalse
otherwise
-
reconcile
void reconcile(IContext context, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException Reconciles the working copy.Clients should not call this method (the model implementation calls it at appropriate times).
Implementations are encouraged to support the following standard options, which may be specified in the given context:
-
FORCE_RECONCILING
- Indicates whether reconciling has to be performed even if the working copy buffer has not been modified since the last time the working copy was reconciled.
An implementation of this method is supposed to invoke the working copy's
reconcile strategy
by calling itsreconcile
method with an appropriately augmented context while providing the necessary synchronization guarantees.- Parameters:
context
- the operation context (nevernull
)monitor
- a progress monitor, ornull
if progress reporting is not desired. The caller must not rely onIProgressMonitor.done()
having been called by the receiver- Throws:
org.eclipse.core.runtime.CoreException
- if the working copy could not be reconciledorg.eclipse.core.runtime.OperationCanceledException
- if this method is canceled
-
-