Search in sources :

Example 1 with NamedUserCommand

use of jetbrains.communicator.core.commands.NamedUserCommand 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());
    }
}
Also used : NamedUserCommand(jetbrains.communicator.core.commands.NamedUserCommand) UserCommand(jetbrains.communicator.core.commands.UserCommand) NamedUserCommand(jetbrains.communicator.core.commands.NamedUserCommand)

Aggregations

NamedUserCommand (jetbrains.communicator.core.commands.NamedUserCommand)1 UserCommand (jetbrains.communicator.core.commands.UserCommand)1