1 10 11 package org.enhydra.jawe.xml.elements; 12 13 14 import org.enhydra.jawe.xml.*; 15 import org.enhydra.jawe.xml.panels.*; 16 17 import java.util.*; 18 import javax.swing.tree.*; 19 20 26 public class Responsibles extends XMLCollection { 27 34 public Responsibles (XMLComplexElement packageOrWProcess) { 35 super(packageOrWProcess); 36 } 37 38 42 protected boolean canRemoveParticipant (Participant toRemove) { 43 Responsible r; 44 Iterator it=refCollectionElements.iterator(); 45 while (it.hasNext()) { 46 r=(Responsible)it.next(); 47 if (r.toValue()==toRemove) { 48 return false; 49 } 50 } 51 return true; 52 } 53 54 60 public XMLElement generateNewElement() { 61 Responsible r=new Responsible(myOwner); 62 r.setRequired(true); 63 return r; 64 } 65 66 77 public XMLPanel getPanel () { 78 controlledPanel=new XMLListPanel(this,"",false,true,false); 79 controlPanel=new XMLListControlPanel(this,"",true,false,true); 80 return new XMLGroupPanel(this,new XMLPanel[]{ 81 controlledPanel,controlPanel},toLabel(),XMLPanel.BOX_LAYOUT, 82 false,true); 83 } 84 85 91 protected void afterImporting () { 92 Participants ps=(Participants)myOwner.get("Participants"); 93 Iterator it=refCollectionElements.iterator(); 94 while (it.hasNext()) { 95 Responsible r=(Responsible)it.next(); 96 r.setValue(ps.getParticipant(r.toValue().toString())); 97 } 98 } 99 100 107 public Object clone () { 108 Responsibles r=(Responsibles)super.clone(); 109 return r; 110 } 111 112 } 113 | Popular Tags |