Class ISourceFileImplSupport.NotifyingReconcileOperation
- Enclosing interface:
- ISourceFileImplSupport
This class or a subclass of this class are not intended to be used by
clients for purposes other than extension or instance creation;
instances of this class or a subclass of this class are not intended
to be used by clients for purposes other than returning from an
implementation of ISourceFileImplSupport.getReconcileOperation_()
.
- See Also:
-
Field Summary
Fields inherited from class org.eclipse.handly.model.impl.support.ISourceFileImplSupport.ReconcileOperation
sourceFile
-
Constructor Summary
ModifierConstructorDescriptionprotected
NotifyingReconcileOperation
(ISourceFileImplSupport sourceFile) Constructs a notifying reconcile operation for the given source file. -
Method Summary
Modifier and TypeMethodDescriptionprotected ElementChangeRecorder
Returns a new instance of element change recorder for this operation.protected void
Reconciles the working copy according to options specified in the given context.protected boolean
shouldNotifyChange
(IContext context) Returns whether the delta notification is needed according to options specified in the given context.Methods inherited from class org.eclipse.handly.model.impl.support.ISourceFileImplSupport.ReconcileOperation
isInitialReconcile, isReconcilingForced, reconcileStructure, shouldReconcileStructure
-
Constructor Details
-
NotifyingReconcileOperation
Constructs a notifying reconcile operation for the given source file.- Parameters:
sourceFile
- notnull
-
-
Method Details
-
reconcile
protected void reconcile(IContext context, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException Reconciles the working copy according to options specified in the given context.The following context options, if simultaneously present, must be mutually consistent:
-
ISourceFileImplSupport.SOURCE_AST
- Specifies the AST to use when reconciling. The AST is safe to read in the dynamic context of this method call, but must not be modified. -
ISourceFileImplSupport.SOURCE_CONTENTS
- Specifies the source string to use when reconciling.
At least one of
SOURCE_AST
orSOURCE_CONTENTS
must have a non-null value in the given context.The given context may provide additional data that this method can use, including the following:
-
ISourceFileImplSupport.SOURCE_SNAPSHOT
- Specifies the source snapshot from whichSOURCE_AST
was created orSOURCE_CONTENTS
was obtained. The snapshot may expire.
Subclasses may override this method, but must make sure to call the super implementation.
This implementation calls
reconcileStructure
if, and only if,shouldReconcileStructure
returnstrue
.If
shouldReconcileStructure
returnstrue
, this implementation invokesreconcileStructure
, builds the resulting delta using an elementchange recorder
, and sends out aPOST_RECONCILE
event using the notification manager registered in the model context.Since 1.1, no delta will be built and no event will be sent by this implementation if
shouldNotifyChange
returnsfalse
.- Overrides:
reconcile
in classISourceFileImplSupport.ReconcileOperation
- Parameters:
context
- the operation context (notnull
)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 reconciled
-
-
shouldNotifyChange
Returns whether the delta notification is needed according to options specified in the given context. If this method returnsfalse
, no delta will be built and no event will be sent.Note that if you override
shouldReconcileStructure
, you might need to override this method too.- Parameters:
context
- the operation context (notnull
)- Returns:
true
if the delta notification is needed, andfalse
otherwise- Since:
- 1.1
- See Also:
-
newChangeRecorder
Returns a new instance of element change recorder for this operation.- Returns:
- a new instance of element change recorder
(never
null
)
-