1 10 11 package org.enhydra.jawe.xml.elements; 12 13 import org.enhydra.jawe.xml.*; 14 import org.enhydra.jawe.xml.panels.*; 15 import org.w3c.dom.*; 16 import javax.swing.*; 17 import javax.swing.tree.*; 18 19 24 public class RedefinableHeader extends XMLComplexElement { 25 private transient XMLElement myOwner=null; 26 27 private Author refAuthor=new Author(); private Version refVersion=new Version(); private Codepage refCodepage=new Codepage(); private Countrykey refCountrykey=new Countrykey(); private Responsibles refResponsibles; 33 34 private Responsibles clonedResps; 35 36 private boolean fromXMLExecuted=false; 37 38 private XMLAttribute attrPublicationStatus=new XMLAttribute("PublicationStatus", 39 new String [] { 40 "", 41 "UNDER_REVISION", 42 "RELEASED", 43 "UNDER_TEST" 44 },3); 45 46 50 public RedefinableHeader (XMLComplexElement packageOrWProcess) { 51 super(); 52 53 refResponsibles=new Responsibles(packageOrWProcess); 54 fillStructure (); 55 } 56 57 61 protected void fillStructure () { 62 complexStructure.add(attrPublicationStatus); 63 attributes.add(attrPublicationStatus); 64 complexStructure.add(refAuthor); 65 complexStructure.add(refVersion); 66 complexStructure.add(refCodepage); 67 complexStructure.add(refCountrykey); 68 complexStructure.add(refResponsibles); 69 } 70 71 77 public void toXML (Node parent) throws DOMException { 78 super.toXML(parent); 79 } 80 81 public void fromXML (Node node) { 82 fromXMLExecuted=true; 83 attrPublicationStatus.setValue(""); 84 super.fromXML(node); 85 } 86 87 protected void afterImporting () { 88 refResponsibles.afterImporting(); 90 if (!fromXMLExecuted) { 91 attrPublicationStatus.setValue(""); 92 } 93 } 94 95 101 public XMLPanel getPanel () { 102 complexStructure.remove(refResponsibles); 103 clonedResps=(Responsibles)refResponsibles.clone(); 104 complexStructure.add(5,clonedResps); 105 XMLPanel p=super.getPanel(); 106 complexStructure.remove(clonedResps); 107 complexStructure.add(5,refResponsibles); 108 return p; 109 } 110 111 118 public boolean isValidEnter( XMLPanel groupPanel ) { 119 if ( clonedResps != null ) { 121 complexStructure.remove( refResponsibles ); 122 refResponsibles = clonedResps; 123 complexStructure.add( 5, refResponsibles ); 124 } 125 126 return true; 127 } 128 129 } 130 | Popular Tags |