KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * $Id: SearchPanelElement.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.Map JavaDoc;
11
12 import org.w3c.dom.Element JavaDoc;
13 import net.openmarkup.AttributeHandler;
14 import net.openmarkup.ElementType;
15 import org.jdesktop.jdnc.markup.Attributes;
16 import org.jdesktop.jdnc.markup.Namespace;
17 import org.jdesktop.jdnc.markup.attr.SearchPanelAttributes;
18
19 /**
20  *
21  * @author Ramesh Gupta
22  */

23 public class SearchPanelElement extends ComponentElement {
24     public SearchPanelElement(Element JavaDoc element, ElementType elementType) {
25         super(element, elementType);
26     }
27
28     protected void applyAttributesAfter() {
29         super.applyAttributesAfter();
30         applyAttribute(Namespace.JDNC, Attributes.PATTERN_FILTER);
31         applyAttribute(Namespace.JDNC, Attributes.PATTERN_HIGHLIGHTER);
32         applyAttribute(Namespace.JDNC, Attributes.TARGET);
33     }
34
35     protected Map JavaDoc registerAttributeHandlers() {
36         Map JavaDoc handlerMap = super.registerAttributeHandlers();
37         if (handlerMap != null) {
38             handlerMap.put(Namespace.JDNC + ":" + Attributes.PATTERN_FILTER,
39                            patternFilterHandler);
40             handlerMap.put(Namespace.JDNC + ":" + Attributes.PATTERN_HIGHLIGHTER,
41                            patternHighlighterHandler);
42             handlerMap.put(Namespace.JDNC + ":" + Attributes.TARGET,
43                            targetHandler);
44         }
45         return handlerMap;
46     }
47
48     private static final AttributeHandler patternFilterHandler =
49         new AttributeHandler(Namespace.JDNC, Attributes.PATTERN_FILTER, SearchPanelAttributes.patternFilterApplier);
50
51     private static final AttributeHandler patternHighlighterHandler =
52         new AttributeHandler(Namespace.JDNC, Attributes.PATTERN_HIGHLIGHTER, SearchPanelAttributes.patternHighlighterApplier);
53
54     private static final AttributeHandler targetHandler =
55         new AttributeHandler(Namespace.JDNC, Attributes.TARGET, SearchPanelAttributes.targetApplier);
56 }
57
Popular Tags