Interface IReconcileStep

  • All Known Implementing Classes:
    AbstractReconcileStep

    public interface IReconcileStep
    A reconcile step is one of several steps of a reconcile strategy that consists of several steps. This relationship is not coded into an interface but should be used by clients who's reconcile strategy consists of several steps.

    If a reconcile step has an input model it will compute the correct model for the next step in the chain and set the next steps input model before reconcile gets called on that next step. After the last step has reconciled the reconcile result array gets returned to the previous step. Each step in the chain adapts the result to its input model and returns it to its previous step.

    Example: Assume a strategy consists of steps A, B and C. And the main model is M. The strategy will set M to be A's input model. What will happen is:

    1. A.setInputModel(M)
    2. A.reconcile: A reconciles M
    3. A computes the model for B => MB
    4. B.setInputModel(MB)
    5. B.reconcile: B reconciles MB
    6. B computes the model for C => MC
    7. C.setInputModel(MC)
    8. C.reconcile: C reconciles MC
    9. C returns result RC to step B
    10. B adapts the RC to MB and merges with its own results
    11. B returns result RB to step A
    12. A adapts the result to M and merges with its own results
    13. A returns the result to the reconcile strategy

    This interface must be implemented by clients.

    Since:
    3.0
    • Method Detail

      • isLastStep

        boolean isLastStep()
        Returns whether this is the last reconcile step or not.
        Returns:
        true iff this is the last reconcile step
      • isFirstStep

        boolean isFirstStep()
        Returns whether this is the first reconcile step or not.
        Returns:
        true iff this is the first reconcile step
      • setPreviousStep

        void setPreviousStep​(IReconcileStep step)
        Sets the step which is in front of this step in the pipe.

        Note: This method must be called at most once per reconcile step.

        Parameters:
        step - the previous step
        Throws:
        RuntimeException - if called more than once
      • reconcile

        IReconcileResult[] reconcile​(DirtyRegion dirtyRegion,
                                     IRegion subRegion)
        Activates incremental reconciling of the specified dirty region. As a dirty region might span multiple content types, the segment of the dirty region which should be investigated is also provided to this reconciling strategy. The given regions refer to the document passed into the most recent call of IReconcilingStrategy.setDocument(org.eclipse.jface.text.IDocument).
        Parameters:
        dirtyRegion - the document region which has been changed
        subRegion - the sub region in the dirty region which should be reconciled
        Returns:
        an array with reconcile results
      • setProgressMonitor

        void setProgressMonitor​(IProgressMonitor monitor)
        Sets the progress monitor for this reconcile step.
        Parameters:
        monitor - the progress monitor to be used
      • getProgressMonitor

        IProgressMonitor getProgressMonitor()
        Returns the progress monitor used to report progress.
        Returns:
        a progress monitor or null if no progress monitor is available
      • setInputModel

        void setInputModel​(IReconcilableModel inputModel)
        Tells this reconcile step on which model it will work. This method will be called before any other method and can be called multiple times. The regions passed to the other methods always refer to the most recent model passed into this method.
        Parameters:
        inputModel - the model on which this step will work