ref #9772: check for changes before start aggregation
authorKatja Luther <k.luther@bgbm.org>
Mon, 4 Oct 2021 12:08:28 +0000 (14:08 +0200)
committerKatja Luther <k.luther@bgbm.org>
Mon, 4 Oct 2021 12:08:28 +0000 (14:08 +0200)
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/handler/AggregationHandler.java

index c26a0178f7f994402913c978beab7d4fcfce7591..8e38871bb32ed732b0832955c25b03325f1118c8 100755 (executable)
@@ -26,6 +26,7 @@ import org.eclipse.e4.ui.services.IServiceConstants;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.window.Window;
 import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.nebula.widgets.nattable.data.IRowDataProvider;
 
 import eu.etaxonomy.cdm.api.application.CdmApplicationState;
 import eu.etaxonomy.cdm.api.service.UpdateResult;
@@ -46,6 +47,7 @@ import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.IFeedbackGenerator;
 import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.dialog.configurator.StructuredAggregationConfigurationWizard;
 
 /**
@@ -58,9 +60,13 @@ public class AggregationHandler {
 
         // dependent on the selection the specimens are filtered
         CharacterMatrixPart matrixPart = (CharacterMatrixPart) activePart.getObject();
-
+       
         CharacterMatrix matrix = matrixPart.getMatrix();
+        if(StoreUtil.promptCheckIsDirty(matrixPart)){
+            return;
+        }
 
+        
         //ranks
         UUID minRankUuid = matrix.getDescriptiveDataSet().getMinRank() != null? matrix.getDescriptiveDataSet().getMinRank().getUuid(): null;
         UUID maxRankUuid = matrix.getDescriptiveDataSet().getMaxRank() != null? matrix.getDescriptiveDataSet().getMaxRank().getUuid(): null;
@@ -137,9 +143,12 @@ public class AggregationHandler {
                     }
 
                     DescriptiveDataSet dataSet = (DescriptiveDataSet) result.getCdmEntity();
-                    dataSet = matrix.getCdmEntitySession().load(dataSet, true);
+                    
                     // update local dataset
+                    
                     matrix.loadDescriptions(false, true);
+                   
+//                    matrix.setSelectedObject(sel);
                 }
             } catch (InterruptedException e) {
                 return;