Class WorkingCopyReconciler
- All Implemented Interfaces:
org.eclipse.jface.text.ITextViewerLifecycle,org.eclipse.jface.text.reconciler.IReconciler
- Direct Known Subclasses:
EditorWorkingCopyReconciler
-
Constructor Summary
ConstructorsConstructorDescriptionWorkingCopyReconciler(Function<org.eclipse.jface.text.IDocument, ISourceFile> documentToSourceFile) Creates a new working copy reconciler with a function that is used to determine the source file for the reconciler's document.WorkingCopyReconciler(IWorkingCopyManager workingCopyManager) Creates a new working copy reconciler with the given working copy manager. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidRegisters the given element change listener with the underlying model.protected voidNotifies that this reconciler is affected in some way by the given element change event.protected voidprotected ObjectReturns the mutex for this reconciler.org.eclipse.jface.text.reconciler.IReconcilingStrategygetReconcilingStrategy(String contentType) protected voidvoidinstall(org.eclipse.jface.text.ITextViewer textViewer) protected booleanisActive()Returns whether this reconciler is currently active.protected booleanisAffectedBy(IElementChangeEvent event) Returns whether this reconciler is affected in some way by the given element change event.protected booleanisAffectedBy(IElementDelta delta, ISourceFile sourceFile) Returns whether this reconciler is affected by the given element delta with regard to the given source file.protected voidprocess(org.eclipse.jface.text.reconciler.DirtyRegion dirtyRegion) protected voidreconcilerDocumentChanged(org.eclipse.jface.text.IDocument newDocument) protected abstract voidRemoves the given element change listener from the underlying model.protected voidsetActive(boolean active) Indicates a change in the active state of this reconciler.voidsetProgressMonitor(org.eclipse.core.runtime.IProgressMonitor monitor) voidsetReconcilingStrategy(org.eclipse.jface.text.reconciler.IReconcilingStrategy strategy) Sets the reconciling strategy that is to be used by this reconciler.voidMethods inherited from class org.eclipse.jface.text.reconciler.AbstractReconciler
aboutToBeReconciled, aboutToWork, getDocument, getProgressMonitor, getTextViewer, isIncrementalReconciler, isRunningInReconcilerThread, reconcilerReset, setDelay, setIsAllowedToModifyDocument, setIsIncrementalReconciler, signalWaitForFinish, startReconciling
-
Constructor Details
-
WorkingCopyReconciler
Creates a new working copy reconciler with the given working copy manager. The working copy manager is used to determine the working copy for the reconciler's document. The reconciler is configured with a single reconciling strategy (by default, aWorkingCopyReconcilingStrategy) that is used irrespective of where a dirty region is located in the reconciler's document.- Parameters:
workingCopyManager- notnull
-
WorkingCopyReconciler
public WorkingCopyReconciler(Function<org.eclipse.jface.text.IDocument, ISourceFile> documentToSourceFile) Creates a new working copy reconciler with a function that is used to determine the source file for the reconciler's document. The reconciler is configured with a single reconciling strategy (by default, aWorkingCopyReconcilingStrategy) that is used irrespective of where a dirty region is located in the reconciler's document.- Parameters:
documentToSourceFile- notnull- Since:
- 1.5
-
-
Method Details
-
setReconcilingStrategy
public void setReconcilingStrategy(org.eclipse.jface.text.reconciler.IReconcilingStrategy strategy) Sets the reconciling strategy that is to be used by this reconciler.- Parameters:
strategy- notnull
-
setProgressMonitor
public void setProgressMonitor(org.eclipse.core.runtime.IProgressMonitor monitor) - Overrides:
setProgressMonitorin classorg.eclipse.jface.text.reconciler.AbstractReconciler
-
install
public void install(org.eclipse.jface.text.ITextViewer textViewer) WorkingCopyReconcilerextends this method toregisteran element change listener thatnotifieswhen a change in the underlying modelaffectsthe reconciler in some way, and also to register a shell listener thatsetsthe active state of the reconciler when the reconciler's text viewer is activated or deactivated.- Specified by:
installin interfaceorg.eclipse.jface.text.reconciler.IReconciler- Specified by:
installin interfaceorg.eclipse.jface.text.ITextViewerLifecycle- Overrides:
installin classorg.eclipse.jface.text.reconciler.AbstractReconciler
-
uninstall
public void uninstall()- Specified by:
uninstallin interfaceorg.eclipse.jface.text.reconciler.IReconciler- Specified by:
uninstallin interfaceorg.eclipse.jface.text.ITextViewerLifecycle- Overrides:
uninstallin classorg.eclipse.jface.text.reconciler.AbstractReconciler
-
getReconcilingStrategy
public org.eclipse.jface.text.reconciler.IReconcilingStrategy getReconcilingStrategy(String contentType) This implementation always returns the single strategy of this reconciler.
-
initialProcess
protected void initialProcess()If the reconciling strategy of this reconciler supports
IReconcilingStrategyExtension, this implementation invokesinitialReconcile()on the strategy under the reconciler'slock.- Overrides:
initialProcessin classorg.eclipse.jface.text.reconciler.AbstractReconciler
-
process
protected void process(org.eclipse.jface.text.reconciler.DirtyRegion dirtyRegion) - Specified by:
processin classorg.eclipse.jface.text.reconciler.AbstractReconciler
-
forceReconciling
protected void forceReconciling()- Overrides:
forceReconcilingin classorg.eclipse.jface.text.reconciler.AbstractReconciler
-
reconcilerDocumentChanged
protected void reconcilerDocumentChanged(org.eclipse.jface.text.IDocument newDocument) - Specified by:
reconcilerDocumentChangedin classorg.eclipse.jface.text.reconciler.AbstractReconciler
-
getReconcilerLock
Returns the mutex for this reconciler. See Bug 66176 for a description of the underlying problem.Default implementation returns
this. Subclasses may override.- Returns:
- the mutex for the reconciler (never
null)
-
addElementChangeListener
Registers the given element change listener with the underlying model.- Parameters:
listener- nevernull
-
removeElementChangeListener
Removes the given element change listener from the underlying model.- Parameters:
listener- nevernull
-
isAffectedBy
Returns whether this reconciler is affected in some way by the given element change event.This implementation delegates to
isAffectedBy(IElementDelta, ISourceFile), passing the source file for the reconciler's document.- Parameters:
event- nevernull- Returns:
trueif the reconciler is affected by the given element change event, andfalseotherwise
-
isAffectedBy
Returns whether this reconciler is affected by the given element delta with regard to the given source file.- Parameters:
delta- nevernullsourceFile- may benull- Returns:
trueif the reconciler is affected by the given delta, andfalseotherwise
-
elementChanged
Notifies that this reconciler is affected in some way by the given element change event.Note: This method may be called in any thread. The event object (and the deltas within it) is valid only for the duration of the invocation of this method.
This implementation schedules a runnable to execute on the UI thread, to synchronize with
setActive(boolean). The runnable will force reconciling if the reconciler is active at that time; it will also record the fact that a significant change occurred in the underlying model.- Parameters:
event- nevernull
-
isActive
protected boolean isActive()Returns whether this reconciler is currently active.- Returns:
trueif this reconciler is currently active, andfalseotherwise
-
setActive
protected void setActive(boolean active) Indicates a change in the active state of this reconciler. This method can only be executed by the UI thread.This implementation sets the active state of the reconciler to the given value. Also, it forces reconciling if a significant model change occurred while the reconciler was not active.
- Parameters:
active- the boolean value to set for the reconciler active state
-