org.eclipse.xtext.ui.editor.syntaxcoloring
Class HighlightingReconciler

java.lang.Object
  extended by org.eclipse.xtext.ui.editor.syntaxcoloring.HighlightingReconciler
All Implemented Interfaces:
org.eclipse.jface.text.ITextInputListener, IXtextModelListener, IHighlightedPositionAcceptor

public class HighlightingReconciler
extends java.lang.Object
implements org.eclipse.jface.text.ITextInputListener, IXtextModelListener, IHighlightedPositionAcceptor

Highlighting reconciler - Background thread implementation. Initially copied from org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlightingReconciler

Author:
Sebastian Zarnekow

Constructor Summary
HighlightingReconciler()
           
 
Method Summary
 void addPosition(int offset, int length, java.lang.String... ids)
          Add a position with the given range and highlighting if it does not exist already.
 ISemanticHighlightingCalculator getCalculator()
           
 void inputDocumentAboutToBeChanged(org.eclipse.jface.text.IDocument oldInput, org.eclipse.jface.text.IDocument newInput)
           
 void inputDocumentChanged(org.eclipse.jface.text.IDocument oldInput, org.eclipse.jface.text.IDocument newInput)
           
 void install(XtextEditor editor, XtextSourceViewer sourceViewer, HighlightingPresenter presenter)
          Install this reconciler on the given editor and presenter.
 void modelChanged(XtextResource resource)
           
 void refresh()
          Refreshes the highlighting.
 void setCalculator(ISemanticHighlightingCalculator calculator)
           
 void uninstall()
          Uninstall this reconciler from the editor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HighlightingReconciler

public HighlightingReconciler()
Method Detail

addPosition

public void addPosition(int offset,
                        int length,
                        java.lang.String... ids)
Add a position with the given range and highlighting if it does not exist already.

Specified by:
addPosition in interface IHighlightedPositionAcceptor
Parameters:
offset - The range offset
length - The range length
ids - The highlighting attribute ids

install

public void install(XtextEditor editor,
                    XtextSourceViewer sourceViewer,
                    HighlightingPresenter presenter)
Install this reconciler on the given editor and presenter.

Parameters:
editor - the editor
sourceViewer - the source viewer
presenter - the highlighting presenter

uninstall

public void uninstall()
Uninstall this reconciler from the editor


inputDocumentAboutToBeChanged

public void inputDocumentAboutToBeChanged(org.eclipse.jface.text.IDocument oldInput,
                                          org.eclipse.jface.text.IDocument newInput)
Specified by:
inputDocumentAboutToBeChanged in interface org.eclipse.jface.text.ITextInputListener

inputDocumentChanged

public void inputDocumentChanged(org.eclipse.jface.text.IDocument oldInput,
                                 org.eclipse.jface.text.IDocument newInput)
Specified by:
inputDocumentChanged in interface org.eclipse.jface.text.ITextInputListener

refresh

public void refresh()
Refreshes the highlighting.


modelChanged

public void modelChanged(XtextResource resource)
Specified by:
modelChanged in interface IXtextModelListener

setCalculator

public void setCalculator(ISemanticHighlightingCalculator calculator)

getCalculator

public ISemanticHighlightingCalculator getCalculator()