use of org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor 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.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor in project statecharts by Yakindu.
the class NavigatorLinkHelper method findSelection.
public IStructuredSelection findSelection(IEditorInput anInput) {
IEditorPart activeEditor = ActiveEditorTracker.getLastActiveEditor();
if (activeEditor instanceof DiagramDocumentEditor) {
Diagram diagram = ((DiagramDocumentEditor) activeEditor).getDiagram();
IFile file = WorkspaceSynchronizer.getFile(diagram.eResource());
if (file != null) {
DomainNavigatorItem item = new DomainNavigatorItem(diagram, file, myAdapterFctoryContentProvier);
return new StructuredSelection(item);
}
}
return StructuredSelection.EMPTY;
}
use of org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor in project statecharts by Yakindu.
the class UIUtils method getActiveEditor.
public static DiagramDocumentEditor getActiveEditor() {
final IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
final IWorkbenchPage workbenchPage = workbenchWindow.getActivePage();
if (workbenchPage != null) {
final IEditorPart editor = workbenchPage.getActiveEditor();
if (editor instanceof DiagramDocumentEditor) {
return (DiagramDocumentEditor) editor;
}
}
return null;
}
Aggregations