public class XtextWorkingCopyCallback extends WorkingCopyCallback
IWorkingCopyCallback
. Reconciles the
working copy when the underlying HandlyXtextDocument
is reconciled.Constructor and Description |
---|
XtextWorkingCopyCallback() |
Modifier and Type | Method and Description |
---|---|
protected HandlyXtextDocument |
getDocument()
Returns the underlying document of the working copy buffer.
|
boolean |
needsReconciling()
Returns whether the working copy needs reconciling, i.e.,
its buffer has been modified since the last time it was reconciled.
|
void |
onDispose()
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 |
reconcile(IContext context,
org.eclipse.core.runtime.IProgressMonitor monitor)
Reconciles the working copy.
|
getWorkingCopyInfo
public void onInit(IWorkingCopyInfo info) throws org.eclipse.core.runtime.CoreException
WorkingCopyCallback
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.
onInit
in interface IWorkingCopyCallback
onInit
in class WorkingCopyCallback
info
- the working copy info (never null
)org.eclipse.core.runtime.CoreException
- if this callback was not initialized successfullypublic void onDispose()
WorkingCopyCallback
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.
onDispose
in interface IWorkingCopyCallback
onDispose
in class WorkingCopyCallback
public final boolean needsReconciling()
IWorkingCopyCallback
Clients should not call this method (the model implementation calls it at appropriate times).
true
if the working copy needs reconciling,
and false
otherwisepublic final void reconcile(IContext context, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
IWorkingCopyCallback
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 its reconcile
method with an appropriately augmented context while providing
the necessary synchronization guarantees.
context
- the operation context (never null
)monitor
- a progress monitor, or null
if progress reporting is not desired. The caller must not rely on
IProgressMonitor.done()
having been called by the receiverorg.eclipse.core.runtime.CoreException
- if the working copy could not be reconciledprotected final HandlyXtextDocument getDocument()
null
)Copyright (c) 2014, 2020 1C-Soft LLC and others. Made available under the Eclipse Public License 2.0