Package jetbrains.communicator.core.commands

Examples of jetbrains.communicator.core.commands.UserCommand


    }
  }

  public void update(AnActionEvent e) {
    super.update(e);
    UserCommand command = getCommand(e);
    e.getPresentation().setEnabled(command != null && command.isEnabled());
    if (command instanceof NamedUserCommand) {
      NamedUserCommand userCommand = (NamedUserCommand) command;
      e.getPresentation().setText(userCommand.getName(), true);
      e.getPresentation().setIcon(userCommand.getIcon());
    }
View Full Code Here


    }
  }

  protected void invokeSendMessageAction() {
    MutablePicoContainer container = BaseAction.getContainer(this);
    UserCommand command = Pico.getCommandManager().getCommand(SendMessageCommand.class, container);
    if (command.isEnabled()) {
      command.execute();
    }
  }
View Full Code Here

    myCommandManager = new CommandManagerImpl();
    myContainer = Pico.getInstance().makeChildContainer();
  }

  public void testGetCommand() throws Exception {
    UserCommand command = myCommandManager.getCommand(MyTestCommand.class, myContainer);
    assertNotNull(command);
    assertSame(MyTestCommand.class, command.getClass());

    assertNotNull(myContainer.getComponentInstanceOfType(MyTestCommand.class));
  }
View Full Code Here

    assertNotNull(myContainer.getComponentInstanceOfType(MyTestCommand.class));
  }

  public void testGetCommandTwice() throws Exception {
    UserCommand command = myCommandManager.getCommand(MyTestCommand.class, myContainer);
    UserCommand command1 = myCommandManager.getCommand(MyTestCommand.class, myContainer);
    assertSame(command, command1);
  }
View Full Code Here

    myFlags.add(Pair.create(myUserEnterKeyToCheckBox, IdeaFlags.USE_ENTER_FOR_MESSAGES));
    myFlags.add(Pair.create(myShowPopup, IdeaFlags.POPUP_ON_MESSAGE));

    myOptions = Pico.getOptions();

    final UserCommand command = Pico.getCommandManager().getCommand(
        ClearHistoryCommand.class, BaseAction.getContainer(project));

    myClearHistory.setEnabled(command.isEnabled());
    myClearHistory.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        command.execute();
        myClearHistory.setEnabled(command.isEnabled());
      }
    });
  }
View Full Code Here

TOP

Related Classes of jetbrains.communicator.core.commands.UserCommand

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.