void () { boolean disabled = !LoadingState.CONFIGURATION_STORE_INITIALIZED.isOccurred() || UISettings.getShadowInstance().getDisableMnemonicsInControls(); try { myEvent = true; if (myTextWithMnemonic == null) { myTextWithMnemonic = createTextWithMnemonic(); } else if (myMnemonicChanged) { try { myTextWithMnemonic = myTextWithMnemonic.withMnemonicIndex(getMnemonicIndex()); } catch (IndexOutOfBoundsException cause) { myTextWithMnemonic = myTextWithMnemonic.withMnemonicIndex(-1); String message = "cannot change mnemonic index " + myComponent; Logger.getInstance(MnemonicWrapper.class).warn(message, cause); } } // update component text only if changed String text = myTextWithMnemonic.getText(!disabled); if (!text.equals(Strings.notNullize(getText()))) setText(text); // update mnemonic code only if changed int code = disabled ? KeyEvent.VK_UNDEFINED : myTextWithMnemonic.getMnemonicCode(); if (code != getMnemonicCode()) setMnemonicCode(code); // update input map to support Alt-based mnemonics if (SystemInfo.isMac && Registry.is("ide.mac.alt.mnemonic.without.ctrl", true)) { InputMap map = myComponent.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); if (map != null) updateInputMap(map, code); } // update mnemonic index only if changed int index = disabled ? -1 : myTextWithMnemonic.getMnemonicIndex(); if (index != getMnemonicIndex()) { try { setMnemonicIndex(index); } catch (IllegalArgumentException cause) { // EA-94674 - IAE: AbstractButton.setDisplayedMnemonicIndex StringBuilder sb = new StringBuilder("cannot set mnemonic index "); if (myMnemonicChanged) sb.append("if mnemonic changed "); String message = sb.append(myComponent).toString(); Logger.getInstance(MnemonicWrapper.class).warn(message, cause); } } Component component = getFocusableComponent(); if (component != null) { component.setFocusable(disabled || myFocusable); } } finally { myEvent = false; myMnemonicChanged = false; myRunnable = null; } }