KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * $Id: TableHeaderElement.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.ElementType;
15 import net.openmarkup.Realizable;
16
17 import org.w3c.dom.Element JavaDoc;
18 import org.w3c.dom.Node JavaDoc;
19
20 import org.jdesktop.jdnc.markup.Attributes;
21 import org.jdesktop.jdnc.markup.Namespace;
22 import org.jdesktop.jdnc.markup.attr.ComponentAttributes;
23 import org.jdesktop.jdnc.markup.attr.LabelAttributes;
24
25 /**
26  *
27  * @author Amy Fowler
28  */

29 public class TableHeaderElement extends ElementProxy {
30     private static final Map JavaDoc attrMap = new Hashtable JavaDoc();
31
32     public TableHeaderElement(Element JavaDoc element, ElementType elementType) {
33         super(element, elementType);
34     }
35
36     protected void applyAttributesAfter() {
37         super.applyAttributesAfter();
38         applyAttribute(Namespace.JDNC, Attributes.BACKGROUND);
39         applyAttribute(Namespace.JDNC, Attributes.FOREGROUND);
40         applyAttribute(Namespace.JDNC, Attributes.FONT);
41     }
42
43     protected Map JavaDoc getAttributeHandlerMap() {
44         return attrMap;
45     }
46
47     protected Map JavaDoc registerAttributeHandlers() {
48         Map JavaDoc handlerMap = super.registerAttributeHandlers();
49         if (handlerMap != null) {
50             handlerMap.put(Namespace.JDNC + ":" + Attributes.BACKGROUND,
51                            backgroundHandler);
52             handlerMap.put(Namespace.JDNC + ":" + Attributes.FOREGROUND,
53                            foregroundHandler);
54             handlerMap.put(Namespace.JDNC + ":" + Attributes.FONT,
55                            fontHandler);
56         }
57         return handlerMap;
58     }
59
60     private static final AttributeHandler backgroundHandler =
61         new AttributeHandler(Namespace.JDNC, Attributes.BACKGROUND,
62                              ComponentAttributes.backgroundApplier);
63
64     private static final AttributeHandler foregroundHandler =
65         new AttributeHandler(Namespace.JDNC, Attributes.FOREGROUND,
66                              ComponentAttributes.foregroundApplier);
67
68     private static final AttributeHandler fontHandler =
69         new AttributeHandler(Namespace.JDNC, Attributes.FONT,
70                              ComponentAttributes.fontApplier);
71
72 }
73
Popular Tags