comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/StyleEditorWindow.java @ 1336:ceb989d64cd2

Request redraw on style attribute change. flys-client/trunk@2981 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Raimund Renkert <raimund.renkert@intevation.de>
date Mon, 17 Oct 2011 10:07:48 +0000
parents 1627a28c4504
children 9bf72f84728d
comparison
equal deleted inserted replaced
1335:82c1b76fd854 1336:ceb989d64cd2
28 import de.intevation.flys.client.shared.model.FacetRecord; 28 import de.intevation.flys.client.shared.model.FacetRecord;
29 import de.intevation.flys.client.shared.model.Theme; 29 import de.intevation.flys.client.shared.model.Theme;
30 30
31 import de.intevation.flys.client.client.services.CollectionItemAttributeServiceAsync; 31 import de.intevation.flys.client.client.services.CollectionItemAttributeServiceAsync;
32 import de.intevation.flys.client.client.services.CollectionItemAttributeService; 32 import de.intevation.flys.client.client.services.CollectionItemAttributeService;
33 import de.intevation.flys.client.client.ui.CollectionView; 33 import de.intevation.flys.client.client.ui.ThemePanel;
34 34
35 import de.intevation.flys.client.client.FLYSConstants; 35 import de.intevation.flys.client.client.FLYSConstants;
36 import de.intevation.flys.client.client.Config; 36 import de.intevation.flys.client.client.Config;
37 37
38 /** 38 /**
46 protected FLYSConstants MSG = GWT.create(FLYSConstants.class); 46 protected FLYSConstants MSG = GWT.create(FLYSConstants.class);
47 47
48 /** The collection. */ 48 /** The collection. */
49 protected Collection collection; 49 protected Collection collection;
50 50
51 /** The parent collection view. */ 51 /** The parent ThemePanel. */
52 protected CollectionView view; 52 protected ThemePanel panel;
53 53
54 /** The attributes. */ 54 /** The attributes. */
55 protected CollectionItemAttribute attributes; 55 protected CollectionItemAttribute attributes;
56 56
57 /** The selected facet. */ 57 /** The selected facet. */
113 layout.addMember(buttons); 113 layout.addMember(buttons);
114 addItem(layout); 114 addItem(layout);
115 } 115 }
116 116
117 117
118 public void setCollectionView (CollectionView view) { 118 public void setThemePanel (ThemePanel panel) {
119 this.view = view; 119 this.panel = panel;
120 setParentElement(this.view.getParentElement());
121 } 120 }
122 121
123 122
124 public void onClick(ClickEvent event) { 123 public void onClick(ClickEvent event) {
125 this.hide(); 124 this.hide();
152 properties.addMember(property); 151 properties.addMember(property);
153 } 152 }
154 return properties; 153 return properties;
155 } 154 }
156 155
156
157 protected DynamicForm createPropertyUI( 157 protected DynamicForm createPropertyUI(
158 String dname, 158 String dname,
159 String name, 159 String name,
160 String type, 160 String type,
161 String value) 161 String value)
198 df.setFields(f); 198 df.setFields(f);
199 df.addItemChangedHandler(new ItemChangedHandler() { 199 df.addItemChangedHandler(new ItemChangedHandler() {
200 public void onItemChanged(ItemChangedEvent e) { 200 public void onItemChanged(ItemChangedEvent e) {
201 String name = e.getItem().getName(); 201 String name = e.getItem().getName();
202 String newValue = e.getNewValue().toString(); 202 String newValue = e.getNewValue().toString();
203 GWT.log("changed: " + name);
204 setNewValue(name, newValue); 203 setNewValue(name, newValue);
205 } 204 }
206 }); 205 });
207 206
208 return df; 207 return df;
261 public void onFailure (Throwable caught) { 260 public void onFailure (Throwable caught) {
262 GWT.log("Could not set Collection item attributes."); 261 GWT.log("Could not set Collection item attributes.");
263 } 262 }
264 public void onSuccess(Void v) { 263 public void onSuccess(Void v) {
265 GWT.log("Successfully saved collection item attributes."); 264 GWT.log("Successfully saved collection item attributes.");
265 panel.requestRedraw();
266 } 266 }
267 }); 267 });
268 268
269 269
270 this.hide(); 270 this.hide();

http://dive4elements.wald.intevation.org