1 23 24 package com.sun.enterprise.deployment.node; 25 26 27 import java.util.Map ; 28 import java.util.HashMap ; 29 import java.util.Iterator ; 30 import org.w3c.dom.Node ; 31 import org.w3c.dom.Element ; 32 import com.sun.enterprise.deployment.Descriptor; 33 import com.sun.enterprise.deployment.xml.TagNames; 34 35 36 43 public abstract class DisplayableComponentNode extends DeploymentDescriptorNode { 44 45 public DisplayableComponentNode() { 46 super(); 47 registerElementHandler(new XMLElement(TagNames.NAME), LocalizedInfoNode.class); 48 registerElementHandler(new XMLElement(TagNames.ICON), IconNode.class); 49 registerElementHandler(new XMLElement(TagNames.SMALL_ICON), IconNode.class); 50 registerElementHandler(new XMLElement(TagNames.LARGE_ICON), IconNode.class); 51 } 52 53 60 public Node writeDescriptor(Node parent, Descriptor descriptor) { 61 Node node = super.writeDescriptor(parent, descriptor); 62 63 writeDisplayableComponentInfo(node, descriptor); 65 return node; 66 } 67 68 74 protected void writeDisplayableComponentInfo(Node node, Descriptor descriptor) { 75 LocalizedNode localizedNode = new LocalizedNode(); 76 localizedNode.writeLocalizedMap(node, TagNames.DESCRIPTION, descriptor.getLocalizedDescriptions()); 77 localizedNode.writeLocalizedMap(node, TagNames.NAME, descriptor.getLocalizedDisplayNames()); 78 IconNode iconNode = new IconNode(); 79 iconNode.writeLocalizedInfo(node, descriptor); 80 81 } 82 } 83 | Popular Tags |