Author: vyemialyanchyk
Date: 2011-01-24 10:23:51 -0500 (Mon, 24 Jan 2011)
New Revision: 28559
Modified:
branches/jbosstools-3.2.0.CR1/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/DiagramViewer.java
Log:
https://issues.jboss.org/browse/JBIDE-8205 - fixed
Modified:
branches/jbosstools-3.2.0.CR1/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/DiagramViewer.java
===================================================================
---
branches/jbosstools-3.2.0.CR1/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/DiagramViewer.java 2011-01-24
15:23:36 UTC (rev 28558)
+++
branches/jbosstools-3.2.0.CR1/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/DiagramViewer.java 2011-01-24
15:23:51 UTC (rev 28559)
@@ -105,6 +105,7 @@
private GEFRootEditPart gefRootEditPart = new GEFRootEditPart();
private KeyHandler sharedKeyHandler;
private RulerComposite rulerComp;
+ private DiagramContentOutlinePage outlinePage;
public DiagramViewer() {
setEditDomain(new DefaultEditDomain(this));
@@ -383,14 +384,21 @@
setPartName(getDiagramInput().getName());
}
+ protected DiagramContentOutlinePage getDiagramContentOutlinePage() {
+ if (outlinePage == null) {
+ outlinePage = new DiagramContentOutlinePage(
+ new TreeViewer(), getActionRegistry());
+ }
+ return outlinePage;
+ }
+
/**
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("rawtypes")
public Object getAdapter(Class type) {
if (type == IContentOutlinePage.class) {
- DiagramContentOutlinePage outline = new DiagramContentOutlinePage(
- new TreeViewer(), getActionRegistry());
+ final DiagramContentOutlinePage outline = getDiagramContentOutlinePage();
outline.setGraphicalViewer(getGraphicalViewer());
outline.setSelectionSynchronizer(getSelectionSynchronizer());
outline.setOrmDiagram(getOrmDiagram());