Package org.eclipse.handly.ui.text.reconciler

# Class EditorWorkingCopyReconciler

java.lang.Object
org.eclipse.jface.text.reconciler.AbstractReconciler
org.eclipse.handly.ui.text.reconciler.WorkingCopyReconciler
org.eclipse.handly.ui.text.reconciler.EditorWorkingCopyReconciler

All Implemented Interfaces:
  `org.eclipse.jface.text.ITextViewerLifecycle`, `org.eclipse.jface.text.reconciler.IReconciler`

public abstract class EditorWorkingCopyReconciler extends WorkingCopyReconciler
An abstract base class of a working copy reconciler that is activated on editor activation and forces reconciling on a significant change in the underlying model.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `EditorWorkingCopyReconciler(org.eclipse.ui.IEditorPart editor, Function<org.eclipse.jface.text.IDocument,ISourceFile> documentToSourceFile)`
  Creates a new working copy reconciler for the given editor and with a function that is used to determine the source file for the reconciler's document.
  `EditorWorkingCopyReconciler(org.eclipse.ui.IEditorPart editor, IWorkingCopyManager workingCopyManager)`
  Creates a new working copy reconciler for the given editor and with the given working copy manager.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected final org.eclipse.ui.IEditorPart`
  `getEditor()`
  Returns the editor this reconciler is associated with.
  `protected Object`
  `getReconcilerLock()`
  Returns the mutex for this reconciler.
  `void`
  `install(org.eclipse.jface.text.ITextViewer textViewer)`
  `void`
  `uninstall()`

  ### Methods inherited from class org.eclipse.handly.ui.text.reconciler.WorkingCopyReconciler

  `addElementChangeListener, elementChanged, forceReconciling, getReconcilingStrategy, initialProcess, isActive, isAffectedBy, isAffectedBy, process, reconcilerDocumentChanged, removeElementChangeListener, setActive, setProgressMonitor, setReconcilingStrategy`

  ### Methods inherited from class org.eclipse.jface.text.reconciler.AbstractReconciler

  `aboutToBeReconciled, aboutToWork, getDocument, getProgressMonitor, getTextViewer, isIncrementalReconciler, isRunningInReconcilerThread, reconcilerReset, setDelay, setIsAllowedToModifyDocument, setIsIncrementalReconciler, signalWaitForFinish, startReconciling`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### EditorWorkingCopyReconciler

    public EditorWorkingCopyReconciler(org.eclipse.ui.IEditorPart editor, IWorkingCopyManager workingCopyManager)
    Creates a new working copy reconciler for the given editor and 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, a `WorkingCopyReconcilingStrategy`) that is used irrespective of where a dirty region is located in the reconciler's document.
    Parameters:
      `editor` - not `null`
      `workingCopyManager` - not `null`

  - ### EditorWorkingCopyReconciler

    public EditorWorkingCopyReconciler(org.eclipse.ui.IEditorPart editor, Function<org.eclipse.jface.text.IDocument,ISourceFile> documentToSourceFile)
    Creates a new working copy reconciler for the given editor and 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, a `WorkingCopyReconcilingStrategy`) that is used irrespective of where a dirty region is located in the reconciler's document.
    Parameters:
      `editor` - not `null`
      `documentToSourceFile` - not `null`
    Since:
      1.5

- ## Method Details

  - ### install

    public void install(org.eclipse.jface.text.ITextViewer textViewer)

    `WorkingCopyReconciler` extends this method to `register` an element change listener that `notifies` when a change in the underlying model `affects` the reconciler in some way, and also to register a shell listener that `sets` the active state of the reconciler when the reconciler's text viewer is activated or deactivated.

    `EditorWorkingCopyReconciler` extends this method to register a part listener that sets the active state of the reconciler when the reconciler's editor is activated or deactivated.

    Specified by:
      `install` in interface `org.eclipse.jface.text.reconciler.IReconciler`
    Specified by:
      `install` in interface `org.eclipse.jface.text.ITextViewerLifecycle`
    Overrides:
      `install` in class `WorkingCopyReconciler`

  - ### uninstall

    public void uninstall()
    Specified by:
      `uninstall` in interface `org.eclipse.jface.text.reconciler.IReconciler`
    Specified by:
      `uninstall` in interface `org.eclipse.jface.text.ITextViewerLifecycle`
    Overrides:
      `uninstall` in class `WorkingCopyReconciler`

  - ### getReconcilerLock

    protected Object getReconcilerLock()
    Returns the mutex for this reconciler. See Bug 66176 for a description of the underlying problem.

    This implementation returns the editor object as returned by `getEditor()`.

    Overrides:
      `getReconcilerLock` in class `WorkingCopyReconciler`
    Returns:
      the mutex for the reconciler (never `null`)

  - ### getEditor

    protected final org.eclipse.ui.IEditorPart getEditor()
    Returns the editor this reconciler is associated with. The association is immutable.
    Returns:
      the reconciler's editor (never `null`)