KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jdesktop > jdnc > markup > elem > FormComponentElement


1 /*
2  * $Id: FormComponentElement.java,v 1.1.1.1 2004/06/16 01:43:40 davidson1 Exp $
3  *
4  * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
5  * Santa Clara, California 95054, U.S.A. All rights reserved.
6  */

7
8 package org.jdesktop.jdnc.markup.elem;
9
10 import java.util.Hashtable JavaDoc;
11 import java.util.Map JavaDoc;
12
13 import net.openmarkup.AttributeHandler;
14 import net.openmarkup.ElementAssimilator;
15 import net.openmarkup.ElementHandler;
16 import net.openmarkup.ElementType;
17 import net.openmarkup.Realizable;
18
19 import org.w3c.dom.Element JavaDoc;
20
21 import org.jdesktop.jdnc.markup.Attributes;
22 import org.jdesktop.jdnc.markup.ElementTypes;
23 import org.jdesktop.jdnc.markup.Namespace;
24
25 import org.jdesktop.jdnc.markup.attr.FormComponentAttributes;
26
27
28 /**
29  *
30  * @author Amy Fowler
31  */

32 public class FormComponentElement extends ComponentElement {
33     private static final Map JavaDoc attrMap = new Hashtable JavaDoc();
34
35     public FormComponentElement(Element JavaDoc element, ElementType elementType) {
36         super(element, elementType);
37     }
38
39     protected Map JavaDoc getAttributeHandlerMap() {
40         return attrMap;
41     }
42
43     protected Object JavaDoc instantiate() {
44        Object JavaDoc binding[] = new Object JavaDoc[2];
45        binding[0] = null;
46        binding[1] = null;
47        return binding;
48     }
49
50     protected void applyAttributesAfter() {
51         super.applyAttributesAfter();
52         applyAttribute(Namespace.JDNC, Attributes.DATA);
53         applyAttribute(Namespace.JDNC, Attributes.BINDING);
54     }
55
56     protected Map JavaDoc registerAttributeHandlers() {
57         Map JavaDoc handlerMap = super.registerAttributeHandlers();
58         if (handlerMap != null) {
59             handlerMap.put(Namespace.JDNC + ":" + Attributes.DATA,
60                            dataHandler);
61             handlerMap.put(Namespace.JDNC + ":" + Attributes.BINDING,
62                            bindingHandler);
63         }
64         return handlerMap;
65     }
66
67     protected static final AttributeHandler dataHandler =
68         new AttributeHandler(Namespace.JDNC, Attributes.DATA,
69                              FormComponentAttributes.dataApplier);
70
71     protected static final AttributeHandler bindingHandler =
72         new AttributeHandler(Namespace.JDNC, Attributes.BINDING,
73                              FormComponentAttributes.bindingApplier);
74
75
76
77 }
78
Popular Tags