1 26 27 package org.objectweb.ccm.chat.explorer; 28 29 import javax.swing.JOptionPane ; 30 31 import org.objectweb.ccm.chat.Service; 32 import org.objectweb.util.explorer.api.MenuItemTreeView; 33 import org.objectweb.util.explorer.api.MenuItem; 34 import org.objectweb.util.explorer.api.TreeView; 35 36 43 public class DisplayAction 44 implements MenuItem 45 { 46 47 public int getStatus(TreeView treeView){ 48 return MenuItem.ENABLED_STATUS; 49 } 50 51 public void actionPerformed(MenuItemTreeView e) throws Exception { 52 String message = ""; 53 while (message != null && message.equals("")) { 54 message = JOptionPane.showInputDialog("Enter the message to send:"); 55 } 56 if (message != null) { 57 Service service = (Service) e.getSelectedObject(); 58 service.display(message); 59 } 60 } 61 62 } 63 | Popular Tags |