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.RosterEntry; 26 27 public class RemoveContactCommand extends Command { 28 29 private String jabberId; 30 31 private PopulateRoasterCommand populateCommand; 32 33 public RemoveContactCommand(IChatFrameMediator mediator, 34 ICommandReference reference) { 35 super(reference); 36 37 populateCommand = new PopulateRoasterCommand(mediator, reference); 38 } 39 40 43 @Override 44 public void updateGUI() throws Exception { 45 populateCommand.updateGUI(); 46 } 47 48 @Override 49 public void execute(IWorkerStatusController worker) throws Exception { 50 ChatCommandReference ref = (ChatCommandReference) getReference(); 51 52 jabberId = ref.getJabberId(); 53 54 RosterEntry entry = Connection.XMPPConnection.getRoster().getEntry( 55 jabberId); 56 57 Connection.XMPPConnection.getRoster().removeEntry(entry); 58 populateCommand.execute(worker); 59 } 60 61 } 62 | Popular Tags |