private void init() { setVisible(myPresentation.isVisible()); setEnabled(myPresentation.isEnabled()); setMnemonic(myEnableMnemonics ? myPresentation.getMnemonic() : 0); setText(myPresentation.getText()); final int mnemonicIndex = myEnableMnemonics ? myPresentation.getDisplayedMnemonicIndex() : -1; if (getText() != null && mnemonicIndex >= 0 && mnemonicIndex < getText().length()) { setDisplayedMnemonicIndex(mnemonicIndex); } AnAction action = myAction.getAction(); updateIcon(action); String id = ActionManager.getInstance().getId(action); if (id != null) { setAcceleratorFromShortcuts(KeymapManager.getInstance().getActiveKeymap().getShortcuts(id)); } else { final ShortcutSet shortcutSet = action.getShortcutSet(); if (shortcutSet != null) { setAcceleratorFromShortcuts(shortcutSet.getShortcuts()); } } }