My favorites
▼
|
Sign in
awt2gwt
A Library supporting migration from java.awt to Google Web Toolkit (gwt)
Project hosting will be READ-ONLY
Wednesday at 8am PST
due to brief network maintenance.
Project Home
Downloads
Wiki
Issues
Source
Checkout
|
Browse
|
Changes
|
r8
Source path:
svn
/
trunk
/
php
/
vmd2ui.php
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
<?php
require('io/FileOp.php');
global $xml;
$xml=simplexml_load_file('HelloMIDlet.vmd');
HTMLFormVMD();
function HTMLFormVMD(){
global $content,$xml;
OpenFile('a.html');
/************************** Form ***********************************/
$subComponents = $xml->Document->Component;
foreach($subComponents->Component as $component){
$property = $component->Properties->Property;
switch($component['typeID']){
case 'C#DisplayablesCategory';
foreach($component->Component as $comp){
if($comp['typeID']=='Cjavax.microedition.lcdui.Form'){
writeFile("<form action=\"\" method=\"post\">");
foreach($comp->Component as $c){
switch($c['typeID']){
case 'Cjavax.microedition.lcdui.TextField':
foreach($c->Property as $property){
if($property['name']=='label'){
$b = $property['value'];
//print_r($property['value']);
}
if($property['name']=='instanceName'){
$input = '<input name="'.substr($property['value'],1).'" type="text" value="" />';
}
}
writeFile($b.$input);
break;
case 'Cjavax.microedition.lcdui.ChoiceGroup':
foreach($c->Property as $property){
if($property['name']=='choiceType'){
echo $property['value'];
if($property['value']=='V1'){ //Exclusive or radio
foreach($c->Component as $cc){
writeFile(substr($cc->Property['value'],1));
writeFile("<input type=\"radio\" name=\"$name\" value=\"".substr($cc->Property['value'],1)."\"/>");
}
}else if($property['value']=='V2'){ //multiple or checkbox
foreach($c->Component as $cc){
writeFile(substr($cc->Property['value'],1));
writeFile("<input type=\"checkbox\" name=\"$name\" value=\"".substr($cc->Property['value'],1)."\"/>");
}
}else if($property['value']=='V4'){ //Popup or select
writeFile("<select name=\"$name\">");
foreach($c->Component as $cc){
writeFile("<option value=\"".substr($cc->Property['value'],1)."\">".substr($cc->Property['value'],1)."</option>");
}
writeFile("</select>");
}
}else if($property['name']=='instanceName'){
$name = substr($property['value'],1);
}
}
break;
}
}
writeFile("</form>");
}
}
//writeFile($property['value']);
break;
case 'java.awt.Button':
$eventHandler = $component->Events->EventHandler;
$b = '<button name="'.$component['name'].'" onclick="return '.$eventHandler['handler'].'();">';
$b.=$property['value'];
writeFile($b);
writeFile('</button>');
writeFile('<script type="text/javascript">');
writeFile('function '.$eventHandler['handler'].'(){');
writeFile('}');
writeFile('</script>');
break;
}
}
CloseFile();
}
?>
Show details
Hide details
Change log
r7
by ataul.haque on Feb 13, 2009
Diff
Visual Mobile Designer to UI
Go to:
/trunk/php/vmd2ui.php
Project members,
sign in
to write a code review
Older revisions
All revisions of this file
File info
Size: 3185 bytes, 90 lines
View raw file
Hosted by