Did some code cleanup. Removed obsolete and deprecated classes.
[taxeditor.git] / taxeditor-navigation / src / main / java / eu / etaxonomy / taxeditor / navigation / NavigationUtil.java
index 022a706ec5a18f2c9b082ae1fe02649392b2ef14..de9db83680381ffc8cb90247c9c6cbcc9f7bbcce 100644 (file)
@@ -87,26 +87,6 @@ public class NavigationUtil extends AbstractUtility{
                                        getOperationSupport().getUndoContext();
        }
 
-       /**
-        * Returns the selected taxon for referencing in context menus
-        * 
-        * @param event 
-        * @return
-        */
-       public static CdmBase getCurrentSelection(ExecutionEvent event){
-               
-               ISelection menuSelection = HandlerUtil.getActiveMenuSelection(event);
-               
-               // The selection should always be a tree selection since we are in the 
-               // taxonomic tree view. Just in case this will be used in another spot.
-               if(menuSelection instanceof TreeSelection){
-                       CdmBase cdmBase = (CdmBase) ((TreeSelection) menuSelection).getFirstElement();
-                       logger.debug("Selected cdmBase object: " + cdmBase);
-                       return cdmBase;
-               }
-               return null;
-       }
-
        public static IUndoContext getUndoContext() {
                // FIXME this has to be more specific. Every widget has to have its own undo context
 //             return IOperationHistory.GLOBAL_UNDO_CONTEXT;
@@ -197,10 +177,13 @@ public class NavigationUtil extends AbstractUtility{
                
                if(taxonNodes.size() == 1){
                        openEditor(taxonNodes.iterator().next());
-               }else{
+               }else if(taxonNodes.size() > 1){
                        // FIXME implement a dialog that shows all possible taxa and let the user choose which he wants to open.
-                       warningDialog("Not implemented yet", "The accepted taxon is either in multiple taxonomic views or the synonym has" +
-                                       " more than one accepted taxon. This case is not handled yet by the software.");
+                       warningDialog("Not implemented yet", "The accepted taxon is in multiple taxonomic trees. We currently do not know which one you want to open." +
+                                       " This case is not handled yet by the software.");
+               }else if(taxonNodes.size() == 0){
+                       // this is an undesired state
+                       warningDialog("Incorrect state", "The accepted taxon is not in a taxonomic view. This should not have happened.");
                }
        }