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