use of jetbrains.communicator.core.users.UserModel in project intellij-plugins by JetBrains.
the class BaseEditorPopup method getChildren.
@NotNull
public AnAction[] getChildren(AnActionEvent e) {
if (e == null)
return EMPTY_ARRAY;
final Editor editor = getEditor(e);
final VirtualFile file = getFile(e);
if (file == null || editor == null)
return EMPTY_ARRAY;
List<AnAction> result = new ArrayList<>();
final UserModel userModel = getUserModel();
String[] groups = userModel.getGroups();
List<String> groupsWithUsers = new ArrayList<>();
for (String group : groups) {
if (userModel.getUsers(group).length > 0) {
groupsWithUsers.add(group);
}
}
if (groupsWithUsers.size() == 1) {
User[] users = userModel.getUsers(groupsWithUsers.get(0));
fillWithUserActions(users, result, file, editor);
} else {
for (String groupsWithUser : groupsWithUsers) {
ActionGroup actionGroup = createGroupWithUsersActionGroup(groupsWithUser, userModel, file, editor);
result.add(actionGroup);
}
}
return result.toArray(new AnAction[result.size()]);
}
use of jetbrains.communicator.core.users.UserModel in project intellij-plugins by JetBrains.
the class IDEtalkMessagesWindowImpl method projectOpened.
@Override
public void projectOpened() {
super.projectOpened();
installIconBlinker(myToolWindow);
Pico pico = Pico.getInstance();
myEventsProcessor = new EventsProcessor(this, (UserModel) pico.getComponentInstanceOfType(UserModel.class), getLocalDispatcher(), myProject);
myToolWindow.installWatcher(myContentManager);
}
use of jetbrains.communicator.core.users.UserModel in project intellij-plugins by JetBrains.
the class FindUsersCommandTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
myUserModelMock = mock(UserModel.class);
myTransportMock = mock(Transport.class);
myTransportMock1 = mock(Transport.class);
myIDEFacade = new MockIDEFacade();
myUserModelMock.stubs().method("getBroadcaster").will(returnValue(getBroadcaster()));
myCommand = new FindUsersCommand((UserModel) myUserModelMock.proxy(), new Transport[] { (Transport) myTransportMock.proxy(), (Transport) myTransportMock1.proxy() }, myIDEFacade);
assertTrue(myCommand.isEnabled());
assertNotNull(myCommand.getName());
}
Aggregations