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