KickJava   Java API By Example, From Geeks To Geeks.

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


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  * Label ctrl class, used as factory for generating labels
20  */

21 public class Label extends EditCtrl {
22   public static final String JavaDoc NODENAME = "label";
23
24   public static boolean isLabel(Element JavaDoc elem) {
25     return elem.getNodeName().equals(NODENAME);
26   }
27
28   public static Element JavaDoc createLabel(Document JavaDoc doc, String JavaDoc label) {
29     Element JavaDoc retVal = EditCtrl.createCtrl(doc, NODENAME);
30     XoplonCtrl.setLabel(retVal, label);
31     return retVal;
32   }
33
34   public static Element JavaDoc addLabel(Element JavaDoc parent, String JavaDoc label) {
35     Element JavaDoc retVal = createLabel(parent.getOwnerDocument(), label);
36     parent.appendChild(retVal);
37     return retVal;
38   }
39
40 }
41
Popular Tags