1 7 8 package org.jdesktop.jdnc.markup.elem; 9 10 import java.util.Map ; 11 import java.util.Hashtable ; 12 13 import java.util.regex.Pattern ; 14 15 import org.w3c.dom.Element ; 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 31 public class FilterElement extends ElementProxy { 32 33 private static final Map attrMap = new Hashtable (); 34 35 public FilterElement(Element element, ElementType elementType) { 36 super(element, elementType); 37 } 38 39 protected int getColumnIndex() { 40 String 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 registerAttributeHandlers() { 48 Map handlerMap = super.registerAttributeHandlers(); 49 if (handlerMap != null) { 50 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 getAttributeHandlerMap() { 61 return attrMap; 62 } 63 } 64 | Popular Tags |