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());
}
}