KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > nextime > ion > admin > helper > MetaDataForm


1 package org.nextime.ion.admin.helper;
2
3 import java.util.*;
4
5 public class MetaDataForm {
6
7     public static synchronized String JavaDoc getForm( Hashtable ht ) {
8         if( ht == null ) ht = new Hashtable();
9         String JavaDoc form = "";
10         form+="<table>";
11             Enumeration en = ht.keys();
12             boolean bouton = false;
13         
14             while( en.hasMoreElements() ) {
15                 String JavaDoc key = en.nextElement()+"";
16                 bouton = true;
17                 form+="<tr>";
18                 form+="<td align='right' class='texte' width='60'><b>"+key+" : </b></td>";
19                 form+="<td>";
20                 if ( ht.get(key) instanceof String JavaDoc ) {
21                     form+="<input type='text' name='META_"+key+"' value='"+ht.get(key)+"' size='20'>&nbsp;<input type='image' style='border:0px' alt='delete this meta-data' SRC='images/croix-fade.gif' border='0' onmouseover=\"this.src='images/croix.gif'\" onmouseout=\"this.src='images/croix-fade.gif'\" onclick=\"metaToDelete.value='"+key+"'\">";
22                 } else {
23                     form+="<input type='text' name='META_"+key+"' disabled value='Objet JAVA' size='20'>&nbsp;<input type='image' style='border:0px' alt='delete this meta-data' SRC='images/croix-fade.gif' border='0' onmouseover=\"this.src='images/croix.gif'\" onmouseout=\"this.src='images/croix-fade.gif'\" onclick=\"metaToDelete.value='"+key+"'\">";
24                 }
25                 form+="</td>";
26                 form+="</tr>";
27             }
28             if ( bouton ) {
29                 form+="<tr>";
30                 form+="<td></td>";
31                 form+="<td><input type='image' style='border:0px' SRC='images/valide-fade.gif' onmouseover=\"this.src='images/valide.jpg'\" onmouseout=\"this.src='images/valide-fade.gif'\"/></td>";
32                 form+="</tr>";
33             }
34         form+="</table>";
35         form+="<span class='texte'><br>Create new meta-data.</span>";
36         form+="<table>";
37         form+="<tr>";
38         form+="<td width='60' align='right' class='texte'><b>name : </b></td>";
39         form+="<td valign='middle'>";
40         form+="<input type='text' name='newMETA' size='15'>&nbsp;<input align='middle' type='submit' value='create' style='cursor:hand;height:17px'>";
41         form+="</td>";
42         form+="</tr>";
43         form+="</table>";
44         form+="<input type='hidden' id='metaToDelete' name='metaToDelete'>";
45         return form;
46     }
47
48 }
49
50
Popular Tags