Bug 125516 [KeyBindings] misc: API to return a KeySequence string for a command id
The KeyAssistDialog contains code that returns the formatted string for the active key binding for the "show key assist" command. It would be nice if this were generalized to a utility method that returns the string for the active key binding given a command id. Or, if you'd rather put this at the JFace keys level, code that returns the formatted string given the array of TriggerSequences (so that the client has to look up the binding with the right service). Right now I have copied this code into the WorkbenchContentAssistAdapter. There is similar code in JDT that does this (but not as thoroughly as the code in KeyAssistDialog).
bundles/org.eclipse.jface/src/org/eclipse/jface/bindings/BindingManager.java
/**
	 * A variation on {@link BindingManager#getActiveBindingsFor(String)} that
	 * returns an array of bindings, rather than trigger sequences. This method
	 * is needed for doing "best" calculationgs on the active bindings.
	 * 
	 * @param commandId
	 *            The identifier of the command for which the active bindings
	 *            should be retrieved; must not be <code>null</code>.
	 * @return The active bindings for the given command; this value may be
	 *         <code>null</code> if there are no active bindings.
	 * @since 3.2
	 */
	private final Binding[] getActiveBindingsFor1(final String commandId) {
		final TriggerSequence[] triggers = getActiveBindingsFor(commandId);
		if (triggers.length == 0) {
			return null;
		}
		final Map activeBindings = getActiveBindings();
		if (activeBindings != null) {
			final Binding[] bindings = new Binding[triggers.length];
			for (int i = 0; i < triggers.length; i++) {
				final TriggerSequence triggerSequence = triggers[i];
				final Object object = activeBindings.get(triggerSequence);
				final Binding binding = (Binding) object;
				bindings[i] = binding;
			}
			return bindings;
		}
		return null;
	}