Class XtextWorkingCopyCallback
- All Implemented Interfaces:
IWorkingCopyCallback
IWorkingCopyCallback. Reconciles the
working copy when the underlying HandlyXtextDocument is reconciled.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final HandlyXtextDocumentReturns the underlying document of the working copy buffer.final booleanReturns whether the working copy needs reconciling, i.e., its buffer has been modified since the last time it was reconciled.voidInforms this callback that the working copy has been disposed.voidonInit(IWorkingCopyInfo info) Informs this callback about the working copy it will work on.final voidReconciles the working copy.Methods inherited from class org.eclipse.handly.model.impl.WorkingCopyCallback
getWorkingCopyInfo
-
Constructor Details
-
XtextWorkingCopyCallback
public XtextWorkingCopyCallback()
-
-
Method Details
-
onInit
Description copied from class:WorkingCopyCallbackInforms 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).
Subclasses may override this method, but must make sure to call the super implementation.
- Specified by:
onInitin interfaceIWorkingCopyCallback- Overrides:
onInitin classWorkingCopyCallback- Parameters:
info- the working copy info (nevernull)- Throws:
org.eclipse.core.runtime.CoreException- if this callback was not initialized successfully
-
onDispose
public void onDispose()Description copied from class:WorkingCopyCallbackInforms 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).
Subclasses may override this method, but must make sure to call the super implementation.
- Specified by:
onDisposein interfaceIWorkingCopyCallback- Overrides:
onDisposein classWorkingCopyCallback
-
needsReconciling
public final boolean needsReconciling()Description copied from interface:IWorkingCopyCallbackReturns 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:
trueif the working copy needs reconciling, andfalseotherwise
-
reconcile
public final void reconcile(IContext context, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException Description copied from interface:IWorkingCopyCallbackReconciles 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 strategyby calling itsreconcilemethod with an appropriately augmented context while providing the necessary synchronization guarantees.- Parameters:
context- the operation context (nevernull)monitor- a progress monitor, ornullif 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 reconciled
-
-
getDocument
Returns the underlying document of the working copy buffer.- Returns:
- the underlying document (never
null)
-