This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository observe. See http://git.codelutin.com/observe.git commit e5719f9824963929eb58d144925cd519c85ed777 Author: Kevin Morin <morin@codelutin.com> Date: Tue Nov 17 14:29:31 2015 +0100 meilleur gestion de l'activation du menu de fermeture des neouds (refs #7622) --- .../ui/tree/ObserveNavigationTreeShowPopupAction.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) 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 87718a4..90f6379 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 @@ -37,6 +37,8 @@ import fr.ird.observe.services.dto.referential.ProgramDtos; import fr.ird.observe.services.dto.seine.TripSeineDto; import fr.ird.observe.services.service.ReferentialService; import fr.ird.observe.services.service.seine.TripSeineService; +import fr.ird.observe.ui.content.ContentUI; +import fr.ird.observe.ui.content.open.ContentOpenableUI; import fr.ird.observe.ui.tree.actions.ChangeRouteTripActionListener; import fr.ird.observe.ui.tree.actions.ChangeTripProgramActionListener; import fr.ird.observe.ui.tree.actions.NodeChangeActionListener; @@ -45,6 +47,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.nuiton.decorator.Decorator; +import javax.swing.JButton; import javax.swing.JMenuItem; import javax.swing.JPopupMenu; import javax.swing.JScrollPane; @@ -291,20 +294,28 @@ public class ObserveNavigationTreeShowPopupAction { ObserveSwingApplicationContext applicationContext = ObserveSwingApplicationContext.get(); DataContext dataContext = applicationContext.getDataContext(); + ContentUI<?> selectedContentUI = applicationContext.getSelectedContentUI(); + + boolean closeActionEnabled = false; + + if (selectedContentUI instanceof ContentOpenableUI) { + JButton closeButton = ((ContentOpenableUI) selectedContentUI).getClose(); + closeActionEnabled = closeButton.isEnabled(); + } if (selectedNode.isTripNode()) { beforeOpenMenu(selectedNode, TRIP_MENU_ITEMS); openAction.setEnabled(!dataContext.isOpenTrip()); - closeAction.setEnabled(!dataContext.isOpenRoute() && !dataContext.isOpenActivity()); + closeAction.setEnabled(closeActionEnabled); } else if (selectedNode.isRouteNode()) { beforeOpenMenu(selectedNode, ROUTE_MENU_ITEMS); openAction.setEnabled(!dataContext.isOpenRoute()); - closeAction.setEnabled(!dataContext.isOpenActivity()); + closeAction.setEnabled(closeActionEnabled); } else { -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.