Mercurial > dive4elements > river
diff flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ManualPointsEditor.java @ 1549:42f1213dfbcc
Let ManualPointEditor use RedrawRequests to let freshly edited points show up in Chart.
flys-client/trunk@3780 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Fri, 27 Jan 2012 09:26:53 +0000 |
parents | e2f74131ffc1 |
children | 9ad19e31d149 |
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ManualPointsEditor.java Fri Jan 27 08:49:16 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ManualPointsEditor.java Fri Jan 27 09:26:53 2012 +0000 @@ -33,8 +33,6 @@ import de.intevation.flys.client.shared.model.CollectionItem; import de.intevation.flys.client.client.utils.DoubleValidator; -import de.intevation.flys.client.client.services.CollectionAttributeService; -import de.intevation.flys.client.client.services.CollectionAttributeServiceAsync; import de.intevation.flys.client.client.services.LoadArtifactService; import de.intevation.flys.client.client.services.LoadArtifactServiceAsync; import de.intevation.flys.client.client.services.FeedService; @@ -45,6 +43,10 @@ import de.intevation.flys.client.shared.model.DefaultData; import de.intevation.flys.client.shared.model.Recommendation; +import de.intevation.flys.client.client.event.RedrawRequestHandler; +import de.intevation.flys.client.client.event.RedrawRequestEvent; +import de.intevation.flys.client.client.event.RedrawRequestEvent.Type; + /** * UI to enter point data and save it to an PointArtifact. @@ -61,8 +63,8 @@ // TODO with separate point sets in multiple diagrams, we might need // different POINT_DATA-names (e.g. one per diagram). - protected CollectionAttributeServiceAsync updater = - GWT.create(CollectionAttributeService.class); + /** When we chaged something, we need a RedrawRequest(Handler). */ + protected RedrawRequestHandler redrawRequestHandler; /** The collection */ protected Collection collection; @@ -86,8 +88,11 @@ * Setup editor dialog. * @param collection The collection to use. */ - public ManualPointsEditor(Collection collection) { + public ManualPointsEditor(Collection collection, + RedrawRequestHandler handler + ) { this.collection = collection; + this.redrawRequestHandler = handler; init(); } @@ -191,11 +196,14 @@ } public void onSuccess(Artifact fartifact) { GWT.log("Successfully set points "); - // TODO refresh view + // TODO refresh collection such that next time + // the new points are shown. //requestRedraw(); //updateCollection(); //updateGrid(); //enable(); + redrawRequestHandler.onRedrawRequest( + new RedrawRequestEvent(Type.DEFAULT)); destroy(); } });