Search in sources :

Example 11 with DefaultDamagerRepairer

use of org.eclipse.jface.text.rules.DefaultDamagerRepairer in project xtext-xtend by eclipse.

the class XtendSourceViewerConfiguration method getPresentationReconciler.

@Override
public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
    XtextPresentationReconciler reconciler = (XtextPresentationReconciler) super.getPresentationReconciler(sourceViewer);
    IPreferenceStore store = JavaPlugin.getDefault().getCombinedPreferenceStore();
    IColorManager colorManager = JavaPlugin.getDefault().getJavaTextTools().getColorManager();
    JavaDocScanner javaDocScanner = new JavaDocScanner(colorManager, store, null);
    DefaultDamagerRepairer dr = new DefaultDamagerRepairer(javaDocScanner);
    reconciler.setRepairer(dr, TokenTypeToPartitionMapper.JAVA_DOC_PARTITION);
    reconciler.setDamager(dr, TokenTypeToPartitionMapper.JAVA_DOC_PARTITION);
    return reconciler;
}
Also used : JavaDocScanner(org.eclipse.jdt.internal.ui.text.javadoc.JavaDocScanner) IColorManager(org.eclipse.jdt.ui.text.IColorManager) DefaultDamagerRepairer(org.eclipse.jface.text.rules.DefaultDamagerRepairer) IPreferenceStore(org.eclipse.jface.preference.IPreferenceStore) XtextPresentationReconciler(org.eclipse.xtext.ui.editor.XtextPresentationReconciler)

Example 12 with DefaultDamagerRepairer

use of org.eclipse.jface.text.rules.DefaultDamagerRepairer in project hale by halestudio.

the class SimpleGroovySourceViewerConfiguration method getPresentationReconciler.

/*
	 * @see SourceViewerConfiguration#getPresentationReconciler(ISourceViewer)
	 */
@Override
public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
    PresentationReconciler reconciler = new PresentationReconciler();
    reconciler.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
    DefaultDamagerRepairer dr = new DefaultDamagerRepairer(getCodeScanner());
    reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
    reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
    dr = new DefaultDamagerRepairer(getJavaDocScanner());
    reconciler.setDamager(dr, IJavaPartitions.JAVA_DOC);
    reconciler.setRepairer(dr, IJavaPartitions.JAVA_DOC);
    dr = new DefaultDamagerRepairer(getMultilineCommentScanner());
    reconciler.setDamager(dr, IJavaPartitions.JAVA_MULTI_LINE_COMMENT);
    reconciler.setRepairer(dr, IJavaPartitions.JAVA_MULTI_LINE_COMMENT);
    dr = new DefaultDamagerRepairer(getSinglelineCommentScanner());
    reconciler.setDamager(dr, IJavaPartitions.JAVA_SINGLE_LINE_COMMENT);
    reconciler.setRepairer(dr, IJavaPartitions.JAVA_SINGLE_LINE_COMMENT);
    dr = new DefaultDamagerRepairer(getStringScanner());
    reconciler.setDamager(dr, IJavaPartitions.JAVA_STRING);
    reconciler.setRepairer(dr, IJavaPartitions.JAVA_STRING);
    dr = new DefaultDamagerRepairer(getStringScanner());
    reconciler.setDamager(dr, IJavaPartitions.JAVA_CHARACTER);
    reconciler.setRepairer(dr, IJavaPartitions.JAVA_CHARACTER);
    dr = new DefaultDamagerRepairer(getStringScanner());
    reconciler.setDamager(dr, GroovyPartitionScanner.GROOVY_MULTILINE_STRINGS);
    reconciler.setRepairer(dr, GroovyPartitionScanner.GROOVY_MULTILINE_STRINGS);
    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 13 with DefaultDamagerRepairer

use of org.eclipse.jface.text.rules.DefaultDamagerRepairer in project dbeaver by dbeaver.

the class SQLEditorSourceViewerConfiguration method addContentTypeDamageRepairer.

private void addContentTypeDamageRepairer(PresentationReconciler reconciler, String contentType, String colorId) {
    DefaultDamagerRepairer dr = new DefaultDamagerRepairer(new SingleTokenScanner(new TextAttribute(ruleManager.getColor(colorId))));
    reconciler.setDamager(dr, contentType);
    reconciler.setRepairer(dr, contentType);
}
Also used : DefaultDamagerRepairer(org.eclipse.jface.text.rules.DefaultDamagerRepairer)

Example 14 with DefaultDamagerRepairer

use of org.eclipse.jface.text.rules.DefaultDamagerRepairer in project dbeaver by dbeaver.

the class XMLSourceViewerConfiguration method getPresentationReconciler.

@Override
public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
    PresentationReconciler reconciler = new PresentationReconciler();
    reconciler.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
    DefaultDamagerRepairer dr = new DefaultDamagerRepairer(getXMLTagScanner());
    reconciler.setDamager(dr, XMLPartitionScanner.XML_TAG);
    reconciler.setRepairer(dr, XMLPartitionScanner.XML_TAG);
    dr = new DefaultDamagerRepairer(getXMLScanner());
    reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
    reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
    NonRuleBasedDamagerRepairer ndr = new NonRuleBasedDamagerRepairer(new TextAttribute(colorManager.getColor(COLOR_XML_COMMENT)));
    reconciler.setDamager(ndr, XMLPartitionScanner.XML_COMMENT);
    reconciler.setRepairer(ndr, XMLPartitionScanner.XML_COMMENT);
    return reconciler;
}
Also used : TextAttribute(org.eclipse.jface.text.TextAttribute) DefaultDamagerRepairer(org.eclipse.jface.text.rules.DefaultDamagerRepairer) IPresentationReconciler(org.eclipse.jface.text.presentation.IPresentationReconciler) PresentationReconciler(org.eclipse.jface.text.presentation.PresentationReconciler) NonRuleBasedDamagerRepairer(org.jkiss.dbeaver.ui.editors.text.NonRuleBasedDamagerRepairer)

Example 15 with DefaultDamagerRepairer

use of org.eclipse.jface.text.rules.DefaultDamagerRepairer 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

DefaultDamagerRepairer (org.eclipse.jface.text.rules.DefaultDamagerRepairer)34 IPresentationReconciler (org.eclipse.jface.text.presentation.IPresentationReconciler)30 PresentationReconciler (org.eclipse.jface.text.presentation.PresentationReconciler)30 TextAttribute (org.eclipse.jface.text.TextAttribute)14 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 ColorRegistry (org.eclipse.jface.resource.ColorRegistry)2 PatternRule (org.eclipse.jface.text.rules.PatternRule)2 NonRuleBasedDamagerRepairer (com.cubrid.tool.editor.NonRuleBasedDamagerRepairer)1 ArrayList (java.util.ArrayList)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 DiffViewer (org.eclipse.egit.ui.internal.commit.DiffViewer)1 FocusTracker (org.eclipse.egit.ui.internal.commit.FocusTracker)1 HyperlinkSourceViewer (org.eclipse.egit.ui.internal.dialogs.HyperlinkSourceViewer)1 HyperlinkTokenScanner (org.eclipse.egit.ui.internal.dialogs.HyperlinkTokenScanner)1 RepositorySelectionProvider (org.eclipse.egit.ui.internal.selection.RepositorySelectionProvider)1 JavaDocScanner (org.eclipse.jdt.internal.ui.text.javadoc.JavaDocScanner)1