Dit is precies waar een project, waar ik nu aan werk, mee bezig is. Wij genereren op basis van XML een java - file, die de userinterface beschrijft. Je codebehind extend deze klasse en kan dus de events afvangen, die je gespecificieerd hebt in je XML file.
Onze website is nog niet je van het, maar wil je een werkend voorbeeld zien, laat het dan even weten!
Voor broncode etc. zie
http://www.sourceforge.net/projects/atlantissoft
[edit]
Ik heb even ons framework neergezet met een werkende applicatie, voor het transformeren van xml bestanden met xsl bestanden.
Het framework is binnen te halen vanaf:
XADF. Uitvoeren met bin/run.bat en daarna bestand -> openen... applications/TransformationValidator.deploy.
[edit2]
Ik hoor net van een collega, dat de batch file verwijst naar het bestand c:/appl/xadf/applications/cleito.deploy. Mocht je de XADF directory dus ergens anders uitpakken, moet je de run.bat even aanpassen naar deze nieuwe directory.
[edit3]
Na het topic nog even goed doorgekeken te hebben, lijkt mijn bericht best op spam. Om toch nog even de overeenkomst met het probleem van de TS te geven, hier een stukje XML wat we gebruiken om Java te genereren:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
| <?xml version="1.0" encoding="UTF-8"?>
<guiml version="1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.atlantissoftware.org/schemas/guiml.xsd">
<view>
<complexwidget id="canvas" type="Canvas">
<properties>
<property name="size">
<param>875</param>
<param>365</param>
</property>
<property name="layout">
<param>null</param>
</property>
</properties>
<complexwidget id="selectactionscanvas" type="Canvas">
<properties>
<property name="layout">
<param>null</param>
</property>
<property name="size">
<param>875</param>
<param>365</param>
</property>
</properties>
<widget id="selectactionlabel" type="Label">
<properties>
<property name="font">
<param type="Font">
<param>"Dialog"</param>
<param>Font.PLAIN</param>
<param>30</param>
</param>
</property>
<property name="text">
<param>"Step 1 of 3: Select Actions"</param>
</property>
<property name="size">
<param>400</param>
<param>40</param>
</property>
</properties>
</widget>
<widget id="inputschemacheckbox" type="CheckBox">
<properties>
<property name="text">
<param>"Use input validation"</param>
</property>
<property name="bounds">
<param>40</param>
<param>40</param>
<param>875</param>
<param>40</param>
</property>
</properties>
</widget>
<widget id="inputschemalabel" type="Label">
<properties>
<property name="text">
<param>"Before transformation schema:"</param>
</property>
<property name="bounds">
<param>20</param>
<param>80</param>
<param>200</param>
<param>25</param>
</property>
</properties>
</widget>
<widget id="inputschemacomplextextfield" type="FileChooserComplexTextField">
<properties>
<property name="text">
<param>"file:c:\\testvalidator\\BGNFAC.xsd"</param>
</property>
<property name="buttontext">
<param>"Browse"</param>
</property>
<property name="enabled">
<param>false</param>
</property>
<property name="bounds">
<param>220</param>
<param>80</param>
<param>600</param>
<param>25</param>
</property>
</properties>
</widget>
<widget id="transformationcheckbox" type="CheckBox">
<properties>
<property name="text">
<param>"Use transformation"</param>
</property>
<property name="bounds">
<param>40</param>
<param>120</param>
<param>875</param>
<param>40</param>
</property>
</properties>
</widget>
<widget id="transformationlabel" type="Label">
<properties>
<property name="text">
<param>"Stylesheet:"</param>
</property>
<property name="bounds">
<param>20</param>
<param>160</param>
<param>200</param>
<param>25</param>
</property>
</properties>
</widget>
<widget id="transformationcomplextextfield" type="FileChooserComplexTextField">
<properties>
<property name="text">
<param>"file:c:\\testvalidator\\XML2PDF.xsl"</param>
</property>
<property name="buttontext">
<param>"Browse"</param>
</property>
<property name="enabled">
<param>false</param>
</property>
<property name="bounds">
<param>220</param>
<param>160</param>
<param>600</param>
<param>25</param>
</property>
</properties>
</widget>
<widget id="outputschemacheckbox" type="CheckBox">
<properties>
<property name="text">
<param>"Use output validation"</param>
</property>
<property name="bounds">
<param>40</param>
<param>200</param>
<param>875</param>
<param>40</param>
</property>
</properties>
</widget>
<widget id="outputschemalabel" type="Label">
<properties>
<property name="text">
<param>"After transformation schema:"</param>
</property>
<property name="bounds">
<param>20</param>
<param>240</param>
<param>200</param>
<param>25</param>
</property>
</properties>
</widget>
<widget id="outputschemacomplextextfield" type="FileChooserComplexTextField">
<properties>
<property name="text">
<param>"file://c:/testout.xsd"</param>
</property>
<property name="buttontext">
<param>"Browse"</param>
</property>
<property name="enabled">
<param>false</param>
</property>
<property name="bounds">
<param>220</param>
<param>240</param>
<param>600</param>
<param>25</param>
</property>
</properties>
</widget>
</complexwidget>
</complexwidget>
</view>
<controller>
<component component-ref="inputschemacheckbox">
<action id="action5" codebehind-method="onSelectAction" event-type="COMPONENT_SELECTED"/>
<action id="action6" codebehind-method="enableCTFInputSchema" event-type="COMPONENT_SELECTED"/>
</component>
<component component-ref="transformationcheckbox">
<action id="action7" codebehind-method="onSelectAction" event-type="COMPONENT_SELECTED"/>
<action id="action8" codebehind-method="enableCTFStylesheet" event-type="COMPONENT_SELECTED"/>
</component>
<component component-ref="outputschemacheckbox">
<action id="action9" codebehind-method="onSelectAction" event-type="COMPONENT_SELECTED"/>
<action id="action10" codebehind-method="enableCTFOutputSchema" event-type="COMPONENT_SELECTED"/>
</component>
</controller>
<model/>
</guiml> |
Hierachter kun je dan een andere java file hangen, die je code behind bevat. In dit geval dus de methodes, die je gedefinieerd hebt als acties op de verschillende componenten.
[
Voor 120% gewijzigd door
Nick_S op 07-12-2004 09:50
]