branch feature/8057 created (now bb4d2b5)
This is an automated email from the git hooks/post-receive script. New change to branch feature/8057 in repository tutti. See http://git.codelutin.com/tutti.git at bb4d2b5 on réajoute une ligne vide si y a plus d eligens (fixes #8057) This branch includes the following new commits: new bb4d2b5 on réajoute une ligne vide si y a plus d eligens (fixes #8057) The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit bb4d2b5d2768d84f9d320a56c5617c7a7a3e229a Author: Kevin Morin <morin@codelutin.com> Date: Fri Mar 4 15:46:46 2016 +0100 on réajoute une ligne vide si y a plus d eligens (fixes #8057) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/8057 in repository tutti. See http://git.codelutin.com/tutti.git commit bb4d2b5d2768d84f9d320a56c5617c7a7a3e229a Author: Kevin Morin <morin@codelutin.com> Date: Fri Mar 4 15:46:46 2016 +0100 on réajoute une ligne vide si y a plus d eligens (fixes #8057) --- .../frequency/SpeciesFrequencyUIHandler.java | 25 ++++++++++++++++------ .../frequency/actions/RemoveObservationAction.java | 4 ---- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java index a5e4071..0b38ba4 100644 --- a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java +++ b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java @@ -833,9 +833,6 @@ public class SpeciesFrequencyUIHandler extends AbstractTuttiTableUIHandler<Speci model.setIndividualObservationRows(obsRows); obsTableModel.setRows(obsRows); - if (obsRows.isEmpty()) { - obsTableModel.addNewRow(); - } model.recomputeIndividualObservationRowsValidateState(); // keep batch (will be used to push back editing entry) @@ -1245,8 +1242,13 @@ public class SpeciesFrequencyUIHandler extends AbstractTuttiTableUIHandler<Speci switch (e.getType()) { case TableModelEvent.DELETE: - for (int i = firstRow ; i < tableModel.getRowCount() ; i++) { - tableModel.getRows().get(i).setRankOrder(i + 1); + if (tableModel.getRowCount() == 0) { + tableModel.addNewRow(); + + } else { + for (int i = firstRow; i < tableModel.getRowCount(); i++) { + tableModel.getRows().get(i).setRankOrder(i + 1); + } } break; @@ -1261,6 +1263,12 @@ public class SpeciesFrequencyUIHandler extends AbstractTuttiTableUIHandler<Speci getModel().recomputeIndividualObservationRowValidState(newRow); } + break; + + case TableModelEvent.UPDATE: + if (tableModel.getRowCount() == 0) { + tableModel.addNewRow(); + } } }); } @@ -1428,7 +1436,12 @@ public class SpeciesFrequencyUIHandler extends AbstractTuttiTableUIHandler<Speci } } - Collections.sort(model.getRows()); + if (model.getRowCount() == 0) { + getTableModel().addNewRow(); + + } else { + Collections.sort(model.getRows()); + } } else if (getTableModel().getRowCount() == 0) { getTableModel().addNewRow(); diff --git a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/actions/RemoveObservationAction.java b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/actions/RemoveObservationAction.java index 127064b..22b2ac9 100644 --- a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/actions/RemoveObservationAction.java +++ b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/actions/RemoveObservationAction.java @@ -90,10 +90,6 @@ public class RemoveObservationAction extends SimpleActionSupport<SpeciesFrequenc int maxSelection = obsTable.getSelectionModel().getMaxSelectionIndex(); obsTableModel.getRows().removeAll(rowsToDelete); obsTableModel.fireTableRowsDeleted(minSelection, maxSelection); - - if (obsTable.getRowCount() == 0) { - obsTableModel.addNewRow(); - } } } } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm