Search in sources :

Example 21 with IPresentationReconciler

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

the class PropConfiguration method getPresentationReconciler.

/**
	 * Retrieves the Presentation Reconciler
	 * 
	 * @param sourceViewer ISourceViewer
	 * @return object of IPresentationReconciler
	 */
public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
    PresentationReconciler reconciler = new PresentationReconciler();
    NonRuleBasedDamagerRepairer ndr = new NonRuleBasedDamagerRepairer(new TextAttribute(colorManager.getColor(IPropColorConstants.PROP_COMMENT)));
    reconciler.setDamager(ndr, PropPartitionScanner.PROPERTIES_COMMENT);
    reconciler.setRepairer(ndr, PropPartitionScanner.PROPERTIES_COMMENT);
    ndr = new NonRuleBasedDamagerRepairer(new TextAttribute(colorManager.getColor(IPropColorConstants.DEFAULT)));
    reconciler.setDamager(ndr, PropPartitionScanner.PROPERTIES_CONTENT);
    reconciler.setRepairer(ndr, PropPartitionScanner.PROPERTIES_CONTENT);
    ndr = new NonRuleBasedDamagerRepairer(new TextAttribute(colorManager.getColor(IPropColorConstants.TAG)));
    reconciler.setDamager(ndr, IDocument.DEFAULT_CONTENT_TYPE);
    reconciler.setRepairer(ndr, IDocument.DEFAULT_CONTENT_TYPE);
    return reconciler;
}
Also used : TextAttribute(org.eclipse.jface.text.TextAttribute) PresentationReconciler(org.eclipse.jface.text.presentation.PresentationReconciler) IPresentationReconciler(org.eclipse.jface.text.presentation.IPresentationReconciler) NonRuleBasedDamagerRepairer(com.cubrid.tool.editor.NonRuleBasedDamagerRepairer)

Example 22 with IPresentationReconciler

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

the class XMLConfiguration method getPresentationReconciler.

/**
	 * Retrieves the Presentation Reconciler
	 * 
	 * @param sourceViewer ISourceViewer
	 * @return object of IPresentationReconciler
	 */
public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
    PresentationReconciler reconciler = new PresentationReconciler();
    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(IXMLColorConstants.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(com.cubrid.tool.editor.NonRuleBasedDamagerRepairer)

Example 23 with IPresentationReconciler

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

the class JavaSourceViewerConfiguration method getPresentationReconciler.

@Override
public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
    JavaColorProvider provider = JavaEditorExamplePlugin.getDefault().getJavaColorProvider();
    PresentationReconciler reconciler = new PresentationReconciler();
    reconciler.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
    DefaultDamagerRepairer dr = new DefaultDamagerRepairer(JavaEditorExamplePlugin.getDefault().getJavaCodeScanner());
    reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
    reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
    dr = new DefaultDamagerRepairer(JavaEditorExamplePlugin.getDefault().getJavaDocScanner());
    reconciler.setDamager(dr, JavaPartitionScanner.JAVA_DOC);
    reconciler.setRepairer(dr, JavaPartitionScanner.JAVA_DOC);
    dr = new DefaultDamagerRepairer(new SingleTokenScanner(new TextAttribute(provider.getColor(JavaColorProvider.MULTI_LINE_COMMENT))));
    reconciler.setDamager(dr, JavaPartitionScanner.JAVA_MULTILINE_COMMENT);
    reconciler.setRepairer(dr, JavaPartitionScanner.JAVA_MULTILINE_COMMENT);
    return reconciler;
}
Also used : TextAttribute(org.eclipse.jface.text.TextAttribute) JavaColorProvider(org.eclipse.ui.examples.javaeditor.util.JavaColorProvider) DefaultDamagerRepairer(org.eclipse.jface.text.rules.DefaultDamagerRepairer) IPresentationReconciler(org.eclipse.jface.text.presentation.IPresentationReconciler) PresentationReconciler(org.eclipse.jface.text.presentation.PresentationReconciler)

Example 24 with IPresentationReconciler

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

the class XMLConfiguration method getPresentationReconciler.

@Override
public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
    PresentationReconciler reconciler = new PresentationReconciler();
    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(IXMLColorConstants.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)

Example 25 with IPresentationReconciler

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

the class PresentationReconcilerRegistry method sync.

private void sync() {
    Set<IConfigurationElement> toRemoveExtensions = new HashSet<>(this.extensions.keySet());
    for (IConfigurationElement extension : Platform.getExtensionRegistry().getConfigurationElementsFor(EXTENSION_POINT_ID)) {
        toRemoveExtensions.remove(extension);
        if (!this.extensions.containsKey(extension)) {
            try {
                this.extensions.put(extension, new GenericContentTypeRelatedExtension<IPresentationReconciler>(extension));
            } catch (Exception ex) {
                GenericEditorPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, GenericEditorPlugin.BUNDLE_ID, ex.getMessage(), ex));
            }
        }
    }
    for (IConfigurationElement toRemove : toRemoveExtensions) {
        this.extensions.remove(toRemove);
    }
    this.outOfSync = false;
}
Also used : IPresentationReconciler(org.eclipse.jface.text.presentation.IPresentationReconciler) Status(org.eclipse.core.runtime.Status) IStatus(org.eclipse.core.runtime.IStatus) IConfigurationElement(org.eclipse.core.runtime.IConfigurationElement) HashSet(java.util.HashSet)

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