cleanup and rename createPartObject -> getPartObject
[taxeditor.git] / eu.etaxonomy.taxeditor.editor / src / main / java / eu / etaxonomy / taxeditor / editor / view / concept / graph / e4 / ConceptGraphViewE4.java
index 6f18e3b3689637fa25d66bcc76375cfa964f0c33..df1589bdece736426617cf2e24089954dd533d1c 100644 (file)
@@ -17,10 +17,10 @@ import org.eclipse.zest.layouts.LayoutAlgorithm;
 import org.eclipse.zest.layouts.LayoutStyles;
 import org.eclipse.zest.layouts.algorithms.TreeLayoutAlgorithm;
 
-import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
-import eu.etaxonomy.taxeditor.editor.e4.TaxonEditorInputE4;
+import eu.etaxonomy.taxeditor.bulkeditor.e4.BulkEditor;
+import eu.etaxonomy.taxeditor.editor.e4.TaxonEditorInput;
 import eu.etaxonomy.taxeditor.editor.l10n.Messages;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
 import eu.etaxonomy.taxeditor.editor.view.concept.graph.ConceptGraphContentProvider;
 import eu.etaxonomy.taxeditor.editor.view.concept.graph.ConceptGraphLabelProvider;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.e4.FactualDataPartE4;
@@ -51,7 +51,7 @@ public class ConceptGraphViewE4 extends AbstractCdmEditorPartE4 {
                return;
            }
 
-           Object partObject = createPartObject(activePart);
+           Object partObject = getPartObject(activePart);
 
            if (partObject instanceof DetailsPartE4 || partObject instanceof SupplementalDataPartE4
                    || partObject instanceof FactualDataPartE4|| partObject instanceof MediaViewPartE4) {
@@ -70,8 +70,11 @@ public class ConceptGraphViewE4 extends AbstractCdmEditorPartE4 {
                }
 
 
-               if(partObject instanceof TaxonNameEditorE4){
-                   TaxonEditorInputE4 input = ((TaxonNameEditorE4) partObject).getEditorInput();
+               if(partObject instanceof TaxonEditor){
+                   if (viewer.getControl() != null && !viewer.getControl().isDisposed()) {
+                viewer.getControl().setEnabled(true);
+            }
+                   TaxonEditorInput input = ((TaxonEditor) partObject).getEditorInput();
                    showViewer(new StructuredSelection(input), activePart, viewer);
                }