KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sourceforge > formview > displayer > test > TestIfDisplayerConfig


1 package net.sourceforge.formview.displayer.test;
2
3 import java.io.IOException JavaDoc;
4 import java.io.InputStream JavaDoc;
5
6 import net.sourceforge.formview.FormViewException;
7 import net.sourceforge.formview.displayer.DisplayerConfig;
8 import net.sourceforge.formview.displayer.DisplayersConfigResources;
9
10 import org.xml.sax.SAXException JavaDoc;
11
12 public class TestIfDisplayerConfig {
13
14     /**
15      * @param args
16      */

17     public static void main(String JavaDoc[] args) throws FormViewException, IOException JavaDoc, SAXException JavaDoc {
18         InputStream JavaDoc inDisplayerConfig = null;
19         // Load DisplayersConfigResources
20
DisplayersConfigResources resources = null;
21         try {
22             
23             inDisplayerConfig = DisplayersConfigResources.class.getResourceAsStream("displayers-config.xml");
24             resources = new DisplayersConfigResources(inDisplayerConfig);
25             
26         } finally {
27 // Make sure we close the input stream.
28
if (inDisplayerConfig != null) {
29                 inDisplayerConfig.close();
30             }
31
32         }
33         
34         // Display config of input type="checkbox"
35
DisplayerConfig displayerConfig = resources.getDisplayerConfig("select");
36         System.out.println(displayerConfig.toString());
37         
38
39
40     }
41     
42     private static String JavaDoc getHtmlInputContent() {
43         StringBuffer JavaDoc htmlContent = new StringBuffer JavaDoc("");
44         htmlContent.append("<input name=\"htmlElementCheckBox\" type=\"checkbox\" >\n");
45         return htmlContent.toString();
46     }
47
48     
49 }
50
Popular Tags