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.ElementAssimilator; 15 import net.openmarkup.ElementHandler; 16 import net.openmarkup.ElementType; 17 import net.openmarkup.Realizable; 18 19 import org.w3c.dom.Element ; 20 21 import org.jdesktop.jdnc.markup.Attributes; 22 import org.jdesktop.jdnc.markup.ElementTypes; 23 import org.jdesktop.jdnc.markup.Namespace; 24 25 import org.jdesktop.jdnc.markup.attr.FormComponentAttributes; 26 27 28 32 public class FormComponentElement extends ComponentElement { 33 private static final Map attrMap = new Hashtable (); 34 35 public FormComponentElement(Element element, ElementType elementType) { 36 super(element, elementType); 37 } 38 39 protected Map getAttributeHandlerMap() { 40 return attrMap; 41 } 42 43 protected Object instantiate() { 44 Object binding[] = new Object [2]; 45 binding[0] = null; 46 binding[1] = null; 47 return binding; 48 } 49 50 protected void applyAttributesAfter() { 51 super.applyAttributesAfter(); 52 applyAttribute(Namespace.JDNC, Attributes.DATA); 53 applyAttribute(Namespace.JDNC, Attributes.BINDING); 54 } 55 56 protected Map registerAttributeHandlers() { 57 Map handlerMap = super.registerAttributeHandlers(); 58 if (handlerMap != null) { 59 handlerMap.put(Namespace.JDNC + ":" + Attributes.DATA, 60 dataHandler); 61 handlerMap.put(Namespace.JDNC + ":" + Attributes.BINDING, 62 bindingHandler); 63 } 64 return handlerMap; 65 } 66 67 protected static final AttributeHandler dataHandler = 68 new AttributeHandler(Namespace.JDNC, Attributes.DATA, 69 FormComponentAttributes.dataApplier); 70 71 protected static final AttributeHandler bindingHandler = 72 new AttributeHandler(Namespace.JDNC, Attributes.BINDING, 73 FormComponentAttributes.bindingApplier); 74 75 76 77 } 78 | Popular Tags |