Package jetbrains.communicator.commands

Examples of jetbrains.communicator.commands.SearchHistoryCommand


  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);
    }
  }
View Full Code Here

TOP

Related Classes of jetbrains.communicator.commands.SearchHistoryCommand

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.