branch feature/7591_Correction_migration_entites_d_un_parent_a_un_autre updated (d2078df -> 7dc25bc)
This is an automated email from the git hooks/post-receive script. New change to branch feature/7591_Correction_migration_entites_d_un_parent_a_un_autre in repository observe. See https://gitlab.nuiton.org/codelutin/observe.git from d2078df Refactor ChangeTripProgramActionListener a bit new 7dc25bc Enable entity move from a parent to another whatever the state of taht entity (open/closed) 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 7dc25bc481f39b0805660f732522beed44754a0e Author: Samuel Maisonneuve <maisonneuve@codelutin.com> Date: Tue Aug 2 18:29:11 2016 +0200 Enable entity move from a parent to another whatever the state of taht entity (open/closed) refs #7591 Summary of changes: .../ird/observe/ui/content/list/ContentListUI.jcss | 2 +- .../tree/ObserveNavigationTreeShowPopupAction.java | 45 +++++++++++----------- .../actions/ChangeActivityRouteActionListener.java | 17 +++++--- .../actions/ChangeActivityTripActionListener.java | 7 +++- .../actions/ChangeRouteTripActionListener.java | 7 +++- .../actions/ChangeTripProgramActionListener.java | 6 ++- 6 files changed, 51 insertions(+), 33 deletions(-) -- 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/7591_Correction_migration_entites_d_un_parent_a_un_autre in repository observe. See https://gitlab.nuiton.org/codelutin/observe.git commit 7dc25bc481f39b0805660f732522beed44754a0e Author: Samuel Maisonneuve <maisonneuve@codelutin.com> Date: Tue Aug 2 18:29:11 2016 +0200 Enable entity move from a parent to another whatever the state of taht entity (open/closed) refs #7591 --- .../ird/observe/ui/content/list/ContentListUI.jcss | 2 +- .../tree/ObserveNavigationTreeShowPopupAction.java | 45 +++++++++++----------- .../actions/ChangeActivityRouteActionListener.java | 17 +++++--- .../actions/ChangeActivityTripActionListener.java | 7 +++- .../actions/ChangeRouteTripActionListener.java | 7 +++- .../actions/ChangeTripProgramActionListener.java | 6 ++- 6 files changed, 51 insertions(+), 33 deletions(-) diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/list/ContentListUI.jcss b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/list/ContentListUI.jcss index 819a92e..ab4721e 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/list/ContentListUI.jcss +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/list/ContentListUI.jcss @@ -66,7 +66,7 @@ } #moveSelectedChildren { - visible:{model.isUpdatingMode()}; + visible:{!model.isEmpty()}; enabled:{model.isOneOrMoreSelectedData()}; } diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/ObserveNavigationTreeShowPopupAction.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/ObserveNavigationTreeShowPopupAction.java index fa365b3..6e53ec0 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/ObserveNavigationTreeShowPopupAction.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/ObserveNavigationTreeShowPopupAction.java @@ -309,41 +309,42 @@ public class ObserveNavigationTreeShowPopupAction { closeAction.putClientProperty("ui", applicationContext.getSelectedContentUI()); popup.add(closeAction); - moveAction.setText(t("observe.navigationMenu.move." + nodeType)); - moveAction.setToolTipText(t("observe.navigationMenu.move." + nodeType)); - moveAction.setIcon(SwingUtil.getUIManagerActionIcon("move-" + nodeType)); - popup.add(moveAction); - moveAction.removeAll(); + } else { - // get the available program for the trip + openAction.putClientProperty("ui", applicationContext.getSelectedContentUI()); + popup.add(openAction); - String id = selectedNode.getId(); + } - ObserveSwingDataSource dataSource = treeHelper.getDataProvider().getDataSource(); + moveAction.setText(t("observe.navigationMenu.move." + nodeType)); + moveAction.setToolTipText(t("observe.navigationMenu.move." + nodeType)); + moveAction.setIcon(SwingUtil.getUIManagerActionIcon("move-" + nodeType)); + popup.add(moveAction); - List<DecoratedNodeEntity> possibleParentNodes = moveNodeData.getPossibleParentNodes(selectedNode, treeHelper); + moveAction.removeAll(); - for (DecoratedNodeEntity possibleParent : possibleParentNodes) { + // get the available program for the trip - String possibleParentId = possibleParent.getId(); - JMenuItem item = new JMenuItem(possibleParent.toString()); - item.setName(possibleParentId); + String id = selectedNode.getId(); + ObserveSwingDataSource dataSource = treeHelper.getDataProvider().getDataSource(); - item.addActionListener(moveNodeData.createChangeActionListener(treeHelper, - dataSource, - id, - possibleParentId)); + List<DecoratedNodeEntity> possibleParentNodes = moveNodeData.getPossibleParentNodes(selectedNode, treeHelper); - moveAction.add(item); - } + for (DecoratedNodeEntity possibleParent : possibleParentNodes) { - } else { + String possibleParentId = possibleParent.getId(); + JMenuItem item = new JMenuItem(possibleParent.toString()); + item.setName(possibleParentId); - openAction.putClientProperty("ui", applicationContext.getSelectedContentUI()); - popup.add(openAction); + item.addActionListener(moveNodeData.createChangeActionListener(treeHelper, + dataSource, + id, + possibleParentId)); + + moveAction.add(item); } deleteAction.putClientProperty("ui", applicationContext.getSelectedContentUI()); diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/actions/ChangeActivityRouteActionListener.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/actions/ChangeActivityRouteActionListener.java index 9326ea6..8b04a9b 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/actions/ChangeActivityRouteActionListener.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/actions/ChangeActivityRouteActionListener.java @@ -23,6 +23,7 @@ package fr.ird.observe.ui.tree.actions; */ +import fr.ird.observe.ObserveOpenDataManager; import fr.ird.observe.ObserveSwingApplicationContext; import fr.ird.observe.db.ObserveSwingDataSource; import fr.ird.observe.services.dto.seine.RouteDto; @@ -52,6 +53,16 @@ public class ChangeActivityRouteActionListener extends NodeChangeActionListener } @Override + protected void closeNode(String activityId) { + ObserveSwingApplicationContext applicationContext = ObserveSwingApplicationContext.get(); + ObserveOpenDataManager openDataManager = applicationContext.getOpenDataManager(); + + if (openDataManager.isOpenActivitySeine(activityId)) { + openDataManager.closeActivitySeine(activityId); + } + } + + @Override protected ObserveNode getParentNode(ObserveNode node) { return node.getParent().getParent(); } @@ -66,12 +77,6 @@ public class ChangeActivityRouteActionListener extends NodeChangeActionListener } @Override - protected void closeNode(String activityId) { - ObserveSwingApplicationContext applicationContext = ObserveSwingApplicationContext.get(); - applicationContext.getOpenDataManager().closeActivitySeine(activityId); - } - - @Override protected int moveNodeToParent(String nodeId, String parentNodeId, String oldParentNodeId) { int position; diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/actions/ChangeActivityTripActionListener.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/actions/ChangeActivityTripActionListener.java index 46737cb..894f5d4 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/actions/ChangeActivityTripActionListener.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/actions/ChangeActivityTripActionListener.java @@ -23,6 +23,7 @@ package fr.ird.observe.ui.tree.actions; */ +import fr.ird.observe.ObserveOpenDataManager; import fr.ird.observe.ObserveSwingApplicationContext; import fr.ird.observe.db.ObserveSwingDataSource; import fr.ird.observe.services.dto.longline.TripLonglineDto; @@ -54,7 +55,11 @@ public class ChangeActivityTripActionListener extends NodeChangeActionListener { @Override protected void closeNode(String activityId) { ObserveSwingApplicationContext applicationContext = ObserveSwingApplicationContext.get(); - applicationContext.getOpenDataManager().closeActivityLongline(activityId); + ObserveOpenDataManager openDataManager = applicationContext.getOpenDataManager(); + + if (openDataManager.isOpenActivityLongline(activityId)) { + openDataManager.closeActivityLongline(activityId); + } } @Override diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/actions/ChangeRouteTripActionListener.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/actions/ChangeRouteTripActionListener.java index 0d83df9..bf504ae 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/actions/ChangeRouteTripActionListener.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/actions/ChangeRouteTripActionListener.java @@ -23,6 +23,7 @@ package fr.ird.observe.ui.tree.actions; */ +import fr.ird.observe.ObserveOpenDataManager; import fr.ird.observe.ObserveSwingApplicationContext; import fr.ird.observe.db.ObserveSwingDataSource; import fr.ird.observe.services.dto.seine.TripSeineDto; @@ -54,7 +55,11 @@ public class ChangeRouteTripActionListener extends NodeChangeActionListener { @Override protected void closeNode(String routeId) { ObserveSwingApplicationContext applicationContext = ObserveSwingApplicationContext.get(); - applicationContext.getOpenDataManager().closeRoute(routeId); + ObserveOpenDataManager openDataManager = applicationContext.getOpenDataManager(); + + if (openDataManager.isOpenRoute(routeId)) { + openDataManager.closeRoute(routeId); + } } @Override diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/actions/ChangeTripProgramActionListener.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/actions/ChangeTripProgramActionListener.java index 30975c8..de18fc2 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/actions/ChangeTripProgramActionListener.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/actions/ChangeTripProgramActionListener.java @@ -84,8 +84,10 @@ public class ChangeTripProgramActionListener extends NodeChangeActionListener { // Close old program and open new program ObserveOpenDataManager openDataManager = applicationContext.getOpenDataManager(); - openDataManager.closeProgram(oldParentNodeId); - openDataManager.openProgram(parentNodeId); + if (openDataManager.isOpen(nodeId)) { + openDataManager.closeProgram(oldParentNodeId); + openDataManager.openProgram(parentNodeId); + } return position; } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm