changeset 49:d573ae975330

Some refactoring (imports, etc). flys-client/trunk@1497 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 17 Mar 2011 11:39:27 +0000
parents 6e191588a295
children 827eb4e06ebf
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java flys-client/src/main/java/de/intevation/flys/client/client/ui/LocationDistancePanel.java flys-client/src/main/java/de/intevation/flys/client/client/ui/MapSelection.java flys-client/src/main/java/de/intevation/flys/client/client/ui/SelectProvider.java flys-client/src/main/java/de/intevation/flys/client/server/UserServiceImpl.java flys-client/src/main/java/de/intevation/flys/client/shared/model/Data.java flys-client/src/main/java/de/intevation/flys/client/shared/model/DefaultData.java
diffstat 8 files changed, 17 insertions(+), 60 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Thu Mar 17 11:23:07 2011 +0000
+++ b/flys-client/ChangeLog	Thu Mar 17 11:39:27 2011 +0000
@@ -1,3 +1,18 @@
+2011-03-17  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/server/UserServiceImpl.java,
+	  src/main/java/de/intevation/flys/client/shared/model/Data.java,
+	  src/main/java/de/intevation/flys/client/shared/model/DefaultData.java,
+	  src/main/java/de/intevation/flys/client/client/ui/LocationDistancePanel.java,
+	  src/main/java/de/intevation/flys/client/client/ui/MapSelection.java,
+	  src/main/java/de/intevation/flys/client/client/ui/CollectionView.java:
+	  Removed needless imported.
+
+	* src/main/java/de/intevation/flys/client/client/ui/SelectProvider.java:
+	  The SelectProvider extends the AbstractUIProvider now. Now, each
+	  concrete UIProvider is an instance of the AbstractUIProvider that
+	  handles some basic events.
+
 2011-03-17  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/client/ui/WQInputPanel.java:
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java	Thu Mar 17 11:23:07 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java	Thu Mar 17 11:39:27 2011 +0000
@@ -331,7 +331,6 @@
      */
     public void onParameterChange(ParameterChangeEvent event) {
 
-        // TODO IMPLEMENT ME
         updateView();
     }
 
@@ -362,7 +361,6 @@
      */
     public void onStepForward(StepForwardEvent event) {
         GWT.log("CollectionView - onStepForward()");
-        GWT.log("TODO: IMPLEMENT FEED!");
         String serverUrl = Config.getInstance().getServerUrl();
 
         forwardService.go(serverUrl, artifact, event.getData(),
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/LocationDistancePanel.java	Thu Mar 17 11:23:07 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/LocationDistancePanel.java	Thu Mar 17 11:39:27 2011 +0000
@@ -1,12 +1,9 @@
 package de.intevation.flys.client.client.ui;
 
 import java.util.LinkedHashMap;
-import java.util.Map;
 
 import com.google.gwt.core.client.GWT;
-import com.google.gwt.i18n.client.NumberFormat;
 
-import com.smartgwt.client.types.TitleOrientation;
 import com.smartgwt.client.widgets.Canvas;
 import com.smartgwt.client.widgets.IButton;
 import com.smartgwt.client.widgets.Label;
@@ -16,9 +13,7 @@
 import com.smartgwt.client.widgets.form.fields.events.ChangeHandler;
 import com.smartgwt.client.widgets.form.fields.events.ChangeEvent;
 import com.smartgwt.client.widgets.form.fields.FormItem;
-import com.smartgwt.client.widgets.form.fields.FloatItem;
 import com.smartgwt.client.widgets.form.fields.RadioGroupItem;
-import com.smartgwt.client.widgets.form.fields.TextItem;
 import com.smartgwt.client.widgets.layout.HLayout;
 import com.smartgwt.client.widgets.layout.VLayout;
 
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/MapSelection.java	Thu Mar 17 11:23:07 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/MapSelection.java	Thu Mar 17 11:39:27 2011 +0000
@@ -6,7 +6,6 @@
 import com.smartgwt.client.types.VerticalAlignment;
 import com.smartgwt.client.widgets.Canvas;
 import com.smartgwt.client.widgets.Img;
-import com.smartgwt.client.widgets.Label;
 import com.smartgwt.client.widgets.layout.HLayout;
 
 import de.intevation.flys.client.shared.model.Data;
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/SelectProvider.java	Thu Mar 17 11:23:07 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/SelectProvider.java	Thu Mar 17 11:39:27 2011 +0000
@@ -1,8 +1,6 @@
 package de.intevation.flys.client.client.ui;
 
-import java.util.ArrayList;
 import java.util.LinkedHashMap;
-import java.util.List;
 
 import com.google.gwt.core.client.GWT;
 
@@ -10,8 +8,6 @@
 import com.smartgwt.client.widgets.Canvas;
 import com.smartgwt.client.widgets.IButton;
 import com.smartgwt.client.widgets.Label;
-import com.smartgwt.client.widgets.events.ClickEvent;
-import com.smartgwt.client.widgets.events.ClickHandler;
 import com.smartgwt.client.widgets.form.DynamicForm;
 import com.smartgwt.client.widgets.form.fields.ComboBoxItem;
 import com.smartgwt.client.widgets.layout.HLayout;
@@ -23,9 +19,6 @@
 import de.intevation.flys.client.shared.model.DefaultDataItem;
 
 import de.intevation.flys.client.client.FLYSMessages;
-import de.intevation.flys.client.client.event.HasStepForwardHandlers;
-import de.intevation.flys.client.client.event.StepForwardEvent;
-import de.intevation.flys.client.client.event.StepForwardHandler;
 
 
 /**
@@ -33,15 +26,12 @@
  *
  * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
  */
-public class SelectProvider implements UIProvider, HasStepForwardHandlers,
-                                       ClickHandler
+public class SelectProvider
+extends      AbstractUIProvider
 {
     /** The message class that provides i18n strings.*/
     protected FLYSMessages messages = GWT.create(FLYSMessages.class);
 
-    /** The StepForwardHandlers.*/
-    protected List<StepForwardHandler> forwardHandlers;
-
     /** The combobox.*/
     protected ComboBoxItem combobox;
 
@@ -50,40 +40,6 @@
 
 
     /**
-     * Creates a new UIProvider instance of this class.
-     */
-    public SelectProvider() {
-        forwardHandlers = new ArrayList<StepForwardHandler>();
-    }
-
-
-    public void addStepForwardHandler(StepForwardHandler handler) {
-        if (handler != null) {
-            forwardHandlers.add(handler);
-        }
-    }
-
-
-    /**
-     * This method is called after the user has clicked on the 'next' button to
-     * step to the next state.
-     *
-     * @param e The StepForwardEvent.
-     */
-    protected void fireStepForwardEvent(StepForwardEvent e) {
-        GWT.log("SelectProvider - fireStepForwardEvent() handlers: " + forwardHandlers.size());
-        for (StepForwardHandler handler: forwardHandlers) {
-            handler.onStepForward(e);
-        }
-    }
-
-    public void onClick(ClickEvent e) {
-        Data[] data = getData();
-
-        SelectProvider.this.fireStepForwardEvent(new StepForwardEvent(data));
-    }
-
-    /**
      * This method currently returns a
      * {@link com.smartgwt.client.widgets.form.DynamicForm} that contains all
      * data items in a combobox stored in <i>data</i>.
--- a/flys-client/src/main/java/de/intevation/flys/client/server/UserServiceImpl.java	Thu Mar 17 11:23:07 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/server/UserServiceImpl.java	Thu Mar 17 11:39:27 2011 +0000
@@ -8,15 +8,12 @@
 
 import com.google.gwt.user.server.rpc.RemoteServiceServlet;
 
-import com.google.gwt.core.client.GWT;
-
 import de.intevation.artifacts.common.ArtifactNamespaceContext;
 import de.intevation.artifacts.common.utils.XMLUtils;
 
 import de.intevation.artifacts.httpclient.exceptions.ConnectionException;
 import de.intevation.artifacts.httpclient.http.HttpClient;
 import de.intevation.artifacts.httpclient.http.HttpClientImpl;
-import de.intevation.artifacts.httpclient.http.response.DocumentResponseHandler;
 
 import de.intevation.flys.client.client.services.UserService;
 import de.intevation.flys.client.shared.model.DefaultUser;
--- a/flys-client/src/main/java/de/intevation/flys/client/shared/model/Data.java	Thu Mar 17 11:23:07 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/Data.java	Thu Mar 17 11:39:27 2011 +0000
@@ -1,7 +1,6 @@
 package de.intevation.flys.client.shared.model;
 
 import java.io.Serializable;
-import de.intevation.flys.client.client.ui.UIProvider;
 
 
 /**
--- a/flys-client/src/main/java/de/intevation/flys/client/shared/model/DefaultData.java	Thu Mar 17 11:23:07 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/DefaultData.java	Thu Mar 17 11:39:27 2011 +0000
@@ -1,7 +1,5 @@
 package de.intevation.flys.client.shared.model;
 
-import de.intevation.flys.client.client.ui.UIProvider;
-
 
 /**
  * The default implementation of a {@link Data} item. This class just implements

http://dive4elements.wald.intevation.org