KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tonbeller > wcf > ui > CheckBox


1 /*
2  * ====================================================================
3  * This software is subject to the terms of the Common Public License
4  * Agreement, available at the following URL:
5  * http://www.opensource.org/licenses/cpl.html .
6  * Copyright (C) 2003-2004 TONBELLER AG.
7  * All Rights Reserved.
8  * You must accept the terms of that agreement to use this software.
9  * ====================================================================
10  *
11  *
12  */

13 package com.tonbeller.wcf.ui;
14
15 import org.w3c.dom.Document JavaDoc;
16 import org.w3c.dom.Element JavaDoc;
17
18 public class CheckBox extends Item {
19   public static final String JavaDoc NODENAME = "checkBox";
20
21   public static boolean isCheckBox(Element JavaDoc elem) {
22     return elem.getNodeName().equals(NODENAME);
23   }
24
25   /** factory function */
26   public static Element JavaDoc createCheckBox(Document JavaDoc doc) {
27     Element JavaDoc cb = Item.createItem(doc, NODENAME);
28     return cb;
29   }
30
31   /** adds check box to parent element, using parent's id as group id */
32   public static Element JavaDoc addCheckBox(Element JavaDoc parent) {
33     Element JavaDoc cb = createCheckBox(parent.getOwnerDocument());
34     parent.appendChild(cb);
35     return cb;
36   }
37
38  
39 }
40
Popular Tags