Search in sources :

Example 1 with IReconciler

use of org.eclipse.jface.text.reconciler.IReconciler in project eclipse.platform.text by eclipse.

the class ReconcilerRegistry method syncHighlight.

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

Example 2 with IReconciler

use of org.eclipse.jface.text.reconciler.IReconciler in project eclipse.platform.text by eclipse.

the class ReconcilerRegistry 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<IReconciler>(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 : Status(org.eclipse.core.runtime.Status) IStatus(org.eclipse.core.runtime.IStatus) IReconciler(org.eclipse.jface.text.reconciler.IReconciler) IConfigurationElement(org.eclipse.core.runtime.IConfigurationElement) HashSet(java.util.HashSet)

Example 3 with IReconciler

use of org.eclipse.jface.text.reconciler.IReconciler in project linuxtools by eclipse.

the class DockerConfiguration method getReconciler.

@Override
public IReconciler getReconciler(ISourceViewer sourceViewer) {
    Reconciler reconciler = new Reconciler();
    IReconcilingStrategy strategy = new SyntaxReconcilingStrategy(editor);
    reconciler.setReconcilingStrategy(strategy, IDocument.DEFAULT_CONTENT_TYPE);
    return reconciler;
}
Also used : SyntaxReconcilingStrategy(org.eclipse.linuxtools.internal.docker.editor.syntax.SyntaxReconcilingStrategy) Reconciler(org.eclipse.jface.text.reconciler.Reconciler) IPresentationReconciler(org.eclipse.jface.text.presentation.IPresentationReconciler) IReconciler(org.eclipse.jface.text.reconciler.IReconciler) IReconcilingStrategy(org.eclipse.jface.text.reconciler.IReconcilingStrategy)

Aggregations

IReconciler (org.eclipse.jface.text.reconciler.IReconciler)3 HashSet (java.util.HashSet)2 IConfigurationElement (org.eclipse.core.runtime.IConfigurationElement)2 IStatus (org.eclipse.core.runtime.IStatus)2 Status (org.eclipse.core.runtime.Status)2 IPresentationReconciler (org.eclipse.jface.text.presentation.IPresentationReconciler)1 IReconcilingStrategy (org.eclipse.jface.text.reconciler.IReconcilingStrategy)1 Reconciler (org.eclipse.jface.text.reconciler.Reconciler)1 SyntaxReconcilingStrategy (org.eclipse.linuxtools.internal.docker.editor.syntax.SyntaxReconcilingStrategy)1