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 17 22 public class StartMode extends XMLComplexElement { 23 24 private boolean fromXMLExecuted=false; 25 26 private XMLComplexChoice refMode=new XMLComplexChoice(name, 27 new XMLElement[] { 28 new Empty(), 29 new Automatic(), 30 new Manual() 31 },1) { 32 public XMLPanel getPanel () { 33 return new XMLComboPanel(this); 34 } 35 }; 36 37 40 public StartMode () { 41 super(); 42 43 fillStructure (); 44 } 45 46 50 protected void fillStructure () { 51 complexStructure.add(refMode); 53 } 54 55 public void fromXML(Node node) { 56 fromXMLExecuted=true; 57 refMode.setValue(refMode.getChoices()[0]); 58 super.fromXML(node); 59 } 60 61 protected void afterImporting () { 62 if (!fromXMLExecuted) { 63 refMode.setValue(refMode.getChoices()[0]); 64 } 65 } 66 67 70 public boolean isEmpty() { 71 return (refMode.getChoosen() instanceof Empty); 72 } 73 74 80 public Object toValue () { 81 return refMode.toValue(); 82 } 83 84 92 public String toString () { 93 return refMode.toString(); 94 } 95 96 102 public XMLPanel getPanel () { 103 return refMode.getPanel(); 104 } 105 106 113 public Object clone () { 114 StartMode sm=(StartMode)super.clone(); 115 116 sm.refMode=(XMLComplexChoice)this.refMode.clone(); 117 sm.fillStructure(); 118 119 return sm; 120 } 121 122 } 123 | Popular Tags |