Search in sources :

Example 11 with LocalMessage

use of jetbrains.communicator.core.dispatcher.LocalMessage in project intellij-plugins by JetBrains.

the class MessagesTab method loadTodaysMessages.

private void loadTodaysMessages() {
    LocalMessage[] history = myLocalMessageDispatcher.getHistory(myUser, TimeUtil.getDay(new Date()));
    for (LocalMessage localMessage : history) {
        ConsoleMessage consoleMessage = ((BaseLocalMessage) localMessage).createConsoleMessage(myUser);
        outputMessage(consoleMessage);
    }
}
Also used : BaseLocalMessage(jetbrains.communicator.idea.BaseLocalMessage) LocalMessage(jetbrains.communicator.core.dispatcher.LocalMessage) BaseLocalMessage(jetbrains.communicator.idea.BaseLocalMessage) Date(java.util.Date) ConsoleMessage(jetbrains.communicator.idea.ConsoleMessage)

Example 12 with LocalMessage

use of jetbrains.communicator.core.dispatcher.LocalMessage in project intellij-plugins by JetBrains.

the class ShowHistoryDialog method outputMessages.

private void outputMessages() {
    Date day = null;
    for (LocalMessage message : myFoundMessages) {
        day = printDaySeparatorIfNeeded(message, day);
        BaseLocalMessage localMessage = ((BaseLocalMessage) message);
        ConsoleUtil.outputMessage(localMessage.createConsoleMessage(myUser), myProject, myConsole);
    }
}
Also used : BaseLocalMessage(jetbrains.communicator.idea.BaseLocalMessage) LocalMessage(jetbrains.communicator.core.dispatcher.LocalMessage) BaseLocalMessage(jetbrains.communicator.idea.BaseLocalMessage) Date(java.util.Date)

Example 13 with LocalMessage

use of jetbrains.communicator.core.dispatcher.LocalMessage in project intellij-plugins by JetBrains.

the class SearchHistoryCommandTest method testSearchHistory_WithResult.

public void testSearchHistory_WithResult() throws Exception {
    MockMessage m1 = new MockMessage(new Date(), "some text1");
    MockMessage m2 = new MockMessage(new Date(), "some text2");
    MockMessage m3 = new MockMessage(new Date(), "some text2 ataing");
    query("text2");
    myDispatcherMock.expects(once()).method("getHistory").with(eq(myUser), eq(null)).will(returnValue(new LocalMessage[] { m1, m2, m3 }));
    myIdeMock.expects(once()).method("showSearchHistoryResults").with(eq(new ArrayList<LocalMessage>(Arrays.asList(m2, m3))), eq(myUser));
    myCommand.execute();
}
Also used : LocalMessage(jetbrains.communicator.core.dispatcher.LocalMessage) MockMessage(jetbrains.communicator.mock.MockMessage) ArrayList(java.util.ArrayList) Date(java.util.Date)

Example 14 with LocalMessage

use of jetbrains.communicator.core.dispatcher.LocalMessage in project intellij-plugins by JetBrains.

the class IDEAFacadeTest method testCreateLocalMessage_OutgoingMessage.

public void testCreateLocalMessage_OutgoingMessage() throws Exception {
    LocalMessage outgoingEvent = myFacade.createLocalMessageForOutgoingEvent(new SendMessageEvent("message", myUser));
    assertTrue(outgoingEvent instanceof OutgoingLocalMessage);
}
Also used : IncomingLocalMessage(jetbrains.communicator.idea.sendMessage.IncomingLocalMessage) LocalMessage(jetbrains.communicator.core.dispatcher.LocalMessage) SendMessageEvent(jetbrains.communicator.ide.SendMessageEvent)

Example 15 with LocalMessage

use of jetbrains.communicator.core.dispatcher.LocalMessage in project intellij-plugins by JetBrains.

the class IDEAFacadeTest method testCreateLocalMessage_CodeInterval.

public void testCreateLocalMessage_CodeInterval() throws Exception {
    TransportEvent event = EventFactory.createCodePointerEvent(myTransport, "user22", VFile.create("a path"), 0, 0, 1, 2, "some comment1");
    LocalMessage localMessage = myFacade.createLocalMessageForIncomingEvent(event);
    assertTrue("instance of IncomingCodePointerMessage expected:" + localMessage, localMessage instanceof IncomingCodePointerMessage);
    assertEquals("some comment1", ((BaseLocalMessage) localMessage).getComment());
}
Also used : TransportEvent(jetbrains.communicator.core.transport.TransportEvent) IncomingLocalMessage(jetbrains.communicator.idea.sendMessage.IncomingLocalMessage) LocalMessage(jetbrains.communicator.core.dispatcher.LocalMessage) IncomingCodePointerMessage(jetbrains.communicator.idea.codePointer.IncomingCodePointerMessage)

Aggregations

LocalMessage (jetbrains.communicator.core.dispatcher.LocalMessage)20 IncomingLocalMessage (jetbrains.communicator.idea.sendMessage.IncomingLocalMessage)7 MockMessage (jetbrains.communicator.mock.MockMessage)7 Date (java.util.Date)6 TransportEvent (jetbrains.communicator.core.transport.TransportEvent)4 ArrayList (java.util.ArrayList)2 EventVisitor (jetbrains.communicator.core.EventVisitor)2 User (jetbrains.communicator.core.users.User)2 SendMessageEvent (jetbrains.communicator.ide.SendMessageEvent)2 BaseLocalMessage (jetbrains.communicator.idea.BaseLocalMessage)2 IncomingCodePointerMessage (jetbrains.communicator.idea.codePointer.IncomingCodePointerMessage)2 IncomingStacktraceMessage (jetbrains.communicator.idea.sendMessage.IncomingStacktraceMessage)2 MockTransport (jetbrains.communicator.mock.MockTransport)2 File (java.io.File)1 Message (jetbrains.communicator.core.dispatcher.Message)1 CodePointerEvent (jetbrains.communicator.core.transport.CodePointerEvent)1 MessageEvent (jetbrains.communicator.core.transport.MessageEvent)1 StacktraceEvent (jetbrains.communicator.core.transport.StacktraceEvent)1 CodePointer (jetbrains.communicator.core.vfs.CodePointer)1 SendCodePointerEvent (jetbrains.communicator.ide.SendCodePointerEvent)1