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 TableColumnHeaderElement extends ElementProxy { 30 private static final Map attrMap = new Hashtable (); 31 32 public TableColumnHeaderElement(Element element, ElementType elementType) { 33 super(element, elementType); 34 } 35 36 protected void applyAttributesAfter() { 37 super.applyAttributesAfter(); 38 applyAttribute(Namespace.JDNC, Attributes.BACKGROUND); 40 applyAttribute(Namespace.JDNC, Attributes.FOREGROUND); 41 applyAttribute(Namespace.JDNC, Attributes.HORIZONTAL_ALIGNMENT); 42 applyAttribute(Namespace.JDNC, Attributes.HORIZONTAL_TEXT_POSITION); 43 applyAttribute(Namespace.JDNC, Attributes.ICON); 44 applyAttribute(Namespace.JDNC, Attributes.ICON_TEXT_GAP); 45 applyAttribute(Namespace.JDNC, Attributes.VERTICAL_ALIGNMENT); 46 applyAttribute(Namespace.JDNC, Attributes.VERTICAL_TEXT_POSITION); 47 48 52 } 53 54 protected Map getAttributeHandlerMap() { 55 return attrMap; 56 } 57 58 protected Map registerAttributeHandlers() { 59 Map handlerMap = super.registerAttributeHandlers(); 60 if (handlerMap != null) { 61 handlerMap.put(Namespace.JDNC + ":" + Attributes.BACKGROUND, 62 backgroundHandler); 63 handlerMap.put(Namespace.JDNC + ":" + Attributes.FOREGROUND, 64 foregroundHandler); 65 handlerMap.put(Namespace.JDNC + ":" + Attributes.HORIZONTAL_ALIGNMENT, 66 horizontalAlignmentHandler); 67 handlerMap.put(Namespace.JDNC + ":" + Attributes.HORIZONTAL_TEXT_POSITION, 68 horizontalTextPositionHandler); 69 handlerMap.put(Namespace.JDNC + ":" + Attributes.ICON, 70 iconHandler); 71 handlerMap.put(Namespace.JDNC + ":" + Attributes.ICON_TEXT_GAP, 72 iconTextGapHandler); 73 handlerMap.put(Namespace.JDNC + ":" + Attributes.VERTICAL_ALIGNMENT, 74 verticalAlignmentHandler); 75 handlerMap.put(Namespace.JDNC + ":" + Attributes.VERTICAL_TEXT_POSITION, 76 verticalTextPositionHandler); 77 } 78 return handlerMap; 79 } 80 81 private static final AttributeHandler backgroundHandler = 82 new AttributeHandler(Namespace.JDNC, Attributes.BACKGROUND, 83 ComponentAttributes.backgroundApplier); 84 85 private static final AttributeHandler foregroundHandler = 86 new AttributeHandler(Namespace.JDNC, Attributes.FOREGROUND, 87 ComponentAttributes.foregroundApplier); 88 89 private static final AttributeHandler horizontalAlignmentHandler = 90 new AttributeHandler(Namespace.JDNC, Attributes.HORIZONTAL_ALIGNMENT, 91 LabelAttributes.horizontalAlignmentApplier); 92 93 private static final AttributeHandler horizontalTextPositionHandler = 94 new AttributeHandler(Namespace.JDNC, Attributes.HORIZONTAL_TEXT_POSITION, 95 LabelAttributes.horizontalTextPositionApplier); 96 97 private static final AttributeHandler iconHandler = 98 new AttributeHandler(Namespace.JDNC, Attributes.ICON, 99 LabelAttributes.iconApplier); 100 101 private static final AttributeHandler iconTextGapHandler = 102 new AttributeHandler(Namespace.JDNC, Attributes.ICON_TEXT_GAP, 103 LabelAttributes.iconTextGapApplier); 104 109 110 private static final AttributeHandler verticalAlignmentHandler = 111 new AttributeHandler(Namespace.JDNC, Attributes.VERTICAL_ALIGNMENT, 112 LabelAttributes.verticalAlignmentApplier); 113 114 private static final AttributeHandler verticalTextPositionHandler = 115 new AttributeHandler(Namespace.JDNC, Attributes.VERTICAL_TEXT_POSITION, 116 LabelAttributes.verticalTextPositionApplier); 117 118 119 120 } 121 | Popular Tags |