Class MonoReconciler

All Implemented Interfaces:
ITextViewerLifecycle, IReconciler

public class MonoReconciler extends AbstractReconciler
Standard implementation of IReconciler. The reconciler is configured with a single reconciling strategy that is used independently from where a dirty region is located in the reconciler's document.

Usually, clients instantiate this class and configure it before using it.

See Also:
  • Constructor Details

    • MonoReconciler

      public MonoReconciler(IReconcilingStrategy strategy, boolean isIncremental)
      Creates a new reconciler that uses the same reconciling strategy to reconcile its document independent of the type of the document's contents.
      strategy - the reconciling strategy to be used
      isIncremental - the indication whether strategy is incremental or not
  • Method Details

    • getReconcilingStrategy

      public IReconcilingStrategy getReconcilingStrategy(String contentType)
      Description copied from interface: IReconciler
      Returns the reconciling strategy registered with the reconciler for the specified content type.
      contentType - the content type for which to determine the reconciling strategy
      the reconciling strategy registered for the given content type, or null if there is no such strategy
    • process

      protected void process(DirtyRegion dirtyRegion)
      Description copied from class: AbstractReconciler
      Processes a dirty region. If the dirty region is null the 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.
      Specified by:
      process in class AbstractReconciler
      dirtyRegion - the dirty region to be processed
    • reconcilerDocumentChanged

      protected void reconcilerDocumentChanged(IDocument document)
      Description copied from class: AbstractReconciler
      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. Usually, subclasses use this hook to inform all their reconciling strategies about the change.
      Specified by:
      reconcilerDocumentChanged in class AbstractReconciler
      document - the new reconciler document
    • setProgressMonitor

      public void setProgressMonitor(IProgressMonitor monitor)
      Description copied from class: AbstractReconciler
      Sets the progress monitor of this reconciler.
      setProgressMonitor in class AbstractReconciler
      monitor - the monitor to be used
    • initialProcess

      protected void initialProcess()
      Description copied from class: AbstractReconciler
      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.
      initialProcess in class AbstractReconciler
    • install

      public void install(ITextViewer textViewer)
      Description copied from interface: IReconciler
      Installs 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 until uninstall is called.
      Specified by:
      install in interface IReconciler
      Specified by:
      install in interface ITextViewerLifecycle
      install in class AbstractReconciler
      textViewer - the viewer on which the reconciler is installed
    • uninstall

      public void uninstall()
      Description copied from interface: IReconciler
      Removes the reconciler from the text viewer it has previously been installed on.
      Specified by:
      uninstall in interface IReconciler
      Specified by:
      uninstall in interface ITextViewerLifecycle
      uninstall in class AbstractReconciler