use of org.jboss.tools.hibernate.ui.diagram.editors.DiagramContentOutlinePage in project jbosstools-hibernate by jbosstools.
the class DiagramBaseAction method getDiagramViewer.
protected DiagramViewer getDiagramViewer() {
DiagramViewer res = editor;
final IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (workbenchWindow == null) {
return res;
}
final IWorkbenchPage workbenchPage = workbenchWindow.getActivePage();
if (workbenchPage == null) {
return res;
}
IWorkbenchPart part = workbenchPage.getActivePart();
if (part instanceof DiagramViewer) {
res = (DiagramViewer) part;
} else if (part instanceof ContentOutline) {
ContentOutline co = (ContentOutline) part;
if (co.getCurrentPage() instanceof DiagramContentOutlinePage) {
DiagramContentOutlinePage dcop = (DiagramContentOutlinePage) co.getCurrentPage();
res = dcop.getEditor();
}
}
return res;
}
Aggregations