use of org.yakindu.base.gmf.runtime.highlighting.IHighlightingSupport 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;
}
use of org.yakindu.base.gmf.runtime.highlighting.IHighlightingSupport in project statecharts by Yakindu.
the class SCTSourceDisplay method displaySource.
public void displaySource(IEditorPart editor) {
IDynamicNotationHandler notationHandler = handler.get(editor);
IHighlightingSupport support = (IHighlightingSupport) editor.getAdapter(IHighlightingSupport.class);
if (support == null)
return;
if (notationHandler == null) {
notationHandler = new DefaultDynamicNotationHandler();
handler.put(editor, notationHandler);
} else {
notationHandler.setHighlightingSupport(new IHighlightingSupport.HighlightingSupportNullImpl());
}
if (support.isLocked()) {
support.releaseEditor();
}
support.lockEditor();
notationHandler.setHighlightingSupport(support);
notationHandler.display(container.getExecutionContext());
}
Aggregations