public final Presentation getPresentation(@NotNull Action action) { Presentation presentation = myAction2Presentation.get(action); if (presentation == null) { presentation = action.getTemplatePresentation().clone(); myAction2Presentation.put(action, presentation); } return presentation; } }
@Override public int compare(Action o1, Action o2) { int compare = compare( o1.getTemplatePresentation().getText(), o2.getTemplatePresentation().getText()); if (compare == 0 && !o1.equals(o2)) { return o1.hashCode() - o2.hashCode(); } return compare; }
@Override protected ActionGroup updateActions() { ActionGroup actionGroup = super.updateActions(); for (Action action : actionGroup.getChildren(null)) { Presentation presentation = action.getTemplatePresentation(); presentation.putClientProperty(BREAKPOINT, breakpoint); } return actionGroup; } }
Presentation presentation = action.getTemplatePresentation(); String text = presentation.getText(); if (text != null && regExp.test(text)) { Presentation presentation = action.getTemplatePresentation(); String text = presentation.getText(); if (text != null && regExp.test(text)) {
private List<HotKeyItem> getIDEHotKey() { List<HotKeyItem> ideHotKeys = new ArrayList<>(); Scheme scheme = keyBindingAgent.getScheme(selectedSchemeId); for (String actionId : actionManager.getActionIds("")) { boolean isGlobal = false; CharCodeWithModifiers activeCharCodeWithModifiers = scheme.getKeyBinding(actionId); if (activeCharCodeWithModifiers == null) { activeCharCodeWithModifiers = keyBindingAgent.getKeyBinding(actionId); isGlobal = true; } if (activeCharCodeWithModifiers != null) { String hotKey = KeyMapUtil.getShortcutText(activeCharCodeWithModifiers); String description = actionManager.getAction(actionId).getTemplatePresentation().getDescription(); if (description != null && !description.isEmpty()) { ideHotKeys.add(new HotKeyItem(description, hotKey, isGlobal)); } } } return ideHotKeys; }
public PaneMenuActionItemWidget(@NotNull Action action) { initWidget(UI_BINDER.createAndBindUi(this)); this.action = action; Presentation presentation = action.getTemplatePresentation(); title.setText(presentation.getText()); addDomHandler( new ClickHandler() { @Override public void onClick(ClickEvent event) { if (delegate != null) { delegate.onItemClicked(PaneMenuActionItemWidget.this); } } }, ClickEvent.getType()); }
public MenuItemActionWidget(Action action) { initWidget(UI_BINDER.createAndBindUi(this)); this.action = action; final Element actionIcon = action.getTemplatePresentation().getImageElement(); if (actionIcon != null) { iconPanel.add(new ElementWidget(actionIcon)); } title.setText(action.getTemplatePresentation().getText()); addDomHandler( new ClickHandler() { @Override public void onClick(ClickEvent event) { if (delegate != null) { delegate.onItemSelected(MenuItemActionWidget.this); } } }, ClickEvent.getType()); }
public void show() { view.show(); Action action = actionManager.getAction(IdeActions.GROUP_MAIN_MENU); collectActions(actionsMap, (ActionGroup) action, action.getTemplatePresentation().getText()); view.focusOnInput(); if (view.getName() != null) { nameChanged(view.getName(), view.getCheckBoxState()); } }
String debugId; if (actionId == null) { debugId = idPrefix + menuItem.getTemplatePresentation().getText(); } else { debugId = idPrefix + actionId;