Search in sources :

Example 1 with IPresentationReconciler

use of org.eclipse.jface.text.presentation.IPresentationReconciler in project tdi-studio-se by Talend.

the class SQLSourceViewerConfiguration method getPresentationReconciler.

public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
    PresentationReconciler reconciler = new PresentationReconciler();
    DefaultDamagerRepairer dr = new DefaultDamagerRepairer(getCodeScanner());
    reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
    reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
    dr = new DefaultDamagerRepairer(getMultilineCommentScanner());
    reconciler.setDamager(dr, IConstants.SQL_MULTILINE_COMMENT);
    reconciler.setRepairer(dr, IConstants.SQL_MULTILINE_COMMENT);
    dr = new DefaultDamagerRepairer(getSinglelineCommentScanner());
    reconciler.setDamager(dr, IConstants.SQL_SINGLE_LINE_COMMENT);
    reconciler.setRepairer(dr, IConstants.SQL_SINGLE_LINE_COMMENT);
    dr = new DefaultDamagerRepairer(getStringScanner());
    reconciler.setDamager(dr, IConstants.SQL_STRING);
    reconciler.setRepairer(dr, IConstants.SQL_STRING);
    return reconciler;
}
Also used : DefaultDamagerRepairer(org.eclipse.jface.text.rules.DefaultDamagerRepairer) IPresentationReconciler(org.eclipse.jface.text.presentation.IPresentationReconciler) PresentationReconciler(org.eclipse.jface.text.presentation.PresentationReconciler)

Example 2 with IPresentationReconciler

use of org.eclipse.jface.text.presentation.IPresentationReconciler in project cubrid-manager by CUBRID.

the class SQLViewerConfiguration method getPresentationReconciler.

/**
	 * Gets the presentation reconciler. This will color the code.
	 *
	 * @param sourceViewer ISourceViewer
	 * @return reconciler IPresentationReconciler
	 */
public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
    // Create the presentation reconciler
    PresentationReconciler reconciler = new PresentationReconciler();
    reconciler.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
    // Create the damager/repairer for comment partitions
    String[] types = SQLPartitionScanner.getAllTypes();
    for (String type : types) {
        if (IDocument.DEFAULT_CONTENT_TYPE.equals(type)) {
            DefaultDamagerRepairer dr = new DefaultDamagerRepairer(new SQLKeyWordScanner());
            reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
            reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
        } else {
            DefaultDamagerRepairer dr = new DefaultDamagerRepairer(new StringCommentScanner());
            reconciler.setDamager(dr, type);
            reconciler.setRepairer(dr, type);
        }
    }
    return reconciler;
}
Also used : DefaultDamagerRepairer(org.eclipse.jface.text.rules.DefaultDamagerRepairer) IPresentationReconciler(org.eclipse.jface.text.presentation.IPresentationReconciler) PresentationReconciler(org.eclipse.jface.text.presentation.PresentationReconciler)

Example 3 with IPresentationReconciler

use of org.eclipse.jface.text.presentation.IPresentationReconciler in project translationstudio8 by heartsome.

the class TagStyleConfigurator method getPresentationReconciler.

private static IPresentationReconciler getPresentationReconciler(ISegmentViewer viewer) {
    // 构造函数中,已经默认设置 IDocumentExtension3.DEFAULT_PARTITIONING
    PresentationReconciler reconciler = new PresentationReconciler();
    PresentationRepairer repairer = new PresentationRepairer(getRecipeScanner(viewer.getDocument()), viewer);
    reconciler.setRepairer(repairer, IDocument.DEFAULT_CONTENT_TYPE);
    reconciler.install(viewer);
    return reconciler;
}
Also used : PresentationReconciler(org.eclipse.jface.text.presentation.PresentationReconciler) IPresentationReconciler(org.eclipse.jface.text.presentation.IPresentationReconciler)

Example 4 with IPresentationReconciler

use of org.eclipse.jface.text.presentation.IPresentationReconciler in project abstools by abstools.

the class ABSSourceViewerConfiguration method getPresentationReconciler.

@Override
public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
    PresentationReconciler reconciler = new PresentationReconciler();
    DefaultDamagerRepairer dr = new ABSDamagerRepairer(new ABSSingleCommentScanner());
    reconciler.setDamager(dr, PARTITION_SINLGE_LINE_COMMENT);
    reconciler.setRepairer(dr, PARTITION_SINLGE_LINE_COMMENT);
    dr = new ABSDamagerRepairer(new ABSMultiCommentScanner());
    reconciler.setDamager(dr, PARTITION_MULTI_LINE_COMMENT);
    reconciler.setRepairer(dr, PARTITION_MULTI_LINE_COMMENT);
    dr = new ABSDamagerRepairer(new ABSStringScanner());
    reconciler.setDamager(dr, PARTITION_STRING);
    reconciler.setRepairer(dr, PARTITION_STRING);
    dr = new ABSDamagerRepairer(new ABSCharacterScanner());
    reconciler.setDamager(dr, PARTITION_CHARACTER);
    reconciler.setRepairer(dr, PARTITION_CHARACTER);
    dr = new ABSDamagerRepairer(new ABSCodeScanner(new IdentifierWordDetector(), editor));
    reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
    reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
    return reconciler;
}
Also used : IPresentationReconciler(org.eclipse.jface.text.presentation.IPresentationReconciler) PresentationReconciler(org.eclipse.jface.text.presentation.PresentationReconciler)

Example 5 with IPresentationReconciler

use of org.eclipse.jface.text.presentation.IPresentationReconciler in project tmdm-studio-se by Talend.

the class ElementFKInfoConfiguration method getPresentationReconciler.

@Override
public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
    PresentationReconciler reconciler = new PresentationReconciler();
    DefaultDamagerRepairer stringDR = new DefaultDamagerRepairer(getStringScanner());
    reconciler.setDamager(stringDR, ElementFKInfotPartitionScanner.COMMON_STRING);
    reconciler.setRepairer(stringDR, ElementFKInfotPartitionScanner.COMMON_STRING);
    DefaultDamagerRepairer keywordDR = new DefaultDamagerRepairer(getKeywordScanner());
    reconciler.setDamager(keywordDR, IDocument.DEFAULT_CONTENT_TYPE);
    reconciler.setRepairer(keywordDR, IDocument.DEFAULT_CONTENT_TYPE);
    return reconciler;
}
Also used : DefaultDamagerRepairer(org.eclipse.jface.text.rules.DefaultDamagerRepairer) IPresentationReconciler(org.eclipse.jface.text.presentation.IPresentationReconciler) PresentationReconciler(org.eclipse.jface.text.presentation.PresentationReconciler)

Aggregations

IPresentationReconciler (org.eclipse.jface.text.presentation.IPresentationReconciler)45 PresentationReconciler (org.eclipse.jface.text.presentation.PresentationReconciler)43 DefaultDamagerRepairer (org.eclipse.jface.text.rules.DefaultDamagerRepairer)30 TextAttribute (org.eclipse.jface.text.TextAttribute)16 IntervallBasedDamagerRepairer (org.eclipse.titan.designer.editors.IntervallBasedDamagerRepairer)4 RuleBasedScanner (org.eclipse.jface.text.rules.RuleBasedScanner)3 ErlDamagerRepairer (org.erlide.ui.editors.erl.scanner.ErlDamagerRepairer)3 NonRuleBasedDamagerRepairer (org.jkiss.dbeaver.ui.editors.text.NonRuleBasedDamagerRepairer)3 NonRuleBasedDamagerRepairer (com.cubrid.tool.editor.NonRuleBasedDamagerRepairer)2 ColorRegistry (org.eclipse.jface.resource.ColorRegistry)2 PatternRule (org.eclipse.jface.text.rules.PatternRule)2 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 List (java.util.List)1 HTMLTagDamagerRepairer (org.apache.syncope.ide.eclipse.plugin.editors.htmlhelpers.HTMLTagDamagerRepairer)1 JavaScriptDamagerRepairer (org.apache.syncope.ide.eclipse.plugin.editors.htmlhelpers.JavaScriptDamagerRepairer)1 IConfigurationElement (org.eclipse.core.runtime.IConfigurationElement)1 IStatus (org.eclipse.core.runtime.IStatus)1 Status (org.eclipse.core.runtime.Status)1 DiffViewer (org.eclipse.egit.ui.internal.commit.DiffViewer)1