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);
}
}
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);
}
}
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();
}
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);
}
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());
}
Aggregations