#5010 : Initial commit to fix duplicate entry issue when creating new key node
[taxeditor.git] / eu.etaxonomy.taxeditor.editor / src / main / java / eu / etaxonomy / taxeditor / editor / key / polytomous / PolytomousKeyListContentProvider.java
index a17c56a0a503afd56d350188b8ed65d5c4179f51..90ed20b2b7386d3397d1ce2d2de13f45851709ee 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
  * Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy 
+ * European Distributed Institute of Taxonomy
  * http://www.e-taxonomy.eu
- * 
+ *
  * The contents of this file are subject to the Mozilla Public License Version 1.1
  * See LICENSE.TXT at the top of this package for the full license terms.
  */
@@ -16,7 +16,6 @@ import java.util.List;
 import org.eclipse.jface.viewers.IStructuredContentProvider;
 import org.eclipse.jface.viewers.Viewer;
 
-import eu.etaxonomy.cdm.model.description.PolytomousKey;
 import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
 
 /**
@@ -29,7 +28,7 @@ public class PolytomousKeyListContentProvider implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see org.eclipse.jface.viewers.IContentProvider#dispose()
         */
        @Override
@@ -38,7 +37,7 @@ public class PolytomousKeyListContentProvider implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface
         * .viewers.Viewer, java.lang.Object, java.lang.Object)
@@ -49,17 +48,17 @@ public class PolytomousKeyListContentProvider implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java
         * .lang.Object)
         */
        @Override
        public Object[] getElements(Object inputElement) {
-               if (inputElement instanceof PolytomousKey) {
+               if (inputElement instanceof PolytomousKeyEditorInput) {
                        List<PolytomousKeyNode> result = new ArrayList<PolytomousKeyNode>();
 
-                       PolytomousKeyNode root = ((PolytomousKey) inputElement).getRoot();
+                       PolytomousKeyNode root = ((PolytomousKeyEditorInput) inputElement).getKey().getRoot();
 
                        getChildrenBreadthFirst(result, root);
                        return result.toArray();