Search in sources :

Example 1 with HighlightingSupportAdapter

use of org.yakindu.base.gmf.runtime.highlighting.HighlightingSupportAdapter in project statecharts by Yakindu.

the class IHighlightingSupportAdapterFactory method getAdapter.

@SuppressWarnings("unchecked")
public Object getAdapter(Object adaptableObject, Class adapterType) {
    if (adapterType == IHighlightingSupport.class) {
        if (adaptableObject instanceof DiagramDocumentEditor) {
            IHighlightingSupport supportFromCache = cache.get((DiagramDocumentEditor) adaptableObject);
            if (supportFromCache != null)
                return supportFromCache;
            supportFromCache = new HighlightingSupportAdapter((DiagramDocumentEditor) adaptableObject);
            cache.put((DiagramDocumentEditor) adaptableObject, supportFromCache);
            return supportFromCache;
        }
    }
    return null;
}
Also used : IHighlightingSupport(org.yakindu.base.gmf.runtime.highlighting.IHighlightingSupport) HighlightingSupportAdapter(org.yakindu.base.gmf.runtime.highlighting.HighlightingSupportAdapter) DiagramDocumentEditor(org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor)

Aggregations

DiagramDocumentEditor (org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor)1 HighlightingSupportAdapter (org.yakindu.base.gmf.runtime.highlighting.HighlightingSupportAdapter)1 IHighlightingSupport (org.yakindu.base.gmf.runtime.highlighting.IHighlightingSupport)1