1 package org.columba.chat.command; 19 20 import org.columba.api.command.ICommandReference; 21 import org.columba.api.command.IWorkerStatusController; 22 import org.columba.chat.Connection; 23 import org.columba.chat.ui.frame.api.IChatFrameMediator; 24 import org.columba.core.command.Command; 25 import org.jivesoftware.smack.Chat; 26 27 public class OpenChatCommand extends Command { 28 29 private IChatFrameMediator mediator; 30 31 private String jabberId; 32 33 private Chat chat; 34 35 public OpenChatCommand(IChatFrameMediator mediator, 36 ICommandReference reference) { 37 super(reference); 38 39 this.mediator = mediator; 40 } 41 42 45 @Override 46 public void updateGUI() throws Exception { 47 mediator.getConversationController().addChat(jabberId, chat); 48 } 49 50 @Override 51 public void execute(IWorkerStatusController worker) throws Exception { 52 ChatCommandReference ref = (ChatCommandReference) getReference(); 53 54 jabberId = ref.getJabberId(); 55 56 if (mediator.getConversationController().exists(jabberId) == false) { 58 59 chat = Connection.XMPPConnection.createChat(jabberId); 60 61 } 62 63 } 64 65 } | Popular Tags |