1 7 8 package org.jdesktop.jdnc.markup.elem; 9 10 import java.util.regex.Pattern ; 11 12 import org.w3c.dom.Element ; 13 import org.jdesktop.swing.decorator.ShuttleSorter; 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.Decoder; 18 import java.util.Hashtable ; 19 import java.util.Map ; 20 import net.openmarkup.AttributeHandler; 21 import org.jdesktop.jdnc.markup.attr.SorterAttributes; 22 23 27 public class SorterElement extends FilterElement { 28 private static final Map attrMap = new Hashtable (); 29 30 public SorterElement(Element element, ElementType elementType) { 31 super(element, elementType); 32 } 33 34 protected Object instantiate() { 35 return new ShuttleSorter(getColumnIndex(), true); 36 } 37 38 protected void applyAttributesAfter() { 39 super.applyAttributesAfter(); 40 applyAttribute(Namespace.JDNC, Attributes.DIRECTION); 41 } 42 protected Map registerAttributeHandlers() { 43 Map handlerMap = super.registerAttributeHandlers(); 44 if (handlerMap != null) { 45 handlerMap.put(Namespace.JDNC + ":" + Attributes.DIRECTION, 46 directionAttrHandler); 47 } 48 return handlerMap; 49 } 50 51 protected Map getAttributeHandlerMap() { 52 return attrMap; 53 } 54 55 private static final AttributeHandler directionAttrHandler = 56 new AttributeHandler(Namespace.JDNC, Attributes.DIRECTION, SorterAttributes.directionApplier); 57 58 } 59 | Popular Tags |