KickJava   Java API By Example, From Geeks To Geeks.

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


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 /**
19  * Factory class for generating text ctrls
20  */

21 public class TextField extends EditCtrl {
22   public static final String JavaDoc NODENAME = "textField";
23
24   public static boolean isTextField(Element JavaDoc elem) {
25     return elem.getNodeName().equals(NODENAME);
26   }
27
28   /** factory function for text ctrl */
29   public static Element JavaDoc createTextCtrl(Document JavaDoc doc, String JavaDoc type) {
30     return createValueHolder(doc, NODENAME, type);
31   }
32
33   /** factory function for adding text ctrl to parent */
34   public static Element JavaDoc addTextCtrl(Element JavaDoc parent, String JavaDoc type) {
35     Element JavaDoc textCtrl = createTextCtrl(parent.getOwnerDocument(), type);
36     parent.appendChild(textCtrl);
37     return textCtrl;
38   }
39 }
40
Popular Tags