ref #7518 Adjust visibility of context menu items
authorPatrick Plitzner <p.plitzner@bgbm.org>
Thu, 5 Jul 2018 12:11:43 +0000 (14:11 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Thu, 5 Jul 2018 12:11:43 +0000 (14:11 +0200)
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/e4/handler/ConvertPerson2TeamHandlerE4.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/e4/handler/ConvertTeam2PersonHandlerE4.java

index 0644f01eb581b5dea781f0ce7d9d890ebfe743b2..245c6d86f010f5d726c2092006f32c60949bc12e 100644 (file)
@@ -81,7 +81,7 @@ public class ConvertPerson2TeamHandlerE4 {
         boolean canExecute = false;
         BulkEditorE4 bulkEditorE4 = (BulkEditorE4)activePart.getObject();
         StructuredSelection selection = (StructuredSelection)bulkEditorE4.getSelection();
-        canExecute = bulkEditorE4.getEditorInput().isConvertingEnabled();
+        canExecute = !selection.isEmpty() && bulkEditorE4.getEditorInput().isConvertingEnabled();
         Iterator iterator = selection.iterator();
         for(selection.iterator();iterator.hasNext();){
             if(!(iterator.next() instanceof Person)){
index 7d4f21661781db23aa143ea74260e615babf884b..def4d74fca5c035878bc88be8d0ad838bcfff0b3 100644 (file)
@@ -79,7 +79,7 @@ public class ConvertTeam2PersonHandlerE4 {
         boolean canExecute = false;
         BulkEditorE4 bulkEditorE4 = (BulkEditorE4)activePart.getObject();
         StructuredSelection selection = (StructuredSelection)bulkEditorE4.getSelection();
-        canExecute = bulkEditorE4.getEditorInput().isConvertingEnabled();
+        canExecute = !selection.isEmpty() && bulkEditorE4.getEditorInput().isConvertingEnabled();
         Iterator iterator = selection.iterator();
         for(selection.iterator();iterator.hasNext();){
             if(!(iterator.next() instanceof Team)){