Bug 70088 [Actions] ActionContributionItem.fill(Composite) creates button with wrong text
1. Create an action with setText ("&Go@Ctrl+G"); 2. Use ActionContributionItem.fill(Composite) to create a button 3. The label of the button will be "_G_o@Ctrl+G" Looking at the source, it seems that the code which handles the text for buttons doesn't take the accelerator in account. Quick fix: Remove any text after the @ (incl) in the "set text for button" code. Suggested fix: Remove the ugly "@text" hack and use the real accelerator (set with setAccelerator()) instead (removes code duplication, too).
bundles/org.eclipse.jface/src/org/eclipse/jface/action/ActionContributionItem.java
}
    /**
     * Shorten the given text <code>t</code> so that its length doesn't
     * exceed the given width. The default implementation replaces characters
     * in the center of the original string with an ellipsis ("..."). Override
     * if you need a different strategy.
     */
    protected String shortenText(String textValue, ToolItem item) {
        if (textValue == null)
            return null;
        GC gc = new GC(item.getDisplay());
        int maxWidth = item.getImage().getBounds().width * 4;
        if (gc.textExtent(textValue).x < maxWidth) {
            gc.dispose();
            return textValue;
        }
        for (int i = textValue.length(); i > 0; i--) {
            String test = textValue.substring(0, i);
            test = test + ellipsis;
            if (gc.textExtent(test).x < maxWidth) {
                gc.dispose();
                return test;
            }
        }
        gc.dispose();
        
        return textValue;
    }
}