public void update(AnActionEvent e) { if (!isEnabled(e)) { e.getPresentation().setEnabled(false); return; } final AnAction[] actions = getChildren(e); for (final AnAction action : actions) { e.getPresentation().setEnabled(true); action.update(e); if (e.getPresentation().isEnabled()) { break; } } if (actions.length == 1) { e.getPresentation().setText(actions[0].getTemplatePresentation().getText()); } else { final String actionText = getActionText(e); if (!actionText.endsWith("...")) { e.getPresentation().setText(actionText + (actions.length > 1 ? "..." : "")); } } e.getPresentation().setIcon(DomCollectionControl.ADD_ICON); super.update(e); }
@Override public void update(AnActionEvent e) { if (!isEnabled(e)) { e.getPresentation().setEnabled(false); return; } final AnAction[] actions = getChildren(e); for (final AnAction action : actions) { e.getPresentation().setEnabled(true); action.update(e); if (e.getPresentation().isEnabled()) { break; } } if (actions.length == 1) { e.getPresentation().setText(actions[0].getTemplatePresentation().getText()); } else { final String actionText = getActionText(e); if (!actionText.endsWith("...")) { e.getPresentation().setText(actionText + (actions.length > 1 ? "..." : "")); } } e.getPresentation().setIcon(DomCollectionControl.ADD_ICON); super.update(e); }
public AddDomElementAction() { super(ApplicationBundle.message("action.add"), null, DomCollectionControl.ADD_ICON); }
protected ShowPopupAction(ActionGroup group) { super(ApplicationBundle.message("action.add"), null, DomCollectionControl.ADD_ICON); myGroup = group; setShortcutSet(CommonActionsPanel.getCommonShortcut(CommonActionsPanel.Buttons.ADD)); }