Search in sources :

Example 1 with IChatManager

use of org.eclipse.ecf.presence.im.IChatManager in project ecf by eclipse.

the class ChatComposite method sendPrivateTextMsg.

protected void sendPrivateTextMsg(IUser data) {
    if (this.view.lch != null) {
        IPresenceContainerAdapter ipca = this.view.lch.getPresenceContainer();
        MessagesView messagesView = this.view.lch.findMessagesView();
        if (messagesView != null) {
            IChatManager chatManager = ipca.getChatManager();
            messagesView.openTab(chatManager.getChatMessageSender(), chatManager.getTypingMessageSender(), this.view.lch.getContainerID(), data.getID());
        }
    }
}
Also used : IPresenceContainerAdapter(org.eclipse.ecf.presence.IPresenceContainerAdapter) IChatManager(org.eclipse.ecf.presence.im.IChatManager) MessagesView(org.eclipse.ecf.presence.ui.MessagesView)

Example 2 with IChatManager

use of org.eclipse.ecf.presence.im.IChatManager in project ecf by eclipse.

the class MSNConnectWizard method performFinish.

public boolean performFinish() {
    final String connectID = page.getEmail();
    final String password = page.getPassword();
    // Save combo text even if we don't successfully login
    page.saveComboText();
    connectContext = ConnectContextFactory.createPasswordConnectContext(password);
    try {
        targetID = container.getConnectNamespace().createInstance(new Object[] { connectID });
    } catch (final IDCreateException e) {
        new IDCreateErrorDialog(null, connectID, e).open();
        return false;
    }
    page.saveComboItems();
    final IPresenceContainerAdapter adapter = (IPresenceContainerAdapter) container.getAdapter(IPresenceContainerAdapter.class);
    container.addListener(new IContainerListener() {

        public void handleEvent(IContainerEvent event) {
            if (event instanceof IContainerConnectedEvent) {
                Display.getDefault().asyncExec(new Runnable() {

                    public void run() {
                        openView();
                    }
                });
            }
        }
    });
    final IChatManager icm = adapter.getChatManager();
    icms = icm.getChatMessageSender();
    itms = icm.getTypingMessageSender();
    icm.addMessageListener(new IIMMessageListener() {

        public void handleMessageEvent(IIMMessageEvent e) {
            if (e instanceof IChatMessageEvent) {
                displayMessage((IChatMessageEvent) e);
            } else if (e instanceof ITypingMessageEvent) {
                displayTypingNotification((ITypingMessageEvent) e);
            }
        }
    });
    new AsynchContainerConnectAction(container, targetID, connectContext, null, new Runnable() {

        public void run() {
            cachePassword(connectID, password);
        }
    }).run();
    return true;
}
Also used : IDCreateException(org.eclipse.ecf.core.identity.IDCreateException) IContainerEvent(org.eclipse.ecf.core.events.IContainerEvent) IContainerListener(org.eclipse.ecf.core.IContainerListener) IChatMessageEvent(org.eclipse.ecf.presence.im.IChatMessageEvent) IContainerConnectedEvent(org.eclipse.ecf.core.events.IContainerConnectedEvent) IIMMessageEvent(org.eclipse.ecf.presence.IIMMessageEvent) IDCreateErrorDialog(org.eclipse.ecf.ui.dialogs.IDCreateErrorDialog) IPresenceContainerAdapter(org.eclipse.ecf.presence.IPresenceContainerAdapter) IIMMessageListener(org.eclipse.ecf.presence.IIMMessageListener) ITypingMessageEvent(org.eclipse.ecf.presence.im.ITypingMessageEvent) AsynchContainerConnectAction(org.eclipse.ecf.ui.actions.AsynchContainerConnectAction) IChatManager(org.eclipse.ecf.presence.im.IChatManager)

Example 3 with IChatManager

use of org.eclipse.ecf.presence.im.IChatManager in project ecf by eclipse.

the class AbstractAdapterAccessTest method testGetChatManager.

public void testGetChatManager() {
    final IPresenceContainerAdapter adapter = getPresenceAdapter();
    assertNotNull(adapter);
    final IChatManager chatManager = adapter.getChatManager();
    assertNotNull(chatManager);
}
Also used : IPresenceContainerAdapter(org.eclipse.ecf.presence.IPresenceContainerAdapter) IChatManager(org.eclipse.ecf.presence.im.IChatManager)

Aggregations

IPresenceContainerAdapter (org.eclipse.ecf.presence.IPresenceContainerAdapter)3 IChatManager (org.eclipse.ecf.presence.im.IChatManager)3 IContainerListener (org.eclipse.ecf.core.IContainerListener)1 IContainerConnectedEvent (org.eclipse.ecf.core.events.IContainerConnectedEvent)1 IContainerEvent (org.eclipse.ecf.core.events.IContainerEvent)1 IDCreateException (org.eclipse.ecf.core.identity.IDCreateException)1 IIMMessageEvent (org.eclipse.ecf.presence.IIMMessageEvent)1 IIMMessageListener (org.eclipse.ecf.presence.IIMMessageListener)1 IChatMessageEvent (org.eclipse.ecf.presence.im.IChatMessageEvent)1 ITypingMessageEvent (org.eclipse.ecf.presence.im.ITypingMessageEvent)1 MessagesView (org.eclipse.ecf.presence.ui.MessagesView)1 AsynchContainerConnectAction (org.eclipse.ecf.ui.actions.AsynchContainerConnectAction)1 IDCreateErrorDialog (org.eclipse.ecf.ui.dialogs.IDCreateErrorDialog)1