1 10 11 package org.enhydra.jawe.xml.elements; 12 13 import org.enhydra.jawe.xml.*; 14 import org.enhydra.jawe.xml.panels.*; 15 16 import java.util.*; 17 import org.w3c.dom.*; 18 19 24 public class ActualParameter extends XMLSimpleElement { 25 31 private transient DataFields definedDataFields=null; 32 33 40 public ActualParameter (WorkflowProcess wp) { 41 super(); 42 try { 43 this.definedDataFields=(DataFields)wp.get("DataFields"); 44 } 45 catch (NullPointerException npe) { 46 } 48 } 49 50 56 public XMLPanel getPanel () { 57 Object [] choices=null; 58 if (definedDataFields!=null) { 59 choices=definedDataFields.getChoosable().toArray(); 60 } 61 else { 62 choices=null; 63 } 64 return new XMLComboButtonPanel(this,choices,definedDataFields,true); 65 } 66 67 73 public void toXML (Node parent) throws DOMException { 74 if (value==null) return; 78 if ((value instanceof DataField) || (value instanceof FormalParameter)) { 79 Object realValue=value; 81 value=((XMLCollectionElement)value).getID(); 83 super.toXML(parent); 84 value=realValue; 85 } else { 86 super.toXML(parent); 87 } 88 89 } 90 91 98 public Object clone () { 99 ActualParameter ap=(ActualParameter)super.clone(); 100 ap.setValue(this.toValue()); 102 ap.definedDataFields=this.definedDataFields; 103 return ap; 104 } 105 106 113 protected void afterImporting () { 114 if (value==null) return; 115 Iterator it=definedDataFields.getChoosable().iterator(); 116 while (it.hasNext()) { 117 XMLCollectionElement dfOrFp=(XMLCollectionElement)it.next(); 118 if (dfOrFp.getID().equals(value.toString())) { 120 value=dfOrFp; 121 break; 122 } 123 } 124 } 125 126 } 127 | Popular Tags |