1 26 27 package org.objectweb.ccm.filetransfer.explorer; 28 29 import javax.swing.JOptionPane ; 30 31 import org.objectweb.ccm.filetransfer.Channel; 32 import org.objectweb.ccm.filetransfer.ChannelHome; 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 ChannelCreationAction 44 implements MenuItem 45 { 46 47 53 59 65 71 public int getStatus(TreeView treeView) { 72 return MenuItem.ENABLED_STATUS; 73 } 74 75 public void actionPerformed(MenuItemTreeView e) throws Exception { 76 String name = ""; 77 while (name != null && name.equals("")) { 78 name = JOptionPane.showInputDialog("Enter the Channel's name:"); 79 } 80 if(name!=null){ 81 ChannelHome channelHome = (ChannelHome) e.getSelectedObject(); 82 Channel channel = channelHome.create(); 83 channel.the_name(name); 84 } 85 } 86 87 } 88 | Popular Tags |