# HG changeset patch # User Raimund Renkert # Date 1318846068 0 # Node ID ceb989d64cd219869bcd8bd3ad489cb4b4cc14e9 # Parent 82c1b76fd854308ae22b1cb7f3d4284618927a36 Request redraw on style attribute change. flys-client/trunk@2981 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 82c1b76fd854 -r ceb989d64cd2 flys-client/ChangeLog --- a/flys-client/ChangeLog Mon Oct 17 09:46:25 2011 +0000 +++ b/flys-client/ChangeLog Mon Oct 17 10:07:48 2011 +0000 @@ -1,3 +1,14 @@ +2011-10-17 Raimund Renkert + + Request redraw on attribute change. + + * src/main/java/de/intevation/flys/client/client/ui/ThemePanel.java: + Made request redraw method public and added method to show editor + window. + + * src/main/java/de/intevation/flys/client/client/ui/StyleEditorWindow.java: + Removed collection view, added theme panel. Request redraw on success. + 2011-10-17 Felix Wolfsteller Cosmetics, docs. diff -r 82c1b76fd854 -r ceb989d64cd2 flys-client/src/main/java/de/intevation/flys/client/client/ui/StyleEditorWindow.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/StyleEditorWindow.java Mon Oct 17 09:46:25 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/StyleEditorWindow.java Mon Oct 17 10:07:48 2011 +0000 @@ -30,7 +30,7 @@ import de.intevation.flys.client.client.services.CollectionItemAttributeServiceAsync; import de.intevation.flys.client.client.services.CollectionItemAttributeService; -import de.intevation.flys.client.client.ui.CollectionView; +import de.intevation.flys.client.client.ui.ThemePanel; import de.intevation.flys.client.client.FLYSConstants; import de.intevation.flys.client.client.Config; @@ -48,8 +48,8 @@ /** The collection. */ protected Collection collection; - /** The parent collection view. */ - protected CollectionView view; + /** The parent ThemePanel. */ + protected ThemePanel panel; /** The attributes. */ protected CollectionItemAttribute attributes; @@ -115,9 +115,8 @@ } - public void setCollectionView (CollectionView view) { - this.view = view; - setParentElement(this.view.getParentElement()); + public void setThemePanel (ThemePanel panel) { + this.panel = panel; } @@ -154,6 +153,7 @@ return properties; } + protected DynamicForm createPropertyUI( String dname, String name, @@ -200,7 +200,6 @@ public void onItemChanged(ItemChangedEvent e) { String name = e.getItem().getName(); String newValue = e.getNewValue().toString(); - GWT.log("changed: " + name); setNewValue(name, newValue); } }); @@ -263,6 +262,7 @@ } public void onSuccess(Void v) { GWT.log("Successfully saved collection item attributes."); + panel.requestRedraw(); } }); diff -r 82c1b76fd854 -r ceb989d64cd2 flys-client/src/main/java/de/intevation/flys/client/client/ui/ThemePanel.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/ThemePanel.java Mon Oct 17 09:46:25 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/ThemePanel.java Mon Oct 17 10:07:48 2011 +0000 @@ -143,7 +143,7 @@ /** * Request a redraw of e.g. a Chart. */ - protected void requestRedraw() { + public void requestRedraw() { for (RedrawRequestHandler handler: redrawRequestHandlers) { handler.onRedrawRequest(new RedrawRequestEvent(Type.RESET)); } @@ -552,14 +552,23 @@ } public void onSuccess(CollectionItemAttribute cia) { GWT.log("Successfully loaded collectionitem attributes."); - StyleEditorWindow win = new StyleEditorWindow( - collection, - cia, - record); - win.setCollectionView(view); - win.show(); + showStyleEditor(cia, record); } }); } + + + protected void showStyleEditor( + CollectionItemAttribute cia, + FacetRecord record) + { + StyleEditorWindow win = new StyleEditorWindow( + collection, + cia, + record); + win.setParentElement(view.getParentElement()); + win.setThemePanel(this); + win.show(); + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :