Mercurial > dive4elements > river
annotate flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartPropertiesEditor.java @ 1500:2a8b5dcbe8ca
Issue 358.
Validate integer and double values in chart properties editor.
flys-client/trunk@3625 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Mon, 09 Jan 2012 09:17:52 +0000 |
parents | cd8a146d29cd |
children | d12cb71965cf |
rev | line source |
---|---|
1429
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.client.client.ui.chart; |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
2 |
1465
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
3 import java.util.List; |
1429
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
4 |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
5 import com.google.gwt.core.client.GWT; |
1478
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
6 import com.google.gwt.user.client.rpc.AsyncCallback; |
1429
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
7 |
1478
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
8 import com.smartgwt.client.util.SC; |
1429
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
9 import com.smartgwt.client.widgets.Window; |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
10 import com.smartgwt.client.widgets.tab.TabSet; |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
11 import com.smartgwt.client.widgets.tab.Tab; |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
12 import com.smartgwt.client.widgets.layout.VLayout; |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
13 import com.smartgwt.client.widgets.layout.HLayout; |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
14 import com.smartgwt.client.widgets.Button; |
1431
987f95ceb623
Added property fields to the chart properties editor dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1429
diff
changeset
|
15 import com.smartgwt.client.widgets.Label; |
1465
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
16 import com.smartgwt.client.widgets.Canvas; |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
17 |
1429
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
18 import com.smartgwt.client.widgets.form.DynamicForm; |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
19 import com.smartgwt.client.widgets.form.fields.FormItem; |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
20 import com.smartgwt.client.widgets.form.fields.CheckboxItem; |
1431
987f95ceb623
Added property fields to the chart properties editor dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1429
diff
changeset
|
21 import com.smartgwt.client.widgets.form.fields.TextItem; |
1429
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
22 |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
23 import com.smartgwt.client.widgets.events.ClickEvent; |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
24 import com.smartgwt.client.widgets.events.ClickHandler; |
1465
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
25 import com.smartgwt.client.widgets.form.fields.events.ChangedHandler; |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
26 import com.smartgwt.client.widgets.form.fields.events.ChangedEvent; |
1500
2a8b5dcbe8ca
Issue 358.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1482
diff
changeset
|
27 |
1429
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
28 import com.smartgwt.client.types.Alignment; |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
29 |
1478
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
30 import de.intevation.flys.client.client.Config; |
1429
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
31 import de.intevation.flys.client.client.FLYSConstants; |
1465
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
32 import de.intevation.flys.client.shared.model.Property; |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
33 import de.intevation.flys.client.shared.model.PropertyGroup; |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
34 import de.intevation.flys.client.shared.model.PropertySetting; |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
35 import de.intevation.flys.client.shared.model.BooleanProperty; |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
36 import de.intevation.flys.client.shared.model.DoubleProperty; |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
37 import de.intevation.flys.client.shared.model.IntegerProperty; |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
38 import de.intevation.flys.client.shared.model.StringProperty; |
1478
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
39 import de.intevation.flys.client.shared.model.OutputSettings; |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
40 import de.intevation.flys.client.shared.model.Collection; |
1500
2a8b5dcbe8ca
Issue 358.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1482
diff
changeset
|
41 import de.intevation.flys.client.client.utils.Validator; |
1429
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
42 |
1478
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
43 import de.intevation.flys.client.client.services.CollectionAttributeService; |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
44 import de.intevation.flys.client.client.services.CollectionAttributeServiceAsync; |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
45 |
1429
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
46 /** |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
47 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
48 */ |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
49 public class ChartPropertiesEditor |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
50 extends Window |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
51 implements ClickHandler |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
52 { |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
53 /** The interface that provides i18n messages. */ |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
54 protected FLYSConstants MSG = GWT.create(FLYSConstants.class); |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
55 |
1478
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
56 protected CollectionAttributeServiceAsync updater = |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
57 GWT.create(CollectionAttributeService.class); |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
58 |
1429
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
59 /** The tab called the editor window. */ |
1482
cd8a146d29cd
Update chart if properties are changed successfully.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1478
diff
changeset
|
60 protected ChartOutputTab tab; |
1429
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
61 |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
62 /** The tabset for chart properties */ |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
63 protected TabSet tabs; |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
64 |
1478
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
65 /** The collection */ |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
66 protected Collection collection; |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
67 |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
68 /** The output settings */ |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
69 protected OutputSettings settings; |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
70 |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
71 |
1429
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
72 /** |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
73 * Setup editor dialog. |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
74 * @param callerTab The tab called the editor window. |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
75 */ |
1482
cd8a146d29cd
Update chart if properties are changed successfully.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1478
diff
changeset
|
76 public ChartPropertiesEditor(ChartOutputTab callerTab) { |
1429
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
77 this.tab = callerTab; |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
78 this.tabs = new TabSet(); |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
79 |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
80 init(); |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
81 } |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
82 |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
83 /** |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
84 * Initialize the editor window and its components. |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
85 */ |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
86 protected void init() { |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
87 setTitle(MSG.properties()); |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
88 setCanDragReposition(true); |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
89 setCanDragResize(true); |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
90 |
1500
2a8b5dcbe8ca
Issue 358.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1482
diff
changeset
|
91 Config config = Config.getInstance(); |
1478
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
92 collection = tab.getCollectionView().getCollection(); |
1465
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
93 String outputName = tab.getOutputName(); |
1478
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
94 settings = (OutputSettings)collection.getSettings(outputName); |
1465
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
95 |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
96 if (settings == null) { |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
97 return; |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
98 } |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
99 List<String> list = settings.getCategories(); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
100 |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
101 for (int i = 0; i < list.size(); i++) { |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
102 Tab t = new Tab(MSG.getString(list.get(i))); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
103 List<Property> props = settings.getSettings(list.get(i)); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
104 VLayout layout = new VLayout(); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
105 for (int j = 0; j < props.size(); j++) { |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
106 if (props.get(j) instanceof PropertyGroup) { |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
107 layout.addMember(generatePropertyGroup(props.get(j))); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
108 } |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
109 else if (props.get(j) instanceof PropertySetting) { |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
110 PropertySetting p = (PropertySetting)props.get(j); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
111 if (p.getAttribute("display").equals("false")) { |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
112 continue; |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
113 } |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
114 layout.addMember(generatePropertySetting(props.get(j))); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
115 } |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
116 } |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
117 t.setPane(layout); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
118 tabs.addTab(t); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
119 } |
1429
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
120 |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
121 Button accept = new Button(MSG.label_ok()); |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
122 Button cancel = new Button(MSG.label_cancel()); |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
123 cancel.addClickHandler(this); |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
124 accept.addClickHandler(new ClickHandler() { |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
125 public void onClick(ClickEvent e) { |
1478
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
126 updateCollection(); |
1429
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
127 } |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
128 }); |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
129 |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
130 HLayout buttons = new HLayout(); |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
131 buttons.addMember(accept); |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
132 buttons.addMember(cancel); |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
133 buttons.setAlign(Alignment.CENTER); |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
134 buttons.setHeight(30); |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
135 |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
136 addItem(tabs); |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
137 addItem(buttons); |
1500
2a8b5dcbe8ca
Issue 358.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1482
diff
changeset
|
138 setWidth(380); |
1431
987f95ceb623
Added property fields to the chart properties editor dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1429
diff
changeset
|
139 setHeight(470); |
1429
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
140 centerInPage(); |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
141 } |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
142 |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
143 /** |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
144 * This method is called when the user aborts theming. |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
145 * @param event The event. |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
146 */ |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
147 public void onClick(ClickEvent event) { |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
148 this.hide(); |
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
149 } |
1431
987f95ceb623
Added property fields to the chart properties editor dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1429
diff
changeset
|
150 |
987f95ceb623
Added property fields to the chart properties editor dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1429
diff
changeset
|
151 |
987f95ceb623
Added property fields to the chart properties editor dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1429
diff
changeset
|
152 /** |
1465
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
153 * |
1431
987f95ceb623
Added property fields to the chart properties editor dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1429
diff
changeset
|
154 */ |
1465
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
155 protected Canvas generatePropertyGroup(Property group) { |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
156 PropertyGroup pg = (PropertyGroup)group; |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
157 List<Property> list = pg.getProperties(); |
1431
987f95ceb623
Added property fields to the chart properties editor dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1429
diff
changeset
|
158 |
1465
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
159 if (pg.getName().equals("axis")) { |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
160 Label scale = new Label(MSG.scale() + " :"); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
161 scale.setHeight(25); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
162 scale.setMargin(2); |
1431
987f95ceb623
Added property fields to the chart properties editor dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1429
diff
changeset
|
163 |
1465
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
164 DynamicForm form1 = new DynamicForm(); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
165 DynamicForm form2 = new DynamicForm(); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
166 form2.setNumCols(6); |
1431
987f95ceb623
Added property fields to the chart properties editor dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1429
diff
changeset
|
167 |
1465
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
168 StringProperty label = |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
169 (StringProperty)pg.getPropertyByName("label"); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
170 FormItem title = createStringProperty(label); |
1431
987f95ceb623
Added property fields to the chart properties editor dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1429
diff
changeset
|
171 |
1465
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
172 IntegerProperty fontsize = |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
173 (IntegerProperty)pg.getPropertyByName("font-size"); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
174 FormItem fs = createIntegerProperty(fontsize); |
1500
2a8b5dcbe8ca
Issue 358.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1482
diff
changeset
|
175 fs.setAttribute("internalType", "integer"); |
2a8b5dcbe8ca
Issue 358.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1482
diff
changeset
|
176 fs.addChangedHandler(new Validator()); |
1465
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
177 |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
178 DoubleProperty upper = |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
179 (DoubleProperty)pg.getPropertyByName("upper"); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
180 final FormItem range1 = createDoubleProperty(upper); |
1500
2a8b5dcbe8ca
Issue 358.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1482
diff
changeset
|
181 range1.setAttribute("internalType", "double"); |
2a8b5dcbe8ca
Issue 358.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1482
diff
changeset
|
182 range1.addChangedHandler(new Validator()); |
2a8b5dcbe8ca
Issue 358.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1482
diff
changeset
|
183 range1.setWidth(70); |
1465
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
184 |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
185 DoubleProperty lower = |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
186 (DoubleProperty)pg.getPropertyByName("lower"); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
187 final FormItem range2 = createDoubleProperty(lower); |
1500
2a8b5dcbe8ca
Issue 358.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1482
diff
changeset
|
188 range2.setAttribute("internalType", "double"); |
2a8b5dcbe8ca
Issue 358.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1482
diff
changeset
|
189 range2.addChangedHandler(new Validator()); |
2a8b5dcbe8ca
Issue 358.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1482
diff
changeset
|
190 range2.setWidth(70); |
1465
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
191 |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
192 BooleanProperty fixation = |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
193 (BooleanProperty)pg.getPropertyByName("fixation"); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
194 FormItem fix = createBooleanProperty(fixation); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
195 fix.addChangedHandler(new ChangedHandler() { |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
196 public void onChanged(ChangedEvent e) { |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
197 if ((Boolean)e.getValue()) { |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
198 range1.enable(); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
199 range2.enable(); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
200 } |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
201 else { |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
202 range1.disable(); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
203 range2.disable(); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
204 } |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
205 } |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
206 }); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
207 if (fixation.getValue().equals("true")) { |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
208 range1.enable(); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
209 range2.enable(); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
210 } |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
211 else { |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
212 range1.disable(); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
213 range2.disable(); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
214 } |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
215 |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
216 form1.setFields(title, fs); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
217 form2.setFields(fix, range1, range2); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
218 |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
219 HLayout scaleLayout = new HLayout(); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
220 scaleLayout.setHeight(30); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
221 scaleLayout.addMember(scale); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
222 scaleLayout.addMember(form2); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
223 scaleLayout.addStyleName("property-dialog-axis"); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
224 |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
225 VLayout root = new VLayout(); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
226 root.addMember(form1); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
227 root.addMember(scaleLayout); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
228 root.setHeight(90); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
229 |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
230 return root; |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
231 } |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
232 return null; |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
233 } |
1431
987f95ceb623
Added property fields to the chart properties editor dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1429
diff
changeset
|
234 |
987f95ceb623
Added property fields to the chart properties editor dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1429
diff
changeset
|
235 |
1465
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
236 /** |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
237 * |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
238 */ |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
239 protected DynamicForm generatePropertySetting(Property setting) { |
1500
2a8b5dcbe8ca
Issue 358.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1482
diff
changeset
|
240 PropertySetting s = (PropertySetting)setting; |
1465
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
241 DynamicForm form = new DynamicForm(); |
1478
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
242 FormItem item = new FormItem(); |
1465
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
243 if (setting instanceof BooleanProperty) { |
1478
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
244 item = createBooleanProperty((BooleanProperty)setting); |
1465
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
245 } |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
246 else if (setting instanceof DoubleProperty) { |
1478
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
247 item = createDoubleProperty((DoubleProperty)setting); |
1500
2a8b5dcbe8ca
Issue 358.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1482
diff
changeset
|
248 item.setAttribute("internalType", "double"); |
2a8b5dcbe8ca
Issue 358.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1482
diff
changeset
|
249 item.addChangedHandler(new Validator()); |
1465
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
250 } |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
251 else if (setting instanceof IntegerProperty) { |
1478
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
252 item = createIntegerProperty((IntegerProperty)setting); |
1500
2a8b5dcbe8ca
Issue 358.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1482
diff
changeset
|
253 item.setAttribute("internalType", "integer"); |
2a8b5dcbe8ca
Issue 358.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1482
diff
changeset
|
254 item.addChangedHandler(new Validator()); |
1465
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
255 } |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
256 else if (setting instanceof StringProperty) { |
1478
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
257 item = createStringProperty((StringProperty)setting); |
1465
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
258 } |
1478
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
259 form.setFields(item); |
1465
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
260 return form; |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
261 } |
1431
987f95ceb623
Added property fields to the chart properties editor dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1429
diff
changeset
|
262 |
987f95ceb623
Added property fields to the chart properties editor dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1429
diff
changeset
|
263 |
1465
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
264 /** |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
265 * |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
266 */ |
1478
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
267 protected FormItem createStringProperty(final StringProperty sp) { |
1465
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
268 String name = sp.getName(); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
269 if (name.contains("-")) { |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
270 name = name.replace("-", "_"); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
271 } |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
272 TextItem item = new TextItem(); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
273 item.setTitle(MSG.getString(name)); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
274 item.setTitleAlign(Alignment.LEFT); |
1478
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
275 item.setValue(sp.getValue()); |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
276 item.addChangedHandler(new ChangedHandler() { |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
277 public void onChanged(ChangedEvent e) { |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
278 String val; |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
279 if (e.getValue() == null) { |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
280 val = ""; |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
281 } |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
282 else { |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
283 val = e.getValue().toString(); |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
284 } |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
285 sp.setValue(val); |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
286 } |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
287 }); |
1465
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
288 return item; |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
289 } |
1431
987f95ceb623
Added property fields to the chart properties editor dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1429
diff
changeset
|
290 |
987f95ceb623
Added property fields to the chart properties editor dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1429
diff
changeset
|
291 |
1465
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
292 /** |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
293 * |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
294 */ |
1478
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
295 protected FormItem createBooleanProperty(final BooleanProperty bp) { |
1465
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
296 String name = bp.getName(); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
297 if (name.contains("-")) { |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
298 name = name.replace("-", "_"); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
299 } |
1431
987f95ceb623
Added property fields to the chart properties editor dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1429
diff
changeset
|
300 |
1465
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
301 CheckboxItem item = new CheckboxItem("item", MSG.getString(name)); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
302 item.setLabelAsTitle(true); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
303 item.setTitleStyle("color:#000;"); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
304 item.setTitleAlign(Alignment.LEFT); |
1478
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
305 if(bp.getValue().equals("true")) { |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
306 item.setValue(true); |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
307 } |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
308 else { |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
309 item.setValue(false); |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
310 } |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
311 item.addChangedHandler(new ChangedHandler() { |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
312 public void onChanged(ChangedEvent e) { |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
313 String val; |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
314 if (e.getValue() == null) { |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
315 val = ""; |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
316 } |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
317 else { |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
318 val = e.getValue().toString(); |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
319 } |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
320 bp.setValue(val); |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
321 } |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
322 }); |
1465
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
323 return item; |
1431
987f95ceb623
Added property fields to the chart properties editor dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1429
diff
changeset
|
324 } |
987f95ceb623
Added property fields to the chart properties editor dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1429
diff
changeset
|
325 |
1465
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
326 |
1431
987f95ceb623
Added property fields to the chart properties editor dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1429
diff
changeset
|
327 /** |
1465
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
328 * |
1431
987f95ceb623
Added property fields to the chart properties editor dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1429
diff
changeset
|
329 */ |
1478
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
330 protected FormItem createDoubleProperty(final DoubleProperty dp) { |
1465
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
331 String name = dp.getName(); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
332 if (name.contains("-")) { |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
333 name = name.replace("-", "_"); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
334 } |
1431
987f95ceb623
Added property fields to the chart properties editor dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1429
diff
changeset
|
335 |
1465
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
336 TextItem item = new TextItem(); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
337 item.setTitle(MSG.getString(name)); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
338 item.setTitleAlign(Alignment.LEFT); |
1478
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
339 item.setValue(dp.getValue()); |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
340 item.addChangedHandler(new ChangedHandler() { |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
341 public void onChanged(ChangedEvent e) { |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
342 String val; |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
343 if (e.getValue() == null) { |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
344 val = ""; |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
345 } |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
346 else { |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
347 val = e.getValue().toString(); |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
348 } |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
349 dp.setValue(val); |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
350 } |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
351 }); |
1465
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
352 return item; |
1431
987f95ceb623
Added property fields to the chart properties editor dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1429
diff
changeset
|
353 } |
987f95ceb623
Added property fields to the chart properties editor dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1429
diff
changeset
|
354 |
1465
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
355 |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
356 /** |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
357 * |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
358 */ |
1478
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
359 protected FormItem createIntegerProperty(final IntegerProperty ip) { |
1465
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
360 String name = ip.getName(); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
361 if (name.contains("-")) { |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
362 name = name.replace("-", "_"); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
363 } |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
364 |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
365 TextItem item = new TextItem(); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
366 item.setTitle(MSG.getString(name)); |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
367 item.setTitleAlign(Alignment.LEFT); |
1478
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
368 item.setValue(ip.getValue()); |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
369 item.addChangedHandler(new ChangedHandler() { |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
370 public void onChanged(ChangedEvent e) { |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
371 String val; |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
372 if (e.getValue() == null) { |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
373 val = ""; |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
374 } |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
375 else { |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
376 val = e.getValue().toString(); |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
377 } |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
378 ip.setValue(val); |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
379 } |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
380 }); |
1465
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
381 return item; |
d0bcf5ba7adf
Create the properties dialog content dynamically based on the properties read
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1449
diff
changeset
|
382 } |
1478
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
383 |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
384 |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
385 protected void updateCollection() { |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
386 final Config config = Config.getInstance(); |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
387 final String loc = config.getLocale(); |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
388 |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
389 GWT.log("PropertiesEditor.updateCollection via RPC now"); |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
390 |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
391 updater.update(collection, loc, new AsyncCallback<Collection>() { |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
392 public void onFailure(Throwable caught) { |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
393 GWT.log("Could not update collection attributes."); |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
394 SC.warn(MSG.getString(caught.getMessage())); |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
395 } |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
396 public void onSuccess(Collection collection) { |
1482
cd8a146d29cd
Update chart if properties are changed successfully.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1478
diff
changeset
|
397 updateChartTab(); |
1478
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
398 } |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
399 }); |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
400 } |
237e7450ae2e
Save output settings in chart properties dialog.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1465
diff
changeset
|
401 |
1482
cd8a146d29cd
Update chart if properties are changed successfully.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1478
diff
changeset
|
402 protected void updateChartTab() { |
cd8a146d29cd
Update chart if properties are changed successfully.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1478
diff
changeset
|
403 this.hide(); |
cd8a146d29cd
Update chart if properties are changed successfully.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1478
diff
changeset
|
404 this.tab.updateChartInfo(); |
cd8a146d29cd
Update chart if properties are changed successfully.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1478
diff
changeset
|
405 this.tab.updateChartPanel(); |
cd8a146d29cd
Update chart if properties are changed successfully.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1478
diff
changeset
|
406 } |
1429
16b7adc66330
Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
407 } |