Search in sources :

Example 6 with MessageEvent

use of jetbrains.communicator.core.transport.MessageEvent in project intellij-plugins by JetBrains.

the class IDEAFacade method createLocalMessageForIncomingEvent.

@Override
public LocalMessage createLocalMessageForIncomingEvent(TransportEvent event) {
    final LocalMessage[] result = new LocalMessage[1];
    event.accept(new EventVisitor() {

        @SuppressWarnings({ "RefusedBequest" })
        @Override
        public void visitStacktraceEvent(StacktraceEvent event) {
            result[0] = new IncomingStacktraceMessage(event);
        }

        @SuppressWarnings({ "RefusedBequest" })
        @Override
        public void visitCodePointerEvent(CodePointerEvent event) {
            result[0] = new IncomingCodePointerMessage(event, IDEAFacade.this);
        }

        @SuppressWarnings({ "RefusedBequest" })
        @Override
        public void visitMessageEvent(MessageEvent event) {
            result[0] = new IncomingLocalMessage(event);
        }
    });
    return result[0];
}
Also used : LocalMessage(jetbrains.communicator.core.dispatcher.LocalMessage) IncomingLocalMessage(jetbrains.communicator.idea.sendMessage.IncomingLocalMessage) IncomingCodePointerMessage(jetbrains.communicator.idea.codePointer.IncomingCodePointerMessage) EventVisitor(jetbrains.communicator.core.EventVisitor) MessageEvent(jetbrains.communicator.core.transport.MessageEvent) StacktraceEvent(jetbrains.communicator.core.transport.StacktraceEvent) CodePointerEvent(jetbrains.communicator.core.transport.CodePointerEvent) IncomingLocalMessage(jetbrains.communicator.idea.sendMessage.IncomingLocalMessage) IncomingStacktraceMessage(jetbrains.communicator.idea.sendMessage.IncomingStacktraceMessage)

Example 7 with MessageEvent

use of jetbrains.communicator.core.transport.MessageEvent in project intellij-plugins by JetBrains.

the class EventsProcessorTest method testIncomingMessage_No_Tab_WithExpand.

public void testIncomingMessage_No_Tab_WithExpand() throws Exception {
    MessageEvent event = EventFactory.createMessageEvent(new MockTransport(), "bob", "text");
    myMock.expects(once()).method("expandToolWindow");
    myMock.expects(once()).method("newMessageAvailable").with(eq(myUserModel.createUser("bob", MockTransport.NAME)), eq(event));
    myMock.expects(once()).method("getWindow").will(returnValue(null));
    getBroadcaster().fireEvent(event);
}
Also used : MessageEvent(jetbrains.communicator.core.transport.MessageEvent) MockTransport(jetbrains.communicator.mock.MockTransport)

Aggregations

MessageEvent (jetbrains.communicator.core.transport.MessageEvent)7 WaitFor (jetbrains.communicator.util.WaitFor)4 IDEtalkEvent (jetbrains.communicator.core.IDEtalkEvent)3 TextXmlMessage (jetbrains.communicator.core.transport.TextXmlMessage)3 EventVisitor (jetbrains.communicator.core.EventVisitor)2 MockTransport (jetbrains.communicator.mock.MockTransport)2 Message (org.jivesoftware.smack.packet.Message)2 IDEtalkAdapter (jetbrains.communicator.core.IDEtalkAdapter)1 LocalMessage (jetbrains.communicator.core.dispatcher.LocalMessage)1 CodePointerEvent (jetbrains.communicator.core.transport.CodePointerEvent)1 StacktraceEvent (jetbrains.communicator.core.transport.StacktraceEvent)1 IncomingCodePointerMessage (jetbrains.communicator.idea.codePointer.IncomingCodePointerMessage)1 IncomingLocalMessage (jetbrains.communicator.idea.sendMessage.IncomingLocalMessage)1 IncomingStacktraceMessage (jetbrains.communicator.idea.sendMessage.IncomingStacktraceMessage)1