KickJava   Java API By Example, From Geeks To Geeks.

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


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 /** factory for listbox item */
19 public class ListItem extends Item {
20   public static final String JavaDoc NODENAME = "listItem";
21
22   public static boolean isListItem(Element JavaDoc elem) {
23     return elem.getNodeName().equals(NODENAME);
24   }
25
26   /** factory function */
27   public static Element JavaDoc createListItem(Document JavaDoc doc) {
28     return Item.createItem(doc, NODENAME);
29   }
30
31   /** factory function */
32   public static Element JavaDoc addListItem(Element JavaDoc parent) {
33     Element JavaDoc retVal = createListItem(parent.getOwnerDocument());
34     parent.appendChild(retVal);
35     return retVal;
36   }
37 }
38
Popular Tags