- added check for open derivate editor command
authorPatric Plitzner <p.plitzner@bgbm.org>
Tue, 31 Mar 2015 07:04:43 +0000 (07:04 +0000)
committerPatric Plitzner <p.plitzner@bgbm.org>
Tue, 31 Mar 2015 07:04:43 +0000 (07:04 +0000)
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenDerivateViewHandler.java

index 33fc69beefa6f36b5780c6c924695bef7a918e67..412cabedd6d2856c44bc4ff79b8d2a5a089f1b51 100644 (file)
@@ -42,13 +42,18 @@ public class OpenDerivateViewHandler extends AbstractHandler {
                     }
                 }
             }
-            DerivateViewEditorInput input = new DerivateViewEditorInput(selectedElementUUIDs);
-            try {
-                EditorUtil.open(input);
-            } catch (PartInitException e) {
-                MessagingUtils.error(OpenDerivateViewHandler.class, "Could not open Derivate Editor", e);
-            } catch (NullPointerException npe){
-                MessagingUtils.messageDialog("Failed to open Editor", OpenDerivateViewHandler.class, "Could not open Derivate Editor. The derivate hierarchy is corrupted!", npe);
+            if(!selectedElementUUIDs.isEmpty()){
+                DerivateViewEditorInput input = new DerivateViewEditorInput(selectedElementUUIDs);
+                try {
+                    EditorUtil.open(input);
+                } catch (PartInitException e) {
+                    MessagingUtils.error(OpenDerivateViewHandler.class, "Could not open Derivate Editor", e);
+                } catch (NullPointerException npe){
+                    MessagingUtils.messageDialog("Failed to open Editor", OpenDerivateViewHandler.class, "Could not open Derivate Editor. The derivate hierarchy is corrupted!", npe);
+                }
+            }
+            else{
+                MessagingUtils.informationDialog("Empty selection", "No Specimen selected.");
             }
         }
         return null;