This is an automated email from the git hooks/post-receive script. New commit to branch feature/7075 in repository observe. See http://git.codelutin.com/observe.git commit 2740996cdcf36afac0fe2f3097c555224593b619 Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Wed May 6 17:27:22 2015 +0200 refs #7075 : passé le modèle à l'état modifier lors de la modification de l'avançon. Enegitré l'avancon en cour de modification a l'enregistrement du schéma de palangre --- .../LonglineDetailCompositionUIHandler.java | 34 ++++++++++++++++------ 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/observe-swing/src/main/java/fr/ird/observe/ui/content/impl/longline/LonglineDetailCompositionUIHandler.java b/observe-swing/src/main/java/fr/ird/observe/ui/content/impl/longline/LonglineDetailCompositionUIHandler.java index ac01be8..c7ab282 100644 --- a/observe-swing/src/main/java/fr/ird/observe/ui/content/impl/longline/LonglineDetailCompositionUIHandler.java +++ b/observe-swing/src/main/java/fr/ird/observe/ui/content/impl/longline/LonglineDetailCompositionUIHandler.java @@ -107,7 +107,7 @@ public class LonglineDetailCompositionUIHandler extends ContentUIHandler<SetLong } }; - private final PropertyChangeListener branchlineDetailSaved = new PropertyChangeListener() { + private final PropertyChangeListener branchlineDetailChanged = new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { @@ -327,7 +327,7 @@ public class LonglineDetailCompositionUIHandler extends ContentUIHandler<SetLong this.validationHelper = new LonglineDetailCompositionUIValidationHelper(ui1, getDecoratorService()); - getBranchlineDetailUIModel().addPropertyChangeListener(BranchlineUIModel.PROPERTY_SAVED, branchlineDetailSaved); + getBranchlineDetailUIModel().addPropertyChangeListener(BranchlineUIModel.PROPERTY_SAVED, branchlineDetailChanged); { // init section templates table @@ -485,19 +485,33 @@ public class LonglineDetailCompositionUIHandler extends ContentUIHandler<SetLong DataSource dataSource, TopiaEntityBinder<SetLongline> binder) throws Exception { + BranchlineUI branchlineDetailUI = getUi().getBranchlineDetailUI(); + + boolean continueSave = true; + + if (getUi().getFishingOperationTabPane().getSelectedIndex() == 2) { - SectionsTableModel sectionsTableModel = getSectionsTableModel(); - SectionWithTemplate selectedSection = sectionsTableModel.getSelectedRow(); - if (selectedSection != null) { + BranchlineUIHandler branchlineUIHandler = branchlineDetailUI.getHandler(); - // flush selected section before save - flushSection(selectedSection); + continueSave = branchlineUIHandler.tryToQuit(); } - dataService.update(dataSource, null, bean, getUpdateExecutor()); + if (continueSave) { + + SectionsTableModel sectionsTableModel = getSectionsTableModel(); + SectionWithTemplate selectedSection = sectionsTableModel.getSelectedRow(); + if (selectedSection != null) { + + // flush selected section before save + flushSection(selectedSection); + + } + + dataService.update(dataSource, null, bean, getUpdateExecutor()); + } - return true; + return continueSave; } @Override @@ -1355,6 +1369,7 @@ public class LonglineDetailCompositionUIHandler extends ContentUIHandler<SetLong case 2: BranchlineUI branchlineDetailUI = getUi().getBranchlineDetailUI(); + branchlineDetailUI.getModel().removePropertyChangeListener(BranchlineUIModel.PROPERTY_MODIFIED, branchlineDetailChanged); branchlineDetailUI.edit(null); break; @@ -1391,6 +1406,7 @@ public class LonglineDetailCompositionUIHandler extends ContentUIHandler<SetLong // update branchline detail BranchlineUI branchlineDetailUI = getUi().getBranchlineDetailUI(); branchlineDetailUI.edit(branchline); + branchlineDetailUI.getModel().addPropertyChangeListener(BranchlineUIModel.PROPERTY_MODIFIED, branchlineDetailChanged); } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.