diff gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WaterlevelRecommendationInfo.java @ 9220:e3c2ae1887e8

Allow to filter contents of datacage on client side. Allow to override column label of datacage Some code cleanup
author gernotbelger
date Wed, 04 Jul 2018 12:00:51 +0200
parents 8d1df8639563
children
line wrap: on
line diff
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WaterlevelRecommendationInfo.java	Wed Jul 04 10:46:37 2018 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WaterlevelRecommendationInfo.java	Wed Jul 04 12:00:51 2018 +0200
@@ -1,6 +1,6 @@
 /** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde
- * Software engineering by 
- *  Björnsen Beratende Ingenieure GmbH 
+ * Software engineering by
+ *  Björnsen Beratende Ingenieure GmbH
  *  Dr. Schumacher Ingenieurbüro für Wasser und Umwelt
  *
  * This file is Free Software under the GNU AGPL (>=v3)
@@ -16,42 +16,42 @@
 
 /**
  * Factored out code from the old WaterlevelTwinPanel; contains some evil hacks about the involved artifact factories. See original comments below...
- * 
+ *
  * @author Gernot Belger
  */
 public final class WaterlevelRecommendationInfo implements IDatacageTwinPanelInfo {
 
-	private final String outs;
-	
+    private final String outs;
+
     /**
      * @param tweakFactory See evil hack below
      */
-	public WaterlevelRecommendationInfo(final String outs) {
-		this.outs = outs;
-	}
-	
-	@Override
-	public String getFactory(final String originalFactory) {
-		// FIXME: why are the factory here and the one used in createDataString different?
-		// Probably also because of the 'throw all this code away comment'
-		return "waterlevel";
-	}
-	
-	@Override
-	public String getDataStringFactory(final Recommendation recommendation) {
-		return "staticwkms";
-	}
-	
+    public WaterlevelRecommendationInfo(final String outs) {
+        this.outs = outs;
+    }
+
     @Override
-	public void adjustRecommendation(final Recommendation recommendation) {
-        
+    public String getFactory(final String originalFactory) {
+        // FIXME: why are the factory here and the one used in createDataString different?
+        // Probably also because of the 'throw all this code away comment'
+        return "waterlevel";
+    }
+
+    @Override
+    public String getDataStringFactory(final Recommendation recommendation) {
+        return "staticwkms";
+    }
+
+    @Override
+    public void adjustRecommendation(final Recommendation recommendation) {
+
         // XXX: THIS IS AN EVIL HACK TO MAKE W-DIFFERENCES WORK AGAIN!
         // TODO: Throw all this code away and do it with server side recommendations!
         recommendation.setTargetOut("w_differences");
 
         if (recommendation.getIDs() != null) {
             GWT.log("Setting staticwkms factory for rec with ID "
-                + recommendation.getIDs());
+                    + recommendation.getIDs());
             recommendation.setFactory("staticwkms");
         }
         /*
@@ -61,15 +61,20 @@
             GWT.log("Setting waterlevel factory for a winfo rec.");
             recommendation.setFactory("waterlevel");
         }
-        */
+         */
         else {
-           GWT.log("Leave rec. id " + recommendation.getIDs() + ", factory "
-               + recommendation.getFactory() + " untouched.");
+            GWT.log("Leave rec. id " + recommendation.getIDs() + ", factory "
+                    + recommendation.getFactory() + " untouched.");
         }
     }
 
-	@Override
-	public String getOuts() {
-		return this.outs;
-	}
+    @Override
+    public String getOuts() {
+        return this.outs;
+    }
+
+    @Override
+    public String getColumnLabel() {
+        return null;
+    }
 }
\ No newline at end of file

http://dive4elements.wald.intevation.org