1 26 27 package org.objectweb.ccm.demo1.explorer; 28 29 import javax.swing.JOptionPane ; 30 31 import org.objectweb.ccm.demo1.Client; 32 import org.objectweb.ccm.demo1.ClientHome; 33 import org.objectweb.util.explorer.api.TreeView; 34 import org.objectweb.util.explorer.api.MenuItem; 35 import org.objectweb.util.explorer.api.MenuItemTreeView; 36 37 43 public class ClientCreationAction 44 implements MenuItem { 45 46 52 58 64 70 public int getStatus(TreeView treeView) { 71 return MenuItem.ENABLED_STATUS; 72 } 73 74 public void actionPerformed(MenuItemTreeView e) throws Exception { 75 String name = ""; 76 while (name != null && name.equals("")) { 77 name = JOptionPane.showInputDialog("Enter the client's name:"); 78 } 79 if(name!=null){ 80 ClientHome client = (ClientHome) e.getSelectedObject(); 81 Client c = client.create(); 82 c.the_name(name); 83 } 84 } 85 86 } 87 | Popular Tags |