Mercurial > dive4elements > river
diff gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WaterlevelRecommendationInfo.java @ 8875:8d1df8639563
Fixed: strange tweak in w-diferences panel always returned staticwkms factory instead of the original one. In sinfo we need the original one though.
author | gernotbelger |
---|---|
date | Thu, 08 Feb 2018 18:46:34 +0100 |
parents | fa168fb02a65 |
children | e3c2ae1887e8 |
line wrap: on
line diff
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WaterlevelRecommendationInfo.java Wed Feb 07 18:04:53 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WaterlevelRecommendationInfo.java Thu Feb 08 18:46:34 2018 +0100 @@ -15,30 +15,36 @@ import com.google.gwt.core.client.GWT; /** + * 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 String outs; - - public WaterlevelRecommendationInfo(String outs ) { + private final String outs; + + /** + * @param tweakFactory See evil hack below + */ + public WaterlevelRecommendationInfo(final String outs) { this.outs = outs; } @Override - public String getFactory() { + 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() { + public String getDataStringFactory(final Recommendation recommendation) { return "staticwkms"; } @Override - public void adjustRecommendation(Recommendation recommendation) { + 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"); @@ -64,6 +70,6 @@ @Override public String getOuts() { - return outs; + return this.outs; } } \ No newline at end of file