changeset 33:e29658e2623a

Added a listener mechanism to notify listeners when the parameterization of a Collection/Artifact changed. flys-client/trunk@1453 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 10 Mar 2011 13:38:46 +0000
parents 88c530c25968
children bf84bcd4e11b
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/event/HasParameterChangeHandler.java flys-client/src/main/java/de/intevation/flys/client/client/event/ParameterChangeEvent.java flys-client/src/main/java/de/intevation/flys/client/client/event/ParameterChangeHandler.java
diffstat 4 files changed, 72 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Thu Mar 10 10:53:41 2011 +0000
+++ b/flys-client/ChangeLog	Thu Mar 10 13:38:46 2011 +0000
@@ -1,3 +1,12 @@
+2011-03-10  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/client/event/HasParameterChangeHandler.java,
+	  src/main/java/de/intevation/flys/client/client/event/ParameterChangeHandler.java,
+	  src/main/java/de/intevation/flys/client/client/event/ParameterChangeEvent.java:
+	  New. Interfaces and classes used for a listener mechanism to notify
+	  listeners when the parameterization of a Collection/Artifact has
+	  changed.
+
 2011-03-10  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/client/services/StepForwardServiceAsync.java,
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/event/HasParameterChangeHandler.java	Thu Mar 10 13:38:46 2011 +0000
@@ -0,0 +1,16 @@
+package de.intevation.flys.client.client.event;
+
+
+/**
+ * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
+ */
+public interface HasParameterChangeHandler {
+
+    /**
+     * Adds a new ParameterChangeHandler.
+     *
+     * @param handler The new ParameterChangeHandler.
+     */
+    public void addParameterChangeHandler(ParameterChangeHandler handler);
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/event/ParameterChangeEvent.java	Thu Mar 10 13:38:46 2011 +0000
@@ -0,0 +1,29 @@
+package de.intevation.flys.client.client.event;
+
+import de.intevation.flys.client.shared.model.Artifact;
+
+
+/**
+ * This events stores references to the old artifact and the new one.
+ *
+ * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
+ */
+public class ParameterChangeEvent {
+
+    protected Artifact oldArtifact;
+    protected Artifact newArtifact;
+
+    public ParameterChangeEvent(Artifact old, Artifact newArt) {
+        oldArtifact = old;
+        newArtifact = newArt;
+    }
+
+    public Artifact getOldValue() {
+        return oldArtifact;
+    }
+
+    public Artifact getNewValue() {
+        return newArtifact;
+    }
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/event/ParameterChangeHandler.java	Thu Mar 10 13:38:46 2011 +0000
@@ -0,0 +1,18 @@
+package de.intevation.flys.client.client.event;
+
+
+/**
+ * Handler interface for ParameterChangeEvent events.
+ *
+ * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
+ */
+public interface ParameterChangeHandler {
+
+    /**
+     * Called when a ParameterChangeEvent is fired.
+     *
+     * @param event The ParameterChangeEvent.
+     */
+    public void onParameterChange(ParameterChangeEvent event);
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org