branch feature/7469 updated (6132465 -> 859931b)
This is an automated email from the git hooks/post-receive script. New change to branch feature/7469 in repository observe. See http://git.codelutin.com/observe.git from 6132465 Séparer les données PS et LL, utiliser les id en paramètres des fonctions (refs #7469) new 859931b utilisation du gestionnaire d'ouverture dans les handlers des UI (refs #7469) 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 859931bed664e479974ec667e174c3e90327a6ac Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Mon Oct 5 13:41:23 2015 +0200 utilisation du gestionnaire d'ouverture dans les handlers des UI (refs #7469) Summary of changes: .../ui/content/open/ContentOpenableUIHandler.java | 17 +++++++++++------ .../open/impl/longline/ActivityLonglineUIHandler.java | 18 ++++++++++++++++++ .../open/impl/longline/TripLonglineUIHandler.java | 18 ++++++++++++++++++ .../open/impl/seine/ActivitySeineUIHandler.java | 18 ++++++++++++++++++ .../ui/content/open/impl/seine/RouteUIHandler.java | 17 ++++++++++++++--- .../ui/content/open/impl/seine/TripSeineUIHandler.java | 18 ++++++++++++++++++ 6 files changed, 97 insertions(+), 9 deletions(-) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/7469 in repository observe. See http://git.codelutin.com/observe.git commit 859931bed664e479974ec667e174c3e90327a6ac Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Mon Oct 5 13:41:23 2015 +0200 utilisation du gestionnaire d'ouverture dans les handlers des UI (refs #7469) --- .../ui/content/open/ContentOpenableUIHandler.java | 17 +++++++++++------ .../open/impl/longline/ActivityLonglineUIHandler.java | 18 ++++++++++++++++++ .../open/impl/longline/TripLonglineUIHandler.java | 18 ++++++++++++++++++ .../open/impl/seine/ActivitySeineUIHandler.java | 18 ++++++++++++++++++ .../ui/content/open/impl/seine/RouteUIHandler.java | 17 ++++++++++++++--- .../ui/content/open/impl/seine/TripSeineUIHandler.java | 18 ++++++++++++++++++ 6 files changed, 97 insertions(+), 9 deletions(-) diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/ContentOpenableUIHandler.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/ContentOpenableUIHandler.java index e16f02d..748d356 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/ContentOpenableUIHandler.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/ContentOpenableUIHandler.java @@ -21,6 +21,8 @@ */ package fr.ird.observe.ui.content.open; +import fr.ird.observe.ObserveOpenDataManager; +import fr.ird.observe.ObserveSwingApplicationContext; import fr.ird.observe.business.db.DataSource; import fr.ird.observe.business.db.constants.DataContextType; import fr.ird.observe.services.dto.OpenableDto; @@ -73,11 +75,17 @@ public abstract class ContentOpenableUIHandler<E extends OpenableDto> extends Co return source.canWriteData(); } + protected ObserveOpenDataManager getOpenDataManager() { + ObserveOpenDataManager openDataManager = ObserveSwingApplicationContext.get().getOpenDataManager(); + return openDataManager; + } + + protected abstract boolean doOpenData(); + public final void openDataUI() { boolean ok = false; try { - getBean().setOpen(true); - ok = true; + ok = doOpenData(); } catch (Exception e) { ErrorDialogUI.showError(e); if (log.isErrorEnabled()) { @@ -125,10 +133,7 @@ public abstract class ContentOpenableUIHandler<E extends OpenableDto> extends Co } } - public boolean doCloseData() { - getBean().setOpen(false); - return true; - } + public abstract boolean doCloseData(); public final void afterCloseData() { diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/longline/ActivityLonglineUIHandler.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/longline/ActivityLonglineUIHandler.java index 0bd0866..b5e418c 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/longline/ActivityLonglineUIHandler.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/longline/ActivityLonglineUIHandler.java @@ -81,6 +81,24 @@ public class ActivityLonglineUIHandler extends ContentOpenableUIHandler<Activity } @Override + protected boolean doOpenData() { + boolean result = getOpenDataManager().canOpenActivityLongline(getSelectedParentId()); + if (result) { + getOpenDataManager().openActivityLongline(getSelectedParentId(), getSelectedId()); + } + return result; + } + + @Override + public boolean doCloseData() { + boolean result = getOpenDataManager().isOpenActivityLongline(getSelectedId()); + if (result) { + getOpenDataManager().closeActivityLongline(getSelectedId()); + } + return result; + } + + @Override protected ContentMode getContentMode(DataContext dataContext) { String activityId = getSelectedId(); diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/longline/TripLonglineUIHandler.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/longline/TripLonglineUIHandler.java index 507c493..9851c3c 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/longline/TripLonglineUIHandler.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/longline/TripLonglineUIHandler.java @@ -72,6 +72,24 @@ public class TripLonglineUIHandler extends ContentOpenableUIHandler<TripLongline } @Override + protected boolean doOpenData() { + boolean result = getOpenDataManager().canOpenTripLongline(); + if (result) { + getOpenDataManager().openTripLongline(getSelectedId()); + } + return result; + } + + @Override + public boolean doCloseData() { + boolean result = getOpenDataManager().isOpenTripLongline(getSelectedId()); + if (result) { + getOpenDataManager().closeTripLongline(getSelectedId()); + } + return result; + } + + @Override protected ContentMode getContentMode(DataContext dataContext) { String mareeId = getSelectedId(); diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/seine/ActivitySeineUIHandler.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/seine/ActivitySeineUIHandler.java index c6b5f3b..8a45db0 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/seine/ActivitySeineUIHandler.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/seine/ActivitySeineUIHandler.java @@ -89,6 +89,24 @@ public class ActivitySeineUIHandler extends ContentOpenableUIHandler<ActivitySei } @Override + protected boolean doOpenData() { + boolean result = getOpenDataManager().canOpenActivitySeine(getSelectedParentId()); + if (result) { + getOpenDataManager().openActivitySeine(getSelectedParentId(), getSelectedId()); + } + return result; + } + + @Override + public boolean doCloseData() { + boolean result = getOpenDataManager().isOpenActivitySeine(getSelectedId()); + if (result) { + getOpenDataManager().closeActivitySeine(getSelectedId()); + } + return result; + } + + @Override protected ContentMode getContentMode(DataContext dataContext) { String activityId = getSelectedId(); diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/seine/RouteUIHandler.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/seine/RouteUIHandler.java index 32b78e2..37b4a7e 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/seine/RouteUIHandler.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/seine/RouteUIHandler.java @@ -72,6 +72,15 @@ public class RouteUIHandler extends ContentOpenableUIHandler<RouteDto> { } @Override + protected boolean doOpenData() { + boolean result = getOpenDataManager().canOpenRoute(getSelectedParentId()); + if (result) { + getOpenDataManager().openRoute(getSelectedParentId(), getSelectedId()); + } + return result; + } + + @Override protected ContentMode getContentMode(DataContext dataContext) { String routeId = getSelectedId(); @@ -426,9 +435,11 @@ public class RouteUIHandler extends ContentOpenableUIHandler<RouteDto> { } // ok on peut fermer classiquement la route - super.doCloseData(); - - return true; + boolean result = getOpenDataManager().isOpenRoute(getSelectedId()); + if (result) { + getOpenDataManager().closeRoute(getSelectedId()); + } + return result; } protected ActivitySeineUI addActivityFinDeVeille(boolean close) { diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/seine/TripSeineUIHandler.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/seine/TripSeineUIHandler.java index 7de1ee5..b94748e 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/seine/TripSeineUIHandler.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/seine/TripSeineUIHandler.java @@ -71,6 +71,24 @@ public class TripSeineUIHandler extends ContentOpenableUIHandler<TripSeineDto> { } @Override + protected boolean doOpenData() { + boolean result = getOpenDataManager().canOpenTripSeine(); + if (result) { + getOpenDataManager().openTripSeine(getSelectedId()); + } + return result; + } + + @Override + public boolean doCloseData() { + boolean result = getOpenDataManager().isOpenTripSeine(getSelectedId()); + if (result) { + getOpenDataManager().closeTripSeine(getSelectedId()); + } + return result; + } + + @Override protected ContentMode getContentMode(DataContext dataContext) { String mareeId = getSelectedId(); -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.
participants (1)
-
codelutin.com scm