ref #7509 Enhance aggregation dialog
authorPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 11 Jul 2018 11:05:12 +0000 (13:05 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 11 Jul 2018 11:05:12 +0000 (13:05 +0200)
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/CharacterMatrixBottomToolbar.java

index 0442a975c338745e77f1ed470436a6d7f7f15146..af121a21ca46776c63fc95dcfec54c6eeaa722dc 100644 (file)
@@ -137,12 +137,20 @@ public class CharacterMatrixBottomToolbar extends Composite{
                         .map(node -> new TaxonNodeDto(node)).collect(Collectors.toList());
                 TaxonNodeDto parentDto = CdmStore.getService(ITaxonNodeService.class).findCommonParentDto(nodeDtos);
                 UUID taxonUuid = parentDto.getTaxonUuid();
-                if(MessagingUtils.confirmDialog(
-                        "Choose taxon node",
-                        String.format("Do you want to choose a different taxon for"
-                                + "the aggregated description than thecommon parent node %s?"
-                                , parentDto.getTaxonTitleCache()))){
+                int response = MessagingUtils.confirmDialog(
+                        "Choose location for the aggregated description",
+                        String.format("The aggregated description will be stored at "
+                                + "the common parent taxon of this data set:\n%s\n\n"
+                                + "Do you want to use this taxon?"
+                                , parentDto.getTaxonTitleCache()), "Yes", "Choose taxon", "Cancel");
+                if(response==2){
+                    return;
+                }
+                else if(response==1){
                     Taxon taxon = TaxonSelectionDialog.selectTaxon(getShell(), null);
+                    if(taxon==null){
+                        return;
+                    }
                     taxonUuid = taxon.getUuid();
                 }
                 UpdateResult result = CdmStore.getService(IDescriptionService.class).aggregateDescription(taxonUuid, null, matrix.getDescriptiveDataSet().getUuid());