Search in sources :

Example 1 with NonRuleBasedDamagerRepairer

use of org.jkiss.dbeaver.ui.editors.text.NonRuleBasedDamagerRepairer in project dbeaver by serge-rider.

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 2 with NonRuleBasedDamagerRepairer

use of org.jkiss.dbeaver.ui.editors.text.NonRuleBasedDamagerRepairer in project dbeaver by serge-rider.

the class JSONSourceViewerConfiguration method getPresentationReconciler.

@Override
public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
    ColorRegistry colorRegistry = UIUtils.getColorRegistry();
    PresentationReconciler reconciler = new PresentationReconciler();
    reconciler.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
    DefaultDamagerRepairer dr = new DefaultDamagerRepairer(jsonScanner);
    reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
    reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
    NonRuleBasedDamagerRepairer ndr = new NonRuleBasedDamagerRepairer(new TextAttribute(colorRegistry.get(SQLConstants.CONFIG_COLOR_STRING)));
    reconciler.setDamager(ndr, JSONPartitionScanner.JSON_STRING);
    reconciler.setRepairer(ndr, JSONPartitionScanner.JSON_STRING);
    return reconciler;
}
Also used : ColorRegistry(org.eclipse.jface.resource.ColorRegistry) 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 3 with NonRuleBasedDamagerRepairer

use of org.jkiss.dbeaver.ui.editors.text.NonRuleBasedDamagerRepairer 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 4 with NonRuleBasedDamagerRepairer

use of org.jkiss.dbeaver.ui.editors.text.NonRuleBasedDamagerRepairer in project dbeaver by dbeaver.

the class JSONSourceViewerConfiguration method getPresentationReconciler.

@Override
public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
    ColorRegistry colorRegistry = UIUtils.getColorRegistry();
    PresentationReconciler reconciler = new PresentationReconciler();
    reconciler.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
    DefaultDamagerRepairer dr = new DefaultDamagerRepairer(jsonScanner);
    reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
    reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
    NonRuleBasedDamagerRepairer ndr = new NonRuleBasedDamagerRepairer(new TextAttribute(colorRegistry.get(SQLConstants.CONFIG_COLOR_STRING)));
    reconciler.setDamager(ndr, JSONPartitionScanner.JSON_STRING);
    reconciler.setRepairer(ndr, JSONPartitionScanner.JSON_STRING);
    return reconciler;
}
Also used : ColorRegistry(org.eclipse.jface.resource.ColorRegistry) 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)

Aggregations

TextAttribute (org.eclipse.jface.text.TextAttribute)4 IPresentationReconciler (org.eclipse.jface.text.presentation.IPresentationReconciler)4 PresentationReconciler (org.eclipse.jface.text.presentation.PresentationReconciler)4 DefaultDamagerRepairer (org.eclipse.jface.text.rules.DefaultDamagerRepairer)4 NonRuleBasedDamagerRepairer (org.jkiss.dbeaver.ui.editors.text.NonRuleBasedDamagerRepairer)4 ColorRegistry (org.eclipse.jface.resource.ColorRegistry)2