This is an automated email from the git hooks/post-receive script. New commit to branch feature/7017 in repository observe. See http://git.codelutin.com/observe.git commit 2e0a250caf9f96f6282759ef45c45cbee129fc74 Author: Tony CHEMIT <chemit@codelutin.com> Date: Mon Apr 27 14:55:57 2015 +0200 mise à jour du programme ouvert lors du déplacement d'une marée (ref #7017) --- .../java/fr/ird/observe/services/data/TripServiceImpl.java | 7 ------- .../ui/tree/ObserveNavigationTreeShowPopupAction.java | 5 ++++- .../ui/tree/actions/ChangeTripProgramActionListener.java | 14 +++++++++++++- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/observe-services/src/main/java/fr/ird/observe/services/data/TripServiceImpl.java b/observe-services/src/main/java/fr/ird/observe/services/data/TripServiceImpl.java index e50203d..4a7e2c9 100644 --- a/observe-services/src/main/java/fr/ird/observe/services/data/TripServiceImpl.java +++ b/observe-services/src/main/java/fr/ird/observe/services/data/TripServiceImpl.java @@ -80,13 +80,6 @@ public class TripServiceImpl extends AbstractObserveService implements TripServi trip.setProgram(program); -// if (trip.isOpen()) { -// -// // refresh the dataContext -// dataContext.setOpenProgramId(programId); -// -// } - } @Override diff --git a/observe-swing/src/main/java/fr/ird/observe/ui/tree/ObserveNavigationTreeShowPopupAction.java b/observe-swing/src/main/java/fr/ird/observe/ui/tree/ObserveNavigationTreeShowPopupAction.java index cc11922..ba2630a 100644 --- a/observe-swing/src/main/java/fr/ird/observe/ui/tree/ObserveNavigationTreeShowPopupAction.java +++ b/observe-swing/src/main/java/fr/ird/observe/ui/tree/ObserveNavigationTreeShowPopupAction.java @@ -223,6 +223,8 @@ public class ObserveNavigationTreeShowPopupAction { OpenableService openableService = observeContext.getService(OpenableService.class); TripService tripService = observeContext.getService(TripService.class); String tripId = selectedNode.getId(); + String openTripId = observeContext.getDataContext().getOpenTripId(); + boolean tripOpen = openTripId!=null && openTripId.equals(tripId); List<Program> programs = tripService.getPossibleProgramsForTrip(tripId); @@ -241,7 +243,8 @@ public class ObserveNavigationTreeShowPopupAction { openableService, tripService, tripId, - programId)); + programId, + tripOpen)); moveTripPopup.add(item); diff --git a/observe-swing/src/main/java/fr/ird/observe/ui/tree/actions/ChangeTripProgramActionListener.java b/observe-swing/src/main/java/fr/ird/observe/ui/tree/actions/ChangeTripProgramActionListener.java index 5fb89a7..225d893 100644 --- a/observe-swing/src/main/java/fr/ird/observe/ui/tree/actions/ChangeTripProgramActionListener.java +++ b/observe-swing/src/main/java/fr/ird/observe/ui/tree/actions/ChangeTripProgramActionListener.java @@ -22,6 +22,7 @@ package fr.ird.observe.ui.tree.actions; * #L% */ +import fr.ird.observe.ObserveContext; import fr.ird.observe.services.data.OpenableService; import fr.ird.observe.services.data.TripService; import fr.ird.observe.ui.tree.ObserveNode; @@ -53,16 +54,20 @@ public class ChangeTripProgramActionListener implements ActionListener { protected final OpenableService openableService; + private final boolean tripOpen; + public ChangeTripProgramActionListener(ObserveTreeHelper treeHelper, OpenableService openableService, TripService tripService, String tripId, - String programId) { + String programId, + boolean tripOpen) { this.tripService = tripService; this.tripId = tripId; this.programId = programId; this.treeHelper = treeHelper; this.openableService = openableService; + this.tripOpen = tripOpen; } @Override @@ -75,6 +80,13 @@ public class ChangeTripProgramActionListener implements ActionListener { tripService.moveTripToProgram(tripId, programId); + if (tripOpen) { + + // refresh the dataContext + ObserveContext.get().getDataContext().setOpenProgramId(programId); + + } + int position = openableService.getOpenablePosition(programId, tripId); treeHelper.removeNode(tripNode); -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.