Commit 8ec57267 authored by PECQUOT's avatar PECQUOT

Merge branch 'release/3.9.8'

parents 9d4613f1 3f5855f5
## Sprint 90 - v3.9.8
- Pas de mise à jour de modèle
## Sprint 89 - v3.9.7
- Pas de mise à jour de modèle
......
......@@ -10,7 +10,7 @@
<groupId>fr.ifremer.reefdb</groupId>
<artifactId>reefdb</artifactId>
<version>3.9.7</version>
<version>3.9.8</version>
<packaging>pom</packaging>
<name>Reef DB</name>
......
......@@ -4,7 +4,7 @@
<parent>
<groupId>fr.ifremer.reefdb</groupId>
<artifactId>reefdb</artifactId>
<version>3.9.7</version>
<version>3.9.8</version>
</parent>
<artifactId>reefdb-core</artifactId>
......
......@@ -35,7 +35,7 @@
# Please fill the missing licenses for dependencies :
#
#
#Mon Mar 23 12:33:10 CET 2020
#Mon Mar 30 15:21:02 CEST 2020
com.oracle--ojdbc7--12.1.0.2.0=OTN license
commons-primitives--commons-primitives--1.0=The Apache Software License, Version 2.0
dom4j--dom4j--1.6.1=BSD License
......
......@@ -4,7 +4,7 @@
<parent>
<groupId>fr.ifremer.reefdb</groupId>
<artifactId>reefdb</artifactId>
<version>3.9.7</version>
<version>3.9.8</version>
</parent>
<artifactId>reefdb-ui-swing</artifactId>
......
......@@ -30,6 +30,7 @@ import com.google.common.collect.Maps;
import fr.ifremer.quadrige3.core.dao.technical.Assert;
import fr.ifremer.quadrige3.core.dao.technical.factorization.pmfm.AllowedQualitativeValuesMap;
import fr.ifremer.quadrige3.ui.core.dto.DirtyAware;
import fr.ifremer.quadrige3.ui.swing.table.AbstractTableUIModel;
import fr.ifremer.quadrige3.ui.swing.table.SwingTable;
import fr.ifremer.quadrige3.ui.swing.table.editor.ExtendedComboBoxCellEditor;
import fr.ifremer.reefdb.decorator.DecoratorService;
......@@ -454,7 +455,8 @@ public abstract class AbstractMeasurementsGroupedTableUIHandler<
// now calculate individual id after table is sorted
if (getTable().getRowSorter().getSortKeys().isEmpty()) {
calculateIndividualIds(newRow);
// Also use a OneShotListener (Mantis #51586)
OneShotListener.create(getModel(), AbstractTableUIModel.PROPERTY_ROWS, propertyChangeEvent -> calculateIndividualIds(newRow));
} else {
OneShotListener.create(getTable(), SwingTable.PROPERTY_SORTED, propertyChangeEvent -> calculateIndividualIds(newRow));
}
......
......@@ -23,6 +23,8 @@ package fr.ifremer.reefdb.ui.swing.util;
* #L%
*/
import org.jdesktop.beans.AbstractBean;
import javax.annotation.Nonnull;
import java.awt.Component;
import java.beans.PropertyChangeEvent;
......@@ -36,7 +38,8 @@ import java.util.function.Consumer;
*/
public class OneShotListener implements PropertyChangeListener {
private final Component parent;
private final Component parentComponent;
private final AbstractBean parentBean;
private final String propertyName;
private final Consumer<PropertyChangeEvent> consumer;
......@@ -52,8 +55,28 @@ public class OneShotListener implements PropertyChangeListener {
parent.addPropertyChangeListener(propertyName, listener);
}
private OneShotListener(Component parent, String propertyName, Consumer<PropertyChangeEvent> consumer) {
this.parent = parent;
/**
* Create and add to parent object
*
* @param parent the bean on which this listener will be added
* @param propertyName the property to listen to
* @param consumer the consumer function
*/
public static void create(@Nonnull AbstractBean parent, @Nonnull String propertyName, @Nonnull Consumer<PropertyChangeEvent> consumer) {
OneShotListener listener = new OneShotListener(parent, propertyName, consumer);
parent.addPropertyChangeListener(propertyName, listener);
}
private OneShotListener(Component parentComponent, String propertyName, Consumer<PropertyChangeEvent> consumer) {
this.parentComponent = parentComponent;
this.parentBean = null;
this.propertyName = propertyName;
this.consumer = consumer;
}
private OneShotListener(AbstractBean parentBean, String propertyName, Consumer<PropertyChangeEvent> consumer) {
this.parentComponent = null;
this.parentBean = parentBean;
this.propertyName = propertyName;
this.consumer = consumer;
}
......@@ -61,6 +84,9 @@ public class OneShotListener implements PropertyChangeListener {
@Override
public void propertyChange(PropertyChangeEvent evt) {
consumer.accept(evt);
parent.removePropertyChangeListener(propertyName, this);
if (parentComponent != null)
parentComponent.removePropertyChangeListener(propertyName, this);
if (parentBean != null)
parentBean.removePropertyChangeListener(propertyName, this);
}
}
......@@ -31,6 +31,12 @@
</properties>
<body>
<release version="3.9.8" date="2020-03-30" description="Stable release">
<action dev="ludovic.pecquot@e-is.pro" type="fix" issue="51586">
Regression of #51520: Postpone calculation also if no row sorting
</action>
</release>
<release version="3.9.7" date="2020-03-23" description="Stable release">
<action dev="ludovic.pecquot@e-is.pro" type="fix" issue="51520">
Rework the calculation of individual ids on grouped measurements, now use table sorting if possible
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment