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 FinishMode 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 38 41 public FinishMode () { 42 super(); 43 44 fillStructure (); 45 } 46 47 51 protected void fillStructure () { 52 complexStructure.add(refMode); 54 } 55 56 public void fromXML(Node node) { 57 fromXMLExecuted=true; 58 refMode.setValue(refMode.getChoices()[0]); 59 super.fromXML(node); 60 } 61 62 protected void afterImporting () { 63 if (!fromXMLExecuted) { 64 refMode.setValue(refMode.getChoices()[0]); 65 } 66 } 67 68 71 public boolean isEmpty() { 72 return (refMode.getChoosen() instanceof Empty); 73 } 74 75 81 public XMLPanel getPanel () { 82 return refMode.getPanel(); 83 } 84 85 91 public Object toValue () { 92 return refMode.toValue(); 93 } 94 95 103 public String toString () { 104 return refMode.toString(); 105 } 106 107 114 public Object clone () { 115 FinishMode fm=(FinishMode)super.clone(); 116 117 fm.refMode=(XMLComplexChoice)this.refMode.clone(); 118 fm.fillStructure(); 119 120 return fm; 121 } 122 123 } 124 | Popular Tags |