use of jetbrains.communicator.core.commands.UserCommand in project intellij-plugins by JetBrains.
the class CommandManagerTest method testGetCommandTwice.
public void testGetCommandTwice() throws Exception {
UserCommand command = myCommandManager.getCommand(MyTestCommand.class, myContainer);
UserCommand command1 = myCommandManager.getCommand(MyTestCommand.class, myContainer);
assertSame(command, command1);
}
use of jetbrains.communicator.core.commands.UserCommand in project intellij-plugins by JetBrains.
the class BaseAction method update.
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());
}
}
use of jetbrains.communicator.core.commands.UserCommand in project intellij-plugins by JetBrains.
the class UserTree method invokeSendMessageAction.
protected void invokeSendMessageAction() {
MutablePicoContainer container = BaseAction.getContainer(this);
UserCommand command = Pico.getCommandManager().getCommand(SendMessageCommand.class, container);
if (command.isEnabled()) {
command.execute();
}
}
use of jetbrains.communicator.core.commands.UserCommand in project intellij-plugins by JetBrains.
the class CommandManagerTest method testGetCommand.
public void testGetCommand() throws Exception {
UserCommand command = myCommandManager.getCommand(MyTestCommand.class, myContainer);
assertNotNull(command);
assertSame(MyTestCommand.class, command.getClass());
assertNotNull(myContainer.getComponentInstanceOfType(MyTestCommand.class));
}
Aggregations