1 25 26 package org.objectweb.openccm.explorer.DCI; 27 28 import java.awt.Component ; 29 import java.awt.event.ActionEvent ; 30 31 import javax.swing.JOptionPane ; 32 import javax.swing.JScrollPane ; 33 34 import org.objectweb.util.explorer.api.MenuItem; 35 import org.objectweb.util.explorer.api.MenuItemTreeView; 36 import org.objectweb.util.explorer.api.TreeView; 37 38 44 public class DCIInstallDescriptor 45 implements MenuItem 46 { 47 48 51 public int getStatus(TreeView treeView){ 52 return MenuItem.ENABLED_STATUS; 53 } 54 55 58 public void actionPerformed(MenuItemTreeView e) throws Exception { 59 org.ist.coach.DCI.DCIDeployment dciDeployment= 60 (org.ist.coach.DCI.DCIDeployment)e.getSelectedObject(); 61 62 javax.swing.JPanel pan = new javax.swing.JPanel (); 63 javax.swing.JTextArea description =new javax.swing.JTextArea (30,30); 64 65 javax.swing.JScrollPane areaScrollPane = new javax.swing.JScrollPane (description); 66 areaScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); 67 areaScrollPane.setPreferredSize(new java.awt.Dimension (300,300)); 68 pan.add(areaScrollPane); 69 int result = 70 javax.swing 71 .JOptionPane 72 .showOptionDialog( 73 (Component )((ActionEvent )e.getEvent()).getSource(), 74 pan, 75 "Install a descriptor", 76 JOptionPane.OK_CANCEL_OPTION, 77 JOptionPane.PLAIN_MESSAGE, 78 null, 79 null, 80 null); 81 dciDeployment.install_with_descriptor(description.getText()); 83 84 } 85 86 } 87 | Popular Tags |