use of jetbrains.communicator.idea.IDEtalkMessagesWindow in project intellij-plugins by JetBrains.
the class SearchHistoryAction method update.
public void update(AnActionEvent e) {
super.update(e);
Project project = getProject(e);
MutablePicoContainer container = getContainer(project);
SearchHistoryCommand command = getCommand(e);
User selectedUser;
if (container != null && project != null && command != null) {
boolean focused = false;
if (IDEtalkMessagesWindowImpl.PLACE_TOOLBAR.equals(e.getPlace())) {
IDEtalkMessagesWindow messagesWindow = project.getComponent(IDEtalkMessagesWindow.class);
selectedUser = messagesWindow.getSelectedUser();
focused = messagesWindow.hasFocus();
} else {
UserListComponent userList = (UserListComponent) container.getComponentInstanceOfType(UserListComponent.class);
selectedUser = userList.getSelectedUser();
focused = userList.getComponent().hasFocus();
}
command.setUser(selectedUser);
e.getPresentation().setEnabled(command.isEnabled() && focused);
}
}
use of jetbrains.communicator.idea.IDEtalkMessagesWindow in project intellij-plugins by JetBrains.
the class EventsProcessorTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
myUserModel = new UserModelImpl(getBroadcaster());
disposeOnTearDown(myUserModel);
myMock = mock(IDEtalkMessagesWindow.class);
LocalMessageDispatcherImpl localMessageDispatcher = new LocalMessageDispatcherImpl(getBroadcaster(), new MockIDEFacade(getClass()), myUserModel);
disposeOnTearDown(localMessageDispatcher);
EventsProcessor processor = new EventsProcessor((IDEtalkMessagesWindow) myMock.proxy(), myUserModel, localMessageDispatcher, null);
disposeOnTearDown(processor);
}
Aggregations