use of jetbrains.communicator.core.users.User in project intellij-plugins by JetBrains.
the class SelectionProcessor method getSelectedUsers.
public Set<User> getSelectedUsers() {
TreePath[] selectionPaths = myUserTree.getSelectionPaths();
if (selectionPaths == null)
selectionPaths = new TreePath[0];
Set<User> result = new HashSet<>();
for (TreePath selectionPath : selectionPaths) {
Object userObject = TreeUtils.getUserObject(selectionPath);
if (userObject instanceof User) {
result.add((User) userObject);
} else {
// group
TreeNode treeNode = ((TreeNode) selectionPath.getLastPathComponent());
Enumeration enumeration = treeNode.children();
while (enumeration.hasMoreElements()) {
TreeNode node = (TreeNode) enumeration.nextElement();
result.add((User) ((DefaultMutableTreeNode) node).getUserObject());
}
}
}
return result;
}
use of jetbrains.communicator.core.users.User in project intellij-plugins by JetBrains.
the class ViewFilesCommand method execute.
public void execute() {
User user = myUserListComponent.getSelectedUser();
assert user != null;
ProjectsData projectsData = user.getProjectsData(myFacade);
if (projectsData.isEmpty()) {
myFacade.showMessage(StringUtil.getMsg("ViewFilesCommand.no.information"), StringUtil.getMsg("ViewFilesCommand.no.information.for.user", user.getDisplayName()));
} else {
myFacade.showUserFiles(user, projectsData);
}
}
use of jetbrains.communicator.core.users.User in project intellij-plugins by JetBrains.
the class MessagesTabTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
myUserMock = mock(User.class);
myUser = (User) myUserMock.proxy();
final Mock consoleStub = mock(ConsoleView.class);
consoleStub.stubs().method(ANYTHING);
consoleStub.stubs().method("getComponent").will(returnValue(new JLabel()));
LocalMessageDispatcherImpl localMessageDispatcher = new LocalMessageDispatcherImpl(getBroadcaster(), new MockIDEFacade(getClass()), null);
disposeOnTearDown(localMessageDispatcher);
myMessagesTab = new MessagesTab(null, myUser, localMessageDispatcher, true) {
@Override
protected ConsoleView createConsoleView(Project project) {
return (ConsoleView) consoleStub.proxy();
}
};
disposeOnTearDown(myMessagesTab);
}
use of jetbrains.communicator.core.users.User in project intellij-plugins by JetBrains.
the class JabberTransport_ConnectionTest method testAddUser_NotIdeTalk.
public void testAddUser_NotIdeTalk() throws Throwable {
addEventListener();
addUserFred();
IDEtalkEvent event = checkEvent(false);
assertTrue(event.toString(), event instanceof UserEvent.Added);
User user = ((UserEvent.Added) event).getUser();
assertEquals("Jabber user expected", "Jabber", user.getTransportCode());
assertEquals("Should add Jabber user", FRED, user.getName());
assertEquals("Wrong group", "aGroup", user.getGroup());
assertFalse(user.hasIDEtalkClient());
}
use of jetbrains.communicator.core.users.User in project intellij-plugins by JetBrains.
the class JabberTransport_ConnectionTest method testAddUser_IdeTalk.
public void testAddUser_IdeTalk() throws Throwable {
XMPPConnection conn = createLocalConnectionWithJabberUser("fred" + System.nanoTime(), JabberFacadeImpl.IDETALK_RESOURCE);
addEventListener();
final String fred = getUser(conn);
addUser(fred);
IDEtalkEvent event = checkEvent(false);
assertTrue(event.toString(), event instanceof UserEvent.Added);
User user = ((UserEvent.Added) event).getUser();
assertEquals("Jabber user expected", "Jabber", user.getTransportCode());
assertEquals("Should add Jabber user", fred, user.getName());
assertEquals("Wrong group", "aGroup", user.getGroup());
new WaitFor(TIMEOUT) {
@Override
protected boolean condition() {
return myFacade.getConnection().getRoster().getPresence(fred) != null;
}
};
assertTrue("User with IDEtalk resource", user.hasIDEtalkClient());
}
Aggregations