Package org.eclipse.jface.text.reconciler

# Class Reconciler

java.lang.Object
org.eclipse.jface.text.reconciler.AbstractReconciler
org.eclipse.jface.text.reconciler.Reconciler

All Implemented Interfaces:
  `ITextViewerLifecycle`, `IReconciler`, `IReconcilerExtension`

public class Reconciler extends AbstractReconciler implements IReconcilerExtension
Standard implementation of `IReconciler`. The reconciler is configured with a set of reconciling strategies each of which is responsible for a particular content type.

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

See Also:
  - `IDocumentListener`
  - `ITextInputListener`
  - `DirtyRegion`

## Constructor Summary

Constructors
Constructor
Description
`Reconciler()`
Creates a new reconciler with the following configuration: it is an incremental reconciler with a standard delay of 500 milliseconds.

## Method Summary

Modifier and Type
Method
Description
`String`
`getDocumentPartitioning()`
Returns the partitioning this reconciler is using.
`IReconcilingStrategy`
`getReconcilingStrategy(String contentType)`
Returns the reconciling strategy registered with the reconciler for the specified content type.
`protected void`
`initialProcess()`
This method is called on startup of the background activity.
`void`
`install(ITextViewer textViewer)`
Installs the reconciler on the given text viewer.
`protected void`
`process(DirtyRegion dirtyRegion)`
Processes a dirty region.
`protected void`
`reconcilerDocumentChanged(IDocument document)`
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.
`void`
`setDocumentPartitioning(String partitioning)`
Sets the document partitioning for this reconciler.
`void`
`setProgressMonitor(IProgressMonitor monitor)`
Sets the progress monitor of this reconciler.
`void`
`setReconcilingStrategy(IReconcilingStrategy strategy, String contentType)`
Registers a given reconciling strategy for a particular content type.
`void`
`uninstall()`
Removes the reconciler from the text viewer it has previously been installed on.

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

`aboutToBeReconciled, aboutToWork, forceReconciling, 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

### Reconciler

public Reconciler()
Creates a new reconciler with the following configuration: it is an incremental reconciler with a standard delay of 500 milliseconds. There are no predefined reconciling strategies. The partitioning it uses is the default partitioning `IDocumentExtension3.DEFAULT_PARTITIONING`.

## Method Details

### setDocumentPartitioning

public void setDocumentPartitioning(String partitioning)
Sets the document partitioning for this reconciler.

Parameters:
  `partitioning` - the document partitioning for this reconciler
Since:
  3.0

### getDocumentPartitioning

public String getDocumentPartitioning()
Description copied from interface: `IReconcilerExtension`
Returns the partitioning this reconciler is using.

Specified by:
  `getDocumentPartitioning` in interface `IReconcilerExtension`
Returns:
  the partitioning this reconciler is using

### setReconcilingStrategy

public void setReconcilingStrategy(IReconcilingStrategy strategy, String contentType)
Registers a given reconciling strategy for a particular content type. If there is already a strategy registered for this type, the new strategy is registered instead of the old one.

Parameters:
  `strategy` - the reconciling strategy to register, or `null` to remove an existing one
  `contentType` - the content type under which to register

### getReconcilingStrategy

public IReconcilingStrategy getReconcilingStrategy(String contentType)
Description copied from interface: `IReconciler`
Returns the reconciling strategy registered with the reconciler for the specified content type.

Specified by:
  `getReconcilingStrategy` in interface `IReconciler`
Parameters:
  `contentType` - the content type for which to determine the reconciling strategy
Returns:
  the reconciling strategy registered for the given content type, or `null` if there is no such strategy

### process

protected void process(DirtyRegion dirtyRegion)
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`
Parameters:
  `dirtyRegion` - the dirty region to be processed
See Also:
  - `AbstractReconciler.process(DirtyRegion)`

### 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`
Parameters:
  `document` - the new reconciler document

### 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`
Overrides:
  `install` in class `AbstractReconciler`
Parameters:
  `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`
Overrides:
  `uninstall` in class `AbstractReconciler`

### setProgressMonitor

public void setProgressMonitor(IProgressMonitor monitor)
Description copied from class: `AbstractReconciler`
Sets the progress monitor of this reconciler.

Overrides:
  `setProgressMonitor` in class `AbstractReconciler`
Parameters:
  `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.

Overrides:
  `initialProcess` in class `AbstractReconciler`