diff flys-client/src/main/java/de/intevation/flys/client/client/ui/AbstractUIProvider.java @ 909:794d1af42987

Clone Artifacts and add them to the current Collection in the WspDatacagePanel. flys-client/trunk@2766 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 15 Sep 2011 16:02:23 +0000
parents 77a549772aa9
children 89a47098bcbd
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/AbstractUIProvider.java	Thu Sep 15 15:55:30 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/AbstractUIProvider.java	Thu Sep 15 16:02:23 2011 +0000
@@ -20,11 +20,12 @@
 import de.intevation.flys.client.client.event.StepBackHandler;
 import de.intevation.flys.client.client.event.StepForwardEvent;
 import de.intevation.flys.client.client.event.StepForwardHandler;
+import de.intevation.flys.client.shared.model.Artifact;
+import de.intevation.flys.client.shared.model.ArtifactDescription;
+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.DataList;
-import de.intevation.flys.client.shared.model.Artifact;
-import de.intevation.flys.client.shared.model.ArtifactDescription;
 
 /**
  * An abstract UIProvider that provides some basic methods.
@@ -51,6 +52,9 @@
     /** The artifact that contains status information.*/
     protected Artifact artifact;
 
+    /** The Collection.*/
+    protected Collection collection;
+
     /**
      * Creates a new UIProvider instance of this class.
      */
@@ -125,15 +129,20 @@
             fireStepForwardEvent(new StepForwardEvent(data));
         }
         else {
-            StringBuilder sb = new StringBuilder();
+            showErrors(errors);
+        }
+    }
 
-            for (String error: errors) {
-                sb.append(error);
-                sb.append("<br>");
-            }
 
-            SC.warn(sb.toString());
+    protected void showErrors(List<String> errors) {
+        StringBuilder sb = new StringBuilder();
+
+        for (String error: errors) {
+            sb.append(error);
+            sb.append("<br>");
         }
+
+        SC.warn(sb.toString());
     }
 
 
@@ -192,6 +201,16 @@
     }
 
 
+    public void setCollection(Collection collection) {
+        this.collection = collection;
+    }
+
+
+    public Collection getCollection() {
+        return collection;
+    }
+
+
     /**
      * This method greps the Data with name <i>name</i> from the list and
      * returns it.

http://dive4elements.wald.intevation.org