This is an automated email from the git hooks/post-receive script. New commit to branch feature/7587 in repository observe. See http://git.codelutin.com/observe.git commit ac3116246a9571a2430b33295581a44d3ba1a668 Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Tue Oct 6 15:29:53 2015 +0200 correction de la validation + ajout des routes dans le DTO de trip seine (refs #7587) --- .../ui/content/open/ContentOpenableUIHandler.java | 70 +++++----------------- .../open/impl/seine/TripSeineUIHandler.java | 4 -- 2 files changed, 15 insertions(+), 59 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 20ba59c..f7ee163 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 @@ -22,10 +22,13 @@ package fr.ird.observe.ui.content.open; import fr.ird.observe.ObserveOpenDataManager; +import fr.ird.observe.ObserveServiceHelper; import fr.ird.observe.ObserveSwingApplicationContext; import fr.ird.observe.business.db.constants.DataContextType; import fr.ird.observe.db.ObserveSwingDataSource; import fr.ird.observe.services.dto.IdDto; +import fr.ird.observe.services.dto.longline.TripLonglineDto; +import fr.ird.observe.services.dto.seine.TripSeineDto; import fr.ird.observe.ui.content.ContentMode; import fr.ird.observe.ui.content.ContentUIHandler; import fr.ird.observe.ui.tree.ObserveNode; @@ -158,8 +161,7 @@ public abstract class ContentOpenableUIHandler<E extends IdDto> extends ContentU // selectedNode = selectedNode.getParent(); // } // treeHelper.refreshNode(selectedNode, true); - //FIXME -// treeHelper.reloadSelectedNode(bean instanceof Trip, true); + treeHelper.reloadSelectedNode(bean instanceof TripSeineDto || bean instanceof TripLonglineDto, true); updateActions(); } @@ -170,7 +172,6 @@ public abstract class ContentOpenableUIHandler<E extends IdDto> extends ContentU ContentOpenableUI<E> ui = getUi(); - int position = ui.getContextValue(Integer.class, POSITION_OPENABLE); ObserveTreeHelper treeHelper = getTreeHelper(ui); ObserveNode node = treeHelper.getSelectedNode(); @@ -179,13 +180,6 @@ public abstract class ContentOpenableUIHandler<E extends IdDto> extends ContentU E bean = getBean(); - int oldPosition; - if (create) { - oldPosition = parentNode.getChildCount(); - } else { - oldPosition = parentNode.getIndex(node); - } - if (create) { // on passe en mode mise à jour @@ -200,29 +194,15 @@ public abstract class ContentOpenableUIHandler<E extends IdDto> extends ContentU // arrêt de l'édition de l'écran courant stopEditUI(); - if (oldPosition != position) { - - // on doit repositionner le noeud - treeHelper.moveNode(parentNode, node, position); - } + treeHelper.reloadNode(parentNode, true); // on sélectionne le nouveau noeud treeHelper.selectNode(node); } else { - if (oldPosition != position) { - // on doit repositionner le noeud - treeHelper.moveNode(parentNode, node, position); - - // et le selectionner - treeHelper.selectNode(node); - } + treeHelper.reloadNode(parentNode, true); - // on repaint le noeud et ses enfants -// treeHelper.refreshNode(node, true); - treeHelper.reloadSelectedNode(false, true); -// treeHelper.refreshNode(node, false); } } @@ -266,25 +246,6 @@ public abstract class ContentOpenableUIHandler<E extends IdDto> extends ContentU treeHelper.addUnsavedNode(parentNode, getBeanType()); } - //FIXME -// protected final void obtainChildPosition(E bean, -// DataService dataService, -// DataSource dataSource) { -// -// String containerId = getSelectedParentId(); -// -// int position = dataService.getOpenablePosition(dataSource, -// containerId, -// bean.getTopiaId() -// ); -// -// if (log.isDebugEnabled()) { -// log.debug("Position of child : " + position); -// } -// -// getUi().setContextValue(position, POSITION_OPENABLE); -// } - protected final void finalizeOpenUI(ContentMode mode, boolean create) { // utilisation du mode requis @@ -296,16 +257,15 @@ public abstract class ContentOpenableUIHandler<E extends IdDto> extends ContentU if (!create) { - //FIXME -// Trip currentTrip = ObserveServiceHelper.getValidationContext().getCurrentTrip(); -// -// if (currentTrip != null && currentTrip.isHistoricalData()) { -// -// if (log.isInfoEnabled()) { -// log.info(prefix + "Using a historical fish trip " + currentTrip.getTopiaId()); -// } -// historicalData = true; -// } + TripSeineDto currentTripSeine = ObserveServiceHelper.getValidationContext().getCurrentTripSeine(); + + if (currentTripSeine != null && currentTripSeine.isHistoricalData()) { + + if (log.isInfoEnabled()) { + log.info(prefix + "Using a historical fish trip " + currentTripSeine.getId()); + } + historicalData = true; + } } 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 c567581..bc0949d 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 @@ -268,10 +268,6 @@ public class TripSeineUIHandler extends ContentOpenableUIHandler<TripSeineDto> { String beanId = getTripSeineService().save(bean); bean.setId(beanId); - // recuperation de la position de la maree dans le program - //FIXME -// obtainChildPosition(bean, dataService, dataSource); - return true; } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.