changeset 1266:ff012a9d9d1d

Employ waterlevelfactory when cloning artifacts for WDifferences-Subtrahend/Minuend-artifacts. flys-client/trunk@2805 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 21 Sep 2011 14:37:51 +0000
parents f98bd9b5cedd
children 07aa1f504491
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageTwinPanel.java
diffstat 2 files changed, 22 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Wed Sep 21 12:54:27 2011 +0000
+++ b/flys-client/ChangeLog	Wed Sep 21 14:37:51 2011 +0000
@@ -1,3 +1,11 @@
+2011-09-21	Felix Wolfsteller	<felix.wolfsteller@intevation.de> 
+
+ Clone Subtrahend and Minuend in WDiff-branch of WINFO with waterlevelfactory.
+
+	* src/main/java/de/intevation/flys/client/client/ui/DatacageTwinPanel.java:
+	  Clone recommendations with waterlevel-factory, prepare to have a
+	  third column in listgrid to remove pairs.
+
 2011-09-21  Ingo Weinzierl <ingo@intevation.de>
 
 	flys/issue315 (Überschwemmungsfläche: String bei Streckenauswahl)
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageTwinPanel.java	Wed Sep 21 12:54:27 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageTwinPanel.java	Wed Sep 21 14:37:51 2011 +0000
@@ -18,6 +18,7 @@
 import com.smartgwt.client.widgets.events.ClickEvent;
 
 import de.intevation.flys.client.shared.model.Artifact;
+import de.intevation.flys.client.shared.model.Collection;
 import de.intevation.flys.client.shared.model.Data;
 import de.intevation.flys.client.shared.model.DataItem;
 import de.intevation.flys.client.shared.model.DefaultData;
@@ -73,7 +74,8 @@
         Data   data   = dataList.get(0);
         this.dataName = data.getLabel();
 
-        Canvas label  = new Label(data.getDescription());
+        // TODO use i18n of data.
+        Canvas label  = new Label("Subtrahend/Minuend");//data.getDescription());
         Canvas widget = createWidget();
         Canvas submit = getNextButton();
 
@@ -113,9 +115,11 @@
         differencesList.setShowAllRecords(true);  
         differencesList.setCanEdit(false);  
 
-        ListGridField nameField = new ListGridField("first", "Minuend");  
+        ListGridField nameField    = new ListGridField("first", "Minuend");  
         ListGridField capitalField = new ListGridField("second", "Subtrahend");  
-        differencesList.setFields(new ListGridField[] {nameField, capitalField});  
+        ListGridField removeField  = new ListGridField("remove", "Remove");  
+        differencesList.setFields(new ListGridField[] {nameField,
+           capitalField, removeField});
 
         layout.addMember(differencesList);
 
@@ -143,21 +147,23 @@
             ar.add(r.getFirst());
             ar.add(r.getSecond());
         }
+
         final Recommendation[] rs = ar.toArray(new Recommendation[ar.size()]);
         loadArtifactService.loadMany(
               this.collection,
               rs,
-              "winfo",
+              "waterlevel",
               config.getServerUrl(),
               config.getLocale(),
               new AsyncCallback<Artifact[]>() {
                 public void onFailure(Throwable caught) {
-                    GWT.log("No success in cloning Thing!");
+                    GWT.log("Failure of cloning with waterlevelfactory!");
                 }
                 public void onSuccess(Artifact[] artifacts) {
-                    GWT.log("Success of cloning thing!");
-                        fireStepForwardEvent(new StepForwardEvent(
-                            getData(rs, artifacts)));
+                    GWT.log("Success in cloning with watelevelfactory!");
+
+                    fireStepForwardEvent(new StepForwardEvent(
+                        getData(rs, artifacts)));
                 } }
                 );
     }

http://dive4elements.wald.intevation.org