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