Search in sources :

Example 26 with IPresentationReconciler

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

the class SourceViewerConfiguration method getPresentationReconciler.

/**
 * Returns the presentation reconciler ready to be used with the given source viewer.
 *
 * @param sourceViewer the source viewer
 * @return the presentation reconciler or <code>null</code> if presentation reconciling should not be supported
 */
public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
    PresentationReconciler reconciler = new PresentationReconciler();
    reconciler.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
    return reconciler;
}
Also used : IPresentationReconciler(org.eclipse.jface.text.presentation.IPresentationReconciler) PresentationReconciler(org.eclipse.jface.text.presentation.PresentationReconciler)

Example 27 with IPresentationReconciler

use of org.eclipse.jface.text.presentation.IPresentationReconciler in project ch.hsr.ifs.cdttesting by IFS-HSR.

the class Configuration method getPresentationReconciler.

@Override
public IPresentationReconciler getPresentationReconciler(final ISourceViewer sourceViewer) {
    final PresentationReconciler reconciler = new PresentationReconciler();
    DamagerRepairer ndr = new DamagerRepairer(new TextAttribute(this.colorManager.getColor(Colors.CDT_TEST_COMMENT), null, SWT.BOLD));
    reconciler.setDamager(ndr, TestFile.PARTITION_TEST_COMMENT);
    reconciler.setRepairer(ndr, TestFile.PARTITION_TEST_COMMENT);
    ndr = new DamagerRepairer(new TextAttribute(this.colorManager.getColor(Colors.TEST_NAME), null, SWT.BOLD));
    reconciler.setDamager(ndr, TestFile.PARTITION_TEST_NAME);
    reconciler.setRepairer(ndr, TestFile.PARTITION_TEST_NAME);
    ndr = new DamagerRepairer(new TextAttribute(this.colorManager.getColor(Colors.LANG_DEF), null, SWT.BOLD));
    reconciler.setDamager(ndr, TestFile.PARTITION_TEST_LANGUAGE);
    reconciler.setRepairer(ndr, TestFile.PARTITION_TEST_LANGUAGE);
    ndr = new DamagerRepairer(new TextAttribute(this.colorManager.getColor(Colors.EXPECTED), null, SWT.BOLD));
    reconciler.setDamager(ndr, TestFile.PARTITION_TEST_EXPECTED);
    reconciler.setRepairer(ndr, TestFile.PARTITION_TEST_EXPECTED);
    ndr = new DamagerRepairer(new TextAttribute(this.colorManager.getColor(Colors.CLASS_NAME), null, SWT.BOLD));
    reconciler.setDamager(ndr, TestFile.PARTITION_TEST_CLASS);
    reconciler.setRepairer(ndr, TestFile.PARTITION_TEST_CLASS);
    ndr = new DamagerRepairer(new TextAttribute(this.colorManager.getColor(Colors.FILE_NAME), null, SWT.BOLD));
    reconciler.setDamager(ndr, TestFile.PARTITION_TEST_FILE);
    reconciler.setRepairer(ndr, TestFile.PARTITION_TEST_FILE);
    ndr = new DamagerRepairer(new TextAttribute(this.colorManager.getColor(Colors.SELECTION), null, SWT.BOLD));
    reconciler.setDamager(ndr, TestFile.PARTITION_TEST_SELECTION);
    reconciler.setRepairer(ndr, TestFile.PARTITION_TEST_SELECTION);
    return reconciler;
}
Also used : TextAttribute(org.eclipse.jface.text.TextAttribute) IPresentationReconciler(org.eclipse.jface.text.presentation.IPresentationReconciler) PresentationReconciler(org.eclipse.jface.text.presentation.PresentationReconciler)

Example 28 with IPresentationReconciler

use of org.eclipse.jface.text.presentation.IPresentationReconciler in project eclipse-integration-commons by spring-projects.

the class StsTextViewerConfiguration method getPresentationReconciler.

@Override
public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
    if (showHyperlinks) {
        return super.getPresentationReconciler(sourceViewer);
    }
    PresentationReconciler reconciler = new PresentationReconciler();
    reconciler.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
    DefaultDamagerRepairer dr = new DefaultDamagerRepairer(new RuleBasedScanner());
    reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
    reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
    return reconciler;
}
Also used : DefaultDamagerRepairer(org.eclipse.jface.text.rules.DefaultDamagerRepairer) PresentationReconciler(org.eclipse.jface.text.presentation.PresentationReconciler) IPresentationReconciler(org.eclipse.jface.text.presentation.IPresentationReconciler) RuleBasedScanner(org.eclipse.jface.text.rules.RuleBasedScanner)

Example 29 with IPresentationReconciler

use of org.eclipse.jface.text.presentation.IPresentationReconciler in project liferay-ide by liferay.

the class Configuration method getPresentationReconciler.

public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
    PresentationReconciler reconciler = new PresentationReconciler();
    IToken defaultToken = null;
    DefaultDamagerRepairer dr = null;
    NonRuleBasedDamagerRepairer ndr = null;
    defaultToken = new Token(new TextAttribute(colorManager.getColor(Constants.COLOR_DIRECTIVE)));
    ContentScanner contentScanner = new ContentScanner(defaultToken, colorManager);
    for (int i = 0; i < PartitionScanner.DIRECTIVES.length; i++) {
        dr = new DefaultDamagerRepairer(contentScanner);
        reconciler.setDamager(dr, PartitionScanner.DIRECTIVES[i]);
        reconciler.setRepairer(dr, PartitionScanner.DIRECTIVES[i]);
    }
    dr = new DefaultDamagerRepairer(contentScanner);
    reconciler.setDamager(dr, PartitionScanner.FTL_DIRECTIVE);
    reconciler.setRepairer(dr, PartitionScanner.FTL_DIRECTIVE);
    dr = new DefaultDamagerRepairer(contentScanner);
    reconciler.setDamager(dr, PartitionScanner.FTL_DIRECTIVE_END);
    reconciler.setRepairer(dr, PartitionScanner.FTL_DIRECTIVE_END);
    ndr = new NonRuleBasedDamagerRepairer(new TextAttribute(colorManager.getColor(Constants.COLOR_XML_COMMENT)));
    reconciler.setDamager(ndr, PartitionScanner.XML_COMMENT);
    reconciler.setRepairer(ndr, PartitionScanner.XML_COMMENT);
    ndr = new NonRuleBasedDamagerRepairer(new TextAttribute(colorManager.getColor(Constants.COLOR_STRING)));
    reconciler.setDamager(ndr, PartitionScanner.STRING);
    reconciler.setRepairer(ndr, PartitionScanner.STRING);
    ndr = new NonRuleBasedDamagerRepairer(new TextAttribute(colorManager.getColor(Constants.COLOR_COMMENT)));
    reconciler.setDamager(ndr, PartitionScanner.FTL_COMMENT);
    reconciler.setRepairer(ndr, PartitionScanner.FTL_COMMENT);
    defaultToken = new Token(new TextAttribute(colorManager.getColor(Constants.COLOR_INTERPOLATION)));
    dr = new DefaultDamagerRepairer(new ContentScanner(defaultToken, colorManager));
    reconciler.setDamager(dr, PartitionScanner.FTL_INTERPOLATION);
    reconciler.setRepairer(dr, PartitionScanner.FTL_INTERPOLATION);
    defaultToken = new Token(new TextAttribute(colorManager.getColor(Constants.COLOR_XML_TAG)));
    dr = new DefaultDamagerRepairer(new ContentScanner(defaultToken, colorManager));
    reconciler.setDamager(dr, PartitionScanner.XML_TAG);
    reconciler.setRepairer(dr, PartitionScanner.XML_TAG);
    return reconciler;
}
Also used : IToken(org.eclipse.jface.text.rules.IToken) TextAttribute(org.eclipse.jface.text.TextAttribute) DefaultDamagerRepairer(org.eclipse.jface.text.rules.DefaultDamagerRepairer) IToken(org.eclipse.jface.text.rules.IToken) Token(org.eclipse.jface.text.rules.Token) IPresentationReconciler(org.eclipse.jface.text.presentation.IPresentationReconciler) PresentationReconciler(org.eclipse.jface.text.presentation.PresentationReconciler)

Example 30 with IPresentationReconciler

use of org.eclipse.jface.text.presentation.IPresentationReconciler in project tdq-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)

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