Package jetbrains.communicator.core.users

Examples of jetbrains.communicator.core.users.User


  }

  @Override
  public void setCanAccessMyFiles(final boolean canAccessMyFiles, UserModel userModel) {
    if (userModel != null) {
      User inModel = userModel.findUser(getName(), getTransportCode());
      if (inModel != null) {
        ((BaseUserImpl) inModel).setCanAccessWithEvent(canAccessMyFiles, userModel.getBroadcaster());
      }
    }
View Full Code Here


    public void afterChange(IDEtalkEvent event) {
      //noinspection RefusedBequest
      event.accept(new EventVisitor() {
        @Override
        public void visitTransportEvent(TransportEvent event) {
          User user = event.createUser(myUserModel);
          addPendingMessage(user, myFacade.createLocalMessageForIncomingEvent(event));
        }

        @Override
        public void visitOwnMessageEvent(OwnMessageEvent event) {
View Full Code Here

  }

  private void dispatchAllMessages() {
    User[] usersWithMessages = getUsersWithMessages();
    for (int i = 0; i < usersWithMessages.length && isRunning(); i++) {
      User user = usersWithMessages[i];
      Message[] pendingMessages = getPendingMessages(user);
      for (int j = 0; j < pendingMessages.length && isRunning(); j++) {
        performDispatch(user, pendingMessages[j]);
      }
    }
View Full Code Here

  public String getTagNamespace() {
    return Transport.NAMESPACE;
  }

  public final boolean processAndFillResponse(Element response, Element request, Transport transport, String remoteUser) {
    User requestingUser = myUserModel.findUser(remoteUser, transport.getName());
    if (requestingUser == null) return false;

    if (!requestingUser.canAccessMyFiles()) {
      boolean allow = myIdeFacade.askQuestion(StringUtil.getMsg("FileAccessProvider.title"),
          StringUtil.getMsg("FileAccessProvider.message", requestingUser.getDisplayName()));
      if (allow) {
        requestingUser.setCanAccessMyFiles(true, myUserModel);
      }
      else {
        return false;
      }
    }
View Full Code Here

  public String getToolTipText(MouseEvent e) {
    TreePath pathForLocation = getPathForLocation(e.getX(), e.getY());
    if (pathForLocation != null) {
      Object userObject = TreeUtils.getUserObject(pathForLocation);
      if (userObject instanceof User) {
        User user = (User) userObject;
        StringBuffer result = new StringBuffer();
        if (!user.getName().equals(user.getDisplayName())) {
          result.append(StringUtil.getMsg("user.tooltip", user.getName())).append("\n");
        }

        Message[] pendingMessages = myLocalMessageDispatcher.getPendingMessages(user);
        if (pendingMessages.length > 0) {
          IdeaLocalMessage ideaLocalMessage = (IdeaLocalMessage) pendingMessages[0];
View Full Code Here

    if (e.isShiftDown() || e.isControlDown() || e.isAltDown()) return;

    myDelivered = false;
    Object userObject = TreeUtils.getUserObject(pathComponent);
    if (userObject instanceof User) {
      User user = (User) userObject;
      deliverLocalMessage(user, path, e);
    }
  }
View Full Code Here

    getBroadcaster().fireEvent(EventFactory.createStacktraceEvent(new MockTransport(), "aaaaaa", "statcktrace", "comment"));

    assertEquals("Another user should be added", hadUsers + 1, myUserModel.getAllUsers().length);

    User addedUser = myUserModel.getAllUsers()[0];
    assertEquals("aaaaaa", addedUser.getName());
  }
View Full Code Here

  }

  public void testAddAndChangeUser() throws Exception {
    myUserModel.addUser(new MockUser("user", "group"));
    checkSaved(true);
    User user = myUserModel.getAllUsers()[0];
    user.setDisplayName("dds dds", myUserModel);
    checkSaved(true);
    user.setGroup("newGroup", myUserModel);
    checkSaved(true);
    user.setCanAccessMyFiles(true, myUserModel);
    checkSaved(true);
    getBroadcaster().fireEvent(new UserEvent.Updated(user, "presence", null, null));
    checkSaved(false);

    PersistentUserModelImpl modelInstance = createModelInstance();
View Full Code Here

  public void testConcurrentModifications() throws Exception {
    Runnable createUserCommand = new Runnable() {
      @Override
      public void run() {
        User user = myUserModel.createUser("bob" + System.nanoTime(), MockTransport.NAME);
        myUserModel.addUser(user);
      }
    };
    Runnable createGroupCommand = new Runnable() {
      @Override
View Full Code Here

  }

  public void testSendMessage() throws Exception {
    addEventListener();

    final User user = UserImpl.create("user", MockTransport.NAME);
    doTest("message1", new User[]{user});

    verifySendMessageLocalEvent(user, "message1");
  }
View Full Code Here

TOP

Related Classes of jetbrains.communicator.core.users.User

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.