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:
- A.setInputModel(M)
- A.reconcile: A reconciles M
- A computes the model for B => MB
- B.setInputModel(MB)
- B.reconcile: B reconciles MB
- B computes the model for C => MC
- C.setInputModel(MC)
- C.reconcile: C reconciles MC
- C returns result RC to step B
- B adapts the RC to MB and merges with its own results
- B returns result RB to step A
- A adapts the result to M and merges with its own results
- A returns the result to the reconcile strategy
This interface must be implemented by clients.
- Since:
- 3.0
-
Method Summary
Modifier and TypeMethodDescriptionReturns the progress monitor used to report progress.boolean
Returns whether this is the first reconcile step or not.boolean
Returns whether this is the last reconcile step or not.Activates non-incremental reconciling.reconcile
(DirtyRegion dirtyRegion, IRegion subRegion) Activates incremental reconciling of the specified dirty region.void
setInputModel
(IReconcilableModel inputModel) Tells this reconcile step on which model it will work.void
Sets the step which is in front of this step in the pipe.void
setProgressMonitor
(IProgressMonitor monitor) Sets the progress monitor for this reconcile step.
-
Method Details
-
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
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
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 ofIReconcilingStrategy.setDocument(org.eclipse.jface.text.IDocument)
.- Parameters:
dirtyRegion
- the document region which has been changedsubRegion
- the sub region in the dirty region which should be reconciled- Returns:
- an array with reconcile results
-
reconcile
Activates non-incremental reconciling. The reconciling strategy is just told that there are changes and that it should reconcile the given partition of the document most recently passed intoIReconcilingStrategy.setDocument(org.eclipse.jface.text.IDocument)
.- Parameters:
partition
- the document partition to be reconciled- Returns:
- an array with reconcile results
-
setProgressMonitor
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
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
-