AnAction (@NotNull AnAction action, @NotNull String actionId) { //noinspection UnnecessaryLocalVariable AnAction a1 = action; AnAction a2 = ActionManager.getInstance().getAction(actionId); Presentation p1 = a1.getTemplatePresentation(); Presentation p2 = a2.getTemplatePresentation(); p1.setIcon(ObjectUtils.chooseNotNull(p1.getIcon(), p2.getIcon())); p1.setDisabledIcon(ObjectUtils.chooseNotNull(p1.getDisabledIcon(), p2.getDisabledIcon())); p1.setSelectedIcon(ObjectUtils.chooseNotNull(p1.getSelectedIcon(), p2.getSelectedIcon())); p1.setHoveredIcon(ObjectUtils.chooseNotNull(p1.getHoveredIcon(), p2.getHoveredIcon())); if (StringUtil.isEmpty(p1.getText())) { p1.setTextWithMnemonic(p2.getTextWithPossibleMnemonic()); } p1.setDescription(ObjectUtils.chooseNotNull(p1.getDescription(), p2.getDescription())); ShortcutSet ss1 = a1.getShortcutSet(); if (ss1 == CustomShortcutSet.EMPTY) { a1.copyShortcutFrom(a2); } ActionsCollector.getInstance().onActionConfiguredByActionId(action, actionId); return a1; }