Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
-
60a5d9ed
by Tony CHEMIT at 2017-06-14T11:07:52+02:00
2 changed files:
- application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/NonTargetCatchReleasedTableModel.java
- application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/NonTargetCatchReleasedUIHandler.java
Changes:
| ... | ... | @@ -45,6 +45,7 @@ public class NonTargetCatchReleasedTableModel extends ContentTableModel<SetSeine |
| 45 | 45 |
private static final Log log = LogFactory.getLog(NonTargetCatchReleasedTableModel.class);
|
| 46 | 46 |
|
| 47 | 47 |
private static final long serialVersionUID = 1L;
|
| 48 |
+ private boolean adjusting;
|
|
| 48 | 49 |
|
| 49 | 50 |
public NonTargetCatchReleasedTableModel(ObserveContentTableUI<SetSeineNonTargetCatchReleasedDto, NonTargetCatchReleasedDto, ?> context,
|
| 50 | 51 |
List<ContentTableMeta<NonTargetCatchReleasedDto>> contentTableMetas) {
|
| ... | ... | @@ -53,7 +54,12 @@ public class NonTargetCatchReleasedTableModel extends ContentTableModel<SetSeine |
| 53 | 54 |
|
| 54 | 55 |
@Override
|
| 55 | 56 |
protected void load(NonTargetCatchReleasedDto source, NonTargetCatchReleasedDto target) {
|
| 56 |
- NonTargetCatchReleasedHelper.copyNonTargetCatchReleasedDto(source, target);
|
|
| 57 |
+ adjusting = true;
|
|
| 58 |
+ try {
|
|
| 59 |
+ NonTargetCatchReleasedHelper.copyNonTargetCatchReleasedDto(source, target);
|
|
| 60 |
+ } finally {
|
|
| 61 |
+ adjusting = false;
|
|
| 62 |
+ }
|
|
| 57 | 63 |
}
|
| 58 | 64 |
|
| 59 | 65 |
@Override
|
| ... | ... | @@ -90,4 +96,8 @@ public class NonTargetCatchReleasedTableModel extends ContentTableModel<SetSeine |
| 90 | 96 |
getModel().setCanResetRow(false);
|
| 91 | 97 |
getModel().setModified(true);
|
| 92 | 98 |
}
|
| 99 |
+ |
|
| 100 |
+ public boolean isAdjusting() {
|
|
| 101 |
+ return adjusting;
|
|
| 102 |
+ }
|
|
| 93 | 103 |
}
|
| ... | ... | @@ -98,8 +98,10 @@ public class NonTargetCatchReleasedUIHandler extends ContentTableUIHandler<SetSe |
| 98 | 98 |
public NonTargetCatchReleasedUIHandler() {
|
| 99 | 99 |
super(DataContextType.SetSeine);
|
| 100 | 100 |
speciesChanged = evt -> {
|
| 101 |
- ReferentialReference<SpeciesDto> species = (ReferentialReference<SpeciesDto>) evt.getNewValue();
|
|
| 102 |
- updateSpecies(species, getTableEditBean().getNonTargetCatchReleasedState());
|
|
| 101 |
+ if (!getTableModel().isAdjusting()) {
|
|
| 102 |
+ ReferentialReference<SpeciesDto> species = (ReferentialReference<SpeciesDto>) evt.getNewValue();
|
|
| 103 |
+ updateSpecies(species, getTableEditBean().getNonTargetCatchReleasedState());
|
|
| 104 |
+ }
|
|
| 103 | 105 |
};
|
| 104 | 106 |
onToogleTimeEditorSliderChangedListener = evt -> {
|
| 105 | 107 |
Boolean newValue = (Boolean) evt.getNewValue();
|