Search in sources :

Example 11 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)

Example 12 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)

Aggregations

IPresentationReconciler (org.eclipse.jface.text.presentation.IPresentationReconciler)12 PresentationReconciler (org.eclipse.jface.text.presentation.PresentationReconciler)11 DefaultDamagerRepairer (org.eclipse.jface.text.rules.DefaultDamagerRepairer)7 TextAttribute (org.eclipse.jface.text.TextAttribute)5 NonRuleBasedDamagerRepairer (com.cubrid.tool.editor.NonRuleBasedDamagerRepairer)2 HashSet (java.util.HashSet)1 IConfigurationElement (org.eclipse.core.runtime.IConfigurationElement)1 IStatus (org.eclipse.core.runtime.IStatus)1 Status (org.eclipse.core.runtime.Status)1 JavaColorProvider (org.eclipse.ui.examples.javaeditor.util.JavaColorProvider)1