addContactAction = new Action(Messages.MultiRosterView_AddContact, SharedImages.getImageDescriptor(SharedImages.IMG_ADD_BUDDY)) {
public void run() {
ITreeSelection selection = (ITreeSelection) treeViewer.getSelection();
IResult contact = (IResult) selection.getFirstElement();
if (MessageDialog.openConfirm(null, Messages.AddContactDialog_DialogTitle, NLS.bind(Messages.SearchContactDialog_AddContactMessage, contact.getUser().getName()))) {
IPresenceContainerAdapter ipca = account.getPresenceContainerAdapter();
IRosterSubscriptionSender sender = ipca.getRosterManager().getRosterSubscriptionSender();
try {
sender.sendRosterAdd(contact.getUser().getID().getName(), contact.getUser().getName(), null);
} catch (ECFException e) {
Activator.getDefault().getLog().log(e.getStatus());
}