KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * $Id: FilterElement.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 import java.util.Hashtable JavaDoc;
12
13 import java.util.regex.Pattern JavaDoc;
14
15 import org.w3c.dom.Element JavaDoc;
16 import org.jdesktop.swing.decorator.PatternFilter;
17
18 import net.openmarkup.AttributeHandler;
19 import net.openmarkup.ElementType;
20
21 import org.jdesktop.jdnc.markup.Attributes;
22 import org.jdesktop.jdnc.markup.Namespace;
23 import org.jdesktop.jdnc.markup.RealizationUtils;
24 import org.jdesktop.jdnc.markup.attr.*;
25 import org.jdesktop.jdnc.markup.attr.NullAttribute;
26
27 /**
28  *
29  * @author Ramesh Gupta
30  */

31 public class FilterElement extends ElementProxy {
32
33     private static final Map JavaDoc attrMap = new Hashtable JavaDoc();
34
35     public FilterElement(Element JavaDoc element, ElementType elementType) {
36         super(element, elementType);
37     }
38
39     protected int getColumnIndex() {
40         String JavaDoc colName = getAttributeNSOptional(Namespace.JDNC, Attributes.TEST_COLUMN);
41         if (colName.length() > 0) {
42             return TableColumnAttributes.getModelIndex(this, colName);
43         }
44         return -1;
45     }
46
47     protected Map JavaDoc registerAttributeHandlers() {
48         Map JavaDoc handlerMap = super.registerAttributeHandlers();
49         if (handlerMap != null) {
50         // Register null appliers. These attributes are handled elsewhere
51
handlerMap.put(Namespace.JDNC + ":" + Attributes.TEST_COLUMN,
52                            testColumnHandler);
53         }
54         return handlerMap;
55     }
56
57     private static final AttributeHandler testColumnHandler =
58         new AttributeHandler(Namespace.JDNC, Attributes.TEST_COLUMN, NullAttribute.nullApplier);
59
60     protected Map JavaDoc getAttributeHandlerMap() {
61         return attrMap;
62     }
63 }
64
Popular Tags