Bug 80644 [KeyBindings] misc: Wrong shortcut displayed in menu for copy using Emacs
Version: 3.1.0 Build id: 200412070800 Copy in Emacs is "Alt-W", the shortcut works perfectly but all the menus in Eclipse show "Ctrl-c" as the copy shortcut, which has other semantics in the Emacs configuration. Similarly, the standard shortcuts to cut and paste text are "Ctrl-w" and "Ctrl-y", but the menus indicate "Shift-Delete" and "Shift-Insert" instead, which work as well but are more difficult to perform and probably less common.
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;
    }
}