Class ISourceFileImplSupport.NotifyingReconcileOperation

java.lang.Object
org.eclipse.handly.model.impl.support.ISourceFileImplSupport.ReconcileOperation
org.eclipse.handly.model.impl.support.ISourceFileImplSupport.NotifyingReconcileOperation
Enclosing interface:
ISourceFileImplSupport

public static class ISourceFileImplSupport.NotifyingReconcileOperation extends ISourceFileImplSupport.ReconcileOperation
Reconciles a working copy and sends out a delta notification indicating the nature of the change of the working copy since the last time it was reconciled. Uses the notification manager registered in the model context.

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:
  • Constructor Details

    • NotifyingReconcileOperation

      protected NotifyingReconcileOperation(ISourceFileImplSupport sourceFile)
      Constructs a notifying reconcile operation for the given source file.
      Parameters:
      sourceFile - not null
  • 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:

      At least one of SOURCE_AST or SOURCE_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:

      Subclasses may override this method, but must make sure to call the super implementation.

      This implementation calls reconcileStructure if, and only if, shouldReconcileStructure returns true.

      If shouldReconcileStructure returns true, this implementation invokes reconcileStructure, builds the resulting delta using an element change recorder, and sends out a POST_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 returns false.

      Overrides:
      reconcile in class ISourceFileImplSupport.ReconcileOperation
      Parameters:
      context - the operation context (not 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 receiver
      Throws:
      org.eclipse.core.runtime.CoreException - if the working copy could not be reconciled
    • shouldNotifyChange

      protected boolean shouldNotifyChange(IContext context)
      Returns whether the delta notification is needed according to options specified in the given context. If this method returns false, 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 (not null)
      Returns:
      true if the delta notification is needed, and false otherwise
      Since:
      1.1
      See Also:
    • newChangeRecorder

      protected ElementChangeRecorder newChangeRecorder()
      Returns a new instance of element change recorder for this operation.
      Returns:
      a new instance of element change recorder (never null)