1 10 11 12 package org.enhydra.jawe.xml.elements.specialpanels; 13 14 import org.enhydra.jawe.xml.*; 15 import org.enhydra.jawe.xml.panels.*; 16 import org.enhydra.jawe.xml.elements.*; 17 18 import java.util.*; 19 import javax.swing.*; 20 import java.awt.*; 21 import java.awt.event.*; 22 23 26 public class XMLActualParametersTableControlPanel extends XMLTableControlPanel { 27 public XMLActualParametersTableControlPanel (XMLCollection myOwner, 28 String title, boolean isVertical,boolean hasBorder) { 29 30 super(myOwner,title,isVertical,hasBorder); 31 32 Dimension dim=getPreferredDimension(new String []{"x"}); 33 final XMLButton buttonView=new XMLButton("","ViewFormalParameters",dim); 34 buttonView.setToolTipText(XMLUtil.getLanguageDependentString("ViewFormalParametersKey")); 35 36 add(Box.createRigidArea(new Dimension(0,10))); 37 add(buttonView); 38 39 buttonView.addActionListener(new ActionListener() { 41 public void actionPerformed(ActionEvent e) { 42 XMLGroupPanel gp=(XMLGroupPanel)getParent().getParent(); 43 XMLComboPanel cp=(XMLComboPanel)gp.getComponent(0); 44 JComboBox cb=cp.getComboBox(); 45 Object sel=cp.getSelectedItem(); 46 if (!(sel instanceof XMLComplexElement)) return; 47 XMLComplexElement selected=(XMLComplexElement)sel; 48 if (selected==null) return; 49 FormalParameters fps=(FormalParameters)selected.get("FormalParameters"); 50 if (fps==null) { Object tmp=selected.get("Choice"); 52 tmp=((XMLChoice)tmp).getChoosen(); 53 if (tmp instanceof FormalParameters) { 54 fps=(FormalParameters)tmp; 55 } 56 } 57 if (fps!=null) { 58 XMLElementDialog de=new XMLElementDialog(getDialog(), 59 selected.toString() + " - " + fps.toLabel()); 60 de.editXMLElement(fps.getPanel(),false,false); 61 } 62 gp=(XMLGroupPanel)getParent(); 63 XMLActualParametersPanel app=(XMLActualParametersPanel)gp.getComponent(0); 66 67 app.setFormalParameters(fps); 68 69 JTable t=((XMLTablePanel)controlledPanel).getTable(); 70 t.requestFocus(); 71 } 72 }); 73 74 } 75 76 } 77 78 | Popular Tags |