Search in sources :

Example 1 with ErlCodeScanner

use of org.erlide.ui.editors.erl.scanner.ErlCodeScanner in project erlide_eclipse by erlang.

the class ErlangConsoleSourceViewerConfiguration method getPresentationReconciler.

@Override
public IPresentationReconciler getPresentationReconciler(final ISourceViewer sourceViewer) {
    final PresentationReconciler reconciler = new PresentationReconciler();
    DefaultDamagerRepairer dr;
    final ITokenScanner scan = new ErlCodeScanner(colorManager);
    dr = new ErlDamagerRepairer(scan);
    reconciler.setDamager(dr, IoRequestKind.INPUT.name());
    reconciler.setRepairer(dr, IoRequestKind.INPUT.name());
    final ITokenScanner scan3 = new ConsoleOutputScanner(colorManager);
    dr = new ErlDamagerRepairer(scan3);
    reconciler.setDamager(dr, IoRequestKind.OUTPUT.name());
    reconciler.setRepairer(dr, IoRequestKind.OUTPUT.name());
    reconciler.setDamager(dr, IoRequestKind.PROMPT.name());
    reconciler.setRepairer(dr, IoRequestKind.PROMPT.name());
    reconciler.setDamager(dr, IoRequestKind.STDOUT.name());
    reconciler.setRepairer(dr, IoRequestKind.STDOUT.name());
    reconciler.setDamager(dr, IoRequestKind.STDERR.name());
    reconciler.setRepairer(dr, IoRequestKind.STDERR.name());
    reconciler.setDamager(dr, IoRequestKind.HEADER.name());
    reconciler.setRepairer(dr, IoRequestKind.HEADER.name());
    // this is for the input field
    final ITokenScanner scan2 = new ErlCodeScanner(colorManager);
    dr = new ErlDamagerRepairer(scan2);
    reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
    reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
    return reconciler;
}
Also used : ErlDamagerRepairer(org.erlide.ui.editors.erl.scanner.ErlDamagerRepairer) ErlCodeScanner(org.erlide.ui.editors.erl.scanner.ErlCodeScanner) DefaultDamagerRepairer(org.eclipse.jface.text.rules.DefaultDamagerRepairer) IPresentationReconciler(org.eclipse.jface.text.presentation.IPresentationReconciler) PresentationReconciler(org.eclipse.jface.text.presentation.PresentationReconciler) ITokenScanner(org.eclipse.jface.text.rules.ITokenScanner)

Aggregations

IPresentationReconciler (org.eclipse.jface.text.presentation.IPresentationReconciler)1 PresentationReconciler (org.eclipse.jface.text.presentation.PresentationReconciler)1 DefaultDamagerRepairer (org.eclipse.jface.text.rules.DefaultDamagerRepairer)1 ITokenScanner (org.eclipse.jface.text.rules.ITokenScanner)1 ErlCodeScanner (org.erlide.ui.editors.erl.scanner.ErlCodeScanner)1 ErlDamagerRepairer (org.erlide.ui.editors.erl.scanner.ErlDamagerRepairer)1