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.enhydra.jawe.xml.elements.specialpanels.*; 16 17 import java.util.*; 18 19 25 public class ActualParameters extends XMLCollection { 26 27 private transient WorkflowProcess myWorkflow=null; 28 29 private transient XMLComplexElement myToolOrSubflow=null; 30 36 public ActualParameters (WorkflowProcess wp,XMLComplexElement toolOrSbflw) { 37 super(toolOrSbflw); 38 myWorkflow=wp; 39 myToolOrSubflow=toolOrSbflw; 40 } 41 42 48 public XMLElement generateNewElement() { 49 ActualParameter ap=new ActualParameter(myWorkflow); 50 ap.setRequired(true); 51 return ap; 52 } 53 54 65 public XMLPanel getPanel () { 66 69 XMLComplexChoice sel=null; 71 if (myToolOrSubflow instanceof Tool) { 72 sel=(XMLComplexChoice)myToolOrSubflow.get("Application"); 73 } else { 74 sel=(XMLComplexChoice)myToolOrSubflow.get("WorkflowProcess"); 75 } 76 Object selO=sel.getChoosen(); 77 78 FormalParameters fps=null; 79 80 if (selO instanceof XMLCollectionElement) { 81 XMLCollectionElement selectedAppOrWp=(XMLCollectionElement)sel.getChoosen(); 82 83 if (selectedAppOrWp!=null) { 84 fps=(FormalParameters)selectedAppOrWp.get("FormalParameters"); 85 if (fps==null) { Object tmp=selectedAppOrWp.get("Choice"); 87 tmp=((XMLChoice)tmp).getChoosen(); 88 if (tmp instanceof FormalParameters) { 89 fps=(FormalParameters)tmp; 90 } 91 } 92 } 93 } 94 XMLActualParametersPanel app=new XMLActualParametersPanel(this,fps); 96 controlledPanel=app.getControlledPanel(); 97 controlPanel=new XMLActualParametersTableControlPanel(this,"",true,false); 99 104 return new XMLGroupPanel(this,new XMLPanel[]{ 105 app,controlPanel},"",XMLPanel.BOX_LAYOUT, 106 false,false); 107 } 108 109 116 public Object toValue () { 117 return toLabel(); 118 } 119 120 127 public Object clone () { 128 ActualParameters ap=(ActualParameters)super.clone(); 129 ap.myWorkflow=this.myWorkflow; 130 ap.myToolOrSubflow=this.myToolOrSubflow; 131 return ap; 132 } 133 134 protected void setToolOrSubflow (XMLComplexElement tOrSbflw) { 136 this.myToolOrSubflow=tOrSbflw; 137 } 138 } 139 | Popular Tags |