/** Sets the text for the menu item or other subclass of AbstractButton. * Cut from the name '&' char. * @param item AbstractButton * @param text new label * @param useMnemonic if true and '&' char found in new text, next char is used * as Mnemonic. * @deprecated Use either {@link AbstractButton#setText} or {@link Mnemonics#setLocalizedText(AbstractButton, String)} as appropriate. */ @Deprecated public static void setMenuText(AbstractButton item, String text, boolean useMnemonic) { String msg = NbBundle.getMessage(Actions.class, "USE_MNEMONICS"); // NOI18N if ("always".equals(msg)) { // NOI18N useMnemonic = true; } else if ("never".equals(msg)) { // NOI18N useMnemonic = false; } else { assert "default".equals(msg); // NOI18N } if (useMnemonic) { Mnemonics.setLocalizedText(item, text); } else { item.setText(cutAmpersand(text)); } }
toolTip = (toolTip == null) ? "" : cutAmpersand(toolTip);
/** Sets the text for the menu item or other subclass of AbstractButton. * Cut from the name '&' char. * @param item AbstractButton * @param text new label * @param useMnemonic if true and '&' char found in new text, next char is used * as Mnemonic. * @deprecated Use either {@link AbstractButton#setText} or {@link Mnemonics#setLocalizedText(AbstractButton, String)} as appropriate. */ public static void setMenuText(AbstractButton item, String text, boolean useMnemonic) { if (useMnemonic) { Mnemonics.setLocalizedText(item, text); } else { item.setText(cutAmpersand(text)); } }
/** Sets the text for the menu item or other subclass of AbstractButton. * Cut from the name '&' char. * @param item AbstractButton * @param text new label * @param useMnemonic if true and '&' char found in new text, next char is used * as Mnemonic. * @deprecated Use either {@link AbstractButton#setText} or {@link Mnemonics#setLocalizedText(AbstractButton, String)} as appropriate. */ public static void setMenuText(AbstractButton item, String text, boolean useMnemonic) { if (useMnemonic) { Mnemonics.setLocalizedText(item, text); } else { item.setText(cutAmpersand(text)); } }
public String getText() { String s; if (getValue(MENU_TEXT) != null) { s = getValue(MENU_TEXT).toString(); } else { s = String.valueOf(getValue(Action.NAME)); } return s != null ? org.openide.awt.Actions.cutAmpersand(s) : null; }
String pattern = catalog.get("ACSD_option_pattern"); // NOI18N String valTxt; labTxt = org.openide.awt.Actions.cutAmpersand(label); if(labTxt.endsWith(":")) { // NOI18N labTxt = labTxt.substring(0, labTxt.length()-1); valTxt = org.openide.awt.Actions.cutAmpersand(valueLabels[i]); valueDescrs[i] = Catalog.format(pattern, labTxt, valTxt); labTxt = org.openide.awt.Actions.cutAmpersand(label); if(labTxt.endsWith(":")) { // NOI18N labTxt = labTxt.substring(0, labTxt.length()-1);
String tip = findKey (action); String nm = (String)action.getValue (Action.NAME); String an = nm == null ? "" : cutAmpersand(nm); if (tip == null || tip.equals("")) { // NOI18N button.setToolTipText(an);
String tip = findKey (action); String nm = (String)action.getValue (Action.NAME); String an = nm == null ? "" : cutAmpersand(nm); if (tip == null || tip.equals("")) { // NOI18N button.setToolTipText(an);
return Actions.cutAmpersand(name); } else { return toStringOf(o);
if (fo.getPath().matches("(Menu|Toolbars)/.+")) { // NOI18N return Actions.cutAmpersand(val); } else { return val;