Package org.eclipse.ecf.presence

Examples of org.eclipse.ecf.presence.IIMMessageListener


    }
    this.container = container;
    IChatRoomContainer chatRoomContainer = (IChatRoomContainer) container
        .getAdapter(IChatRoomContainer.class);
    chatMessageSender = chatRoomContainer.getPrivateMessageSender();
    chatRoomContainer.addMessageListener(new IIMMessageListener() {
      public void handleMessageEvent(IIMMessageEvent e) {
        if (e instanceof IChatMessageEvent) {
          IChatMessageEvent event = (IChatMessageEvent) e;
          String msg = event.getChatMessage().getBody();
          switch (msg.charAt(0)) {
View Full Code Here


    Trace.catching(Activator.PLUGIN_ID, IRCDebugOptions.EXCEPTIONS_CATCHING, this.getClass(), msg, t);
  }

  public void fireChatMessageEvent(ID sender, String msg) {
    for (Iterator i = msgListeners.iterator(); i.hasNext();) {
      IIMMessageListener l = (IIMMessageListener) i.next();
      l.handleMessageEvent(new ChatMessageEvent(sender, new ChatMessage(sender, msg)));
    }
  }
View Full Code Here

    }
  }

  public void fireChatRoomMessageEvent(ID sender, String msg) {
    for (Iterator i = msgListeners.iterator(); i.hasNext();) {
      IIMMessageListener l = (IIMMessageListener) i.next();
      l.handleMessageEvent(new ChatRoomMessageEvent(sender, new ChatRoomMessage(sender, targetID, msg)));
    }
  }
View Full Code Here

        });
      }
    });
    // Add listeners so that the new chat room gets
    // asynch notifications of various relevant chat room events
    managerChatRoom.addMessageListener(new IIMMessageListener() {
      public void handleMessageEvent(IIMMessageEvent messageEvent) {
        if (messageEvent instanceof IChatRoomMessageEvent) {
          IChatRoomMessage m = ((IChatRoomMessageEvent) messageEvent).getChatRoomMessage();
          chatroomview.handleMessage(m.getFromID(), m.getMessage());
        } else if (messageEvent instanceof IChatMessageEvent) {
View Full Code Here

    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);
View Full Code Here

    // Get presence adapter off of container
    presence = (IPresenceContainerAdapter) container.getAdapter(IPresenceContainerAdapter.class);
    // Get sender interface
    sender = presence.getChatManager().getChatMessageSender();
    // Setup message requestListener to handle incoming messages
    presence.getChatManager().addMessageListener(new IIMMessageListener() {
      public void handleMessageEvent(IIMMessageEvent messageEvent) {
        if (messageEvent instanceof IChatMessageEvent) {
          final IChatMessage m = ((IChatMessageEvent) messageEvent).getChatMessage();
          receiver.handleMessage(m);
        }
View Full Code Here

      presence = (IPresenceContainerAdapter) container
          .getAdapter(IPresenceContainerAdapter.class);
      if (presence == null) throw new ECFException("adapter is null");
      sender = presence.getChatManager().getChatMessageSender();
      presence.getChatManager().addMessageListener(
          new IIMMessageListener() {
            public void handleMessageEvent(
                IIMMessageEvent messageEvent) {
              if (messageEvent instanceof IChatMessageEvent) {
                IChatMessage m = ((IChatMessageEvent) messageEvent)
                    .getChatMessage();
View Full Code Here

    List toNotify = null;
    synchronized (messageListeners) {
      toNotify = new ArrayList(messageListeners);
    }
    for (final Iterator i = toNotify.iterator(); i.hasNext();) {
      final IIMMessageListener l = (IIMMessageListener) i.next();
      l.handleMessageEvent(event);
    }
  }
View Full Code Here

    List toNotify = null;
    synchronized (messageListeners) {
      toNotify = new ArrayList(messageListeners);
    }
    for (final Iterator i = toNotify.iterator(); i.hasNext();) {
      final IIMMessageListener l = (IIMMessageListener) i.next();
      l.handleMessageEvent(new ChatRoomMessageEvent(from,
          new ChatRoomMessage(from, roomID, body)));
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.ecf.presence.IIMMessageListener

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.