Bug 67413 [KeyBindings] misc: Block accelerators that are in use
I meet a error after following these steps: - Remove hot keys Navigate->Open:F3 then add a new one Ctrl+Enter - Remove hot keys Edit->Find Previous:Ctrl+Shift+K then add a new one Shift+F3 - Remove hot keys Edit->Find Next:Ctrl+K then add a new one F3 Everything work fine with the new assigned keys except for editing an ant file (build.xml). When editing ant file, the ui understand the old hot keys: F3 for open and Ctrl+K for Find Next.
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;
    }
}