1 7 8 package org.jdesktop.jdnc.markup.elem; 9 10 import java.util.Hashtable ; 11 import java.util.Map ; 12 13 import net.openmarkup.AttributeHandler; 14 import net.openmarkup.ElementType; 15 import net.openmarkup.Realizable; 16 17 import org.w3c.dom.Element ; 18 import org.w3c.dom.Node ; 19 20 import org.jdesktop.jdnc.markup.Attributes; 21 import org.jdesktop.jdnc.markup.Namespace; 22 import org.jdesktop.jdnc.markup.attr.ComponentAttributes; 23 import org.jdesktop.jdnc.markup.attr.LabelAttributes; 24 25 29 public class TableHeaderElement extends ElementProxy { 30 private static final Map attrMap = new Hashtable (); 31 32 public TableHeaderElement(Element element, ElementType elementType) { 33 super(element, elementType); 34 } 35 36 protected void applyAttributesAfter() { 37 super.applyAttributesAfter(); 38 applyAttribute(Namespace.JDNC, Attributes.BACKGROUND); 39 applyAttribute(Namespace.JDNC, Attributes.FOREGROUND); 40 applyAttribute(Namespace.JDNC, Attributes.FONT); 41 } 42 43 protected Map getAttributeHandlerMap() { 44 return attrMap; 45 } 46 47 protected Map registerAttributeHandlers() { 48 Map handlerMap = super.registerAttributeHandlers(); 49 if (handlerMap != null) { 50 handlerMap.put(Namespace.JDNC + ":" + Attributes.BACKGROUND, 51 backgroundHandler); 52 handlerMap.put(Namespace.JDNC + ":" + Attributes.FOREGROUND, 53 foregroundHandler); 54 handlerMap.put(Namespace.JDNC + ":" + Attributes.FONT, 55 fontHandler); 56 } 57 return handlerMap; 58 } 59 60 private static final AttributeHandler backgroundHandler = 61 new AttributeHandler(Namespace.JDNC, Attributes.BACKGROUND, 62 ComponentAttributes.backgroundApplier); 63 64 private static final AttributeHandler foregroundHandler = 65 new AttributeHandler(Namespace.JDNC, Attributes.FOREGROUND, 66 ComponentAttributes.foregroundApplier); 67 68 private static final AttributeHandler fontHandler = 69 new AttributeHandler(Namespace.JDNC, Attributes.FONT, 70 ComponentAttributes.fontApplier); 71 72 } 73 | Popular Tags |