Class AbstractReconciler
java.lang.Object
org.eclipse.jface.text.reconciler.AbstractReconciler
- All Implemented Interfaces:
- ITextViewerLifecycle,- IReconciler
- Direct Known Subclasses:
- MonoReconciler,- Reconciler
Abstract implementation of 
IReconciler. The reconciler
 listens to input document changes as well as changes of
 the input document of the text viewer it is installed on. Depending on
 its configuration it manages the received change notifications in a
 queue folding neighboring or overlapping changes together. The reconciler
 processes the dirty regions as a background activity after having waited for further
 changes for the configured duration of time. A reconciler is started using the
 install(ITextViewer) method.  As a first step initialProcess() is
 executed in the background. Then, the reconciling thread waits for changes that
 need to be reconciled. A reconciler can be resumed by calling forceReconciling()
 independent from the existence of actual changes. This mechanism is for subclasses only.
 It is the clients responsibility to stop a reconciler using its uninstall()
 method. Unstopped reconcilers do not free their resources.
 It is subclass responsibility to specify how dirty regions are processed.
- Since:
- 2.0
- See Also:
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedCreates a new reconciler without configuring it.
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidHook for subclasses which want to perform some action as soon as reconciliation is needed.protected voidHook for subclasses which want to perform some action as soon as the reconciler starts work (initial or reconciling) or waiting.protected voidForces the reconciler to reconcile the structure of the whole document.protected IDocumentReturns the input document of the text viewer this reconciler is installed on.protected IProgressMonitorReturns the progress monitor of this reconciler.protected ITextViewerReturns the text viewer this reconciler is installed on.protected voidThis method is called on startup of the background activity.voidinstall(ITextViewer textViewer) Installs the reconciler on the given text viewer.protected booleanReturns whether any of the reconciling strategies is interested in detailed dirty region information.protected booleanTells whether the code is running in this reconciler's background thread.protected abstract voidprocess(DirtyRegion dirtyRegion) Processes a dirty region.protected abstract voidreconcilerDocumentChanged(IDocument newDocument) Hook called when the document whose contents should be reconciled has been changed, i.e., the input document of the text viewer this reconciler is installed on.protected voidHook that is called after the reconciler thread has been reset.voidsetDelay(int delay) Tells the reconciler how long it should wait for further text changes before activating the appropriate reconciling strategies.voidsetIsAllowedToModifyDocument(boolean isAllowedToModify) Tells the reconciler whether it is allowed to change the document inside its reconciler thread.voidsetIsIncrementalReconciler(boolean isIncremental) Tells the reconciler whether any of the available reconciling strategies is interested in getting detailed dirty region information or just in the fact that the document has been changed.voidsetProgressMonitor(IProgressMonitor monitor) Sets the progress monitor of this reconciler.voidSignal reconciling should finish as soon as possible.protected voidStarts the reconciler to reconcile the queued dirty-regions.voidRemoves the reconciler from the text viewer it has previously been installed on.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.jface.text.reconciler.IReconcilergetReconcilingStrategy
- 
Constructor Details- 
AbstractReconcilerprotected AbstractReconciler()Creates a new reconciler without configuring it.
 
- 
- 
Method Details- 
processProcesses a dirty region. If the dirty region isnullthe whole document is consider being dirty. The dirty region is partitioned by the document and each partition is handed over to a reconciling strategy registered for the partition's content type.- Parameters:
- dirtyRegion- the dirty region to be processed
 
- 
reconcilerDocumentChangedHook called when the document whose contents should be reconciled has been changed, i.e., the input document of the text viewer this reconciler is installed on. Usually, subclasses use this hook to inform all their reconciling strategies about the change.- Parameters:
- newDocument- the new reconciler document
 
- 
setDelaypublic void setDelay(int delay) Tells the reconciler how long it should wait for further text changes before activating the appropriate reconciling strategies.- Parameters:
- delay- the duration in milliseconds of a change collection period.
 
- 
setIsIncrementalReconcilerpublic void setIsIncrementalReconciler(boolean isIncremental) Tells the reconciler whether any of the available reconciling strategies is interested in getting detailed dirty region information or just in the fact that the document has been changed. In the second case, the reconciling can not incrementally be pursued.- Parameters:
- isIncremental- indicates whether this reconciler will be configured with incremental reconciling strategies
- See Also:
 
- 
setIsAllowedToModifyDocumentpublic void setIsAllowedToModifyDocument(boolean isAllowedToModify) Tells the reconciler whether it is allowed to change the document inside its reconciler thread.If this is set to falseanUnsupportedOperationExceptionwill be thrown when this restriction will be violated.- Parameters:
- isAllowedToModify- indicates whether this reconciler is allowed to modify the document
- Since:
- 3.2
 
- 
setProgressMonitorSets the progress monitor of this reconciler.- Parameters:
- monitor- the monitor to be used
 
- 
isIncrementalReconcilerprotected boolean isIncrementalReconciler()Returns whether any of the reconciling strategies is interested in detailed dirty region information.- Returns:
- whether this reconciler is incremental
- See Also:
 
- 
getDocumentReturns the input document of the text viewer this reconciler is installed on.- Returns:
- the reconciler document
 
- 
getTextViewerReturns the text viewer this reconciler is installed on.- Returns:
- the text viewer this reconciler is installed on
 
- 
getProgressMonitorReturns the progress monitor of this reconciler.- Returns:
- the progress monitor of this reconciler
 
- 
installDescription copied from interface:IReconcilerInstalls the reconciler on the given text viewer. After this method has been finished, the reconciler is operational, i.e., it works without requesting further client actions untiluninstallis called.- Specified by:
- installin interface- IReconciler
- Specified by:
- installin interface- ITextViewerLifecycle
- Parameters:
- textViewer- the viewer on which the reconciler is installed
 
- 
uninstallpublic void uninstall()Description copied from interface:IReconcilerRemoves the reconciler from the text viewer it has previously been installed on.- Specified by:
- uninstallin interface- IReconciler
- Specified by:
- uninstallin interface- ITextViewerLifecycle
 
- 
aboutToBeReconciledprotected void aboutToBeReconciled()Hook for subclasses which want to perform some action as soon as reconciliation is needed.Default implementation is to do nothing. - Since:
- 3.0
 
- 
aboutToWorkprotected void aboutToWork()Hook for subclasses which want to perform some action as soon as the reconciler starts work (initial or reconciling) or waiting.Default implementation is to do nothing. Implementors may call signalWaitForFinish().- Since:
- 3.20
- See Also:
 
- 
signalWaitForFinishpublic void signalWaitForFinish()Signal reconciling should finish as soon as possible.- Since:
- 3.20
- See Also:
 
- 
initialProcessprotected void initialProcess()This method is called on startup of the background activity. It is called only once during the life time of the reconciler. Clients may reimplement this method.
- 
forceReconcilingprotected void forceReconciling()Forces the reconciler to reconcile the structure of the whole document. Clients may extend this method.
- 
startReconcilingprotected void startReconciling()Starts the reconciler to reconcile the queued dirty-regions. Clients may extend this method.
- 
reconcilerResetprotected void reconcilerReset()Hook that is called after the reconciler thread has been reset.
- 
isRunningInReconcilerThreadprotected boolean isRunningInReconcilerThread()Tells whether the code is running in this reconciler's background thread.- Returns:
- trueif running in this reconciler's background thread
- Since:
- 3.4
 
 
-