KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * $Id: EditorElement.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 org.w3c.dom.Element JavaDoc;
14 import org.jdesktop.jdnc.markup.Attributes;
15 import org.jdesktop.jdnc.markup.Namespace;
16 import org.jdesktop.jdnc.markup.attr.EditorAttributes;
17 import net.openmarkup.AttributeHandler;
18 import net.openmarkup.ElementType;
19
20 public class EditorElement
21     extends ComponentElement {
22     private static final Map JavaDoc attrMap = new Hashtable JavaDoc();
23
24     public EditorElement(Element JavaDoc element, ElementType elementType) {
25         super(element, elementType);
26     }
27
28     protected Map JavaDoc registerAttributeHandlers() {
29         Map JavaDoc handlerMap = super.registerAttributeHandlers();
30         if (handlerMap != null) {
31             handlerMap.put(Namespace.JDNC + ":" + Attributes.SOURCE,
32                            sourceHandler);
33         }
34         return handlerMap;
35     }
36
37     protected Map JavaDoc getAttributeHandlerMap() {
38         return attrMap;
39     }
40
41     protected void applyAttributesAfter() {
42         super.applyAttributesAfter();
43         applyAttribute(Namespace.JDNC, Attributes.SOURCE);
44     }
45
46     private static final AttributeHandler sourceHandler =
47         new AttributeHandler(Namespace.JDNC, Attributes.SOURCE,
48                              EditorAttributes.sourceApplier);
49
50 }
Popular Tags