Java 类org.eclipse.ui.commands.ActionHandler 实例源码

项目:team-explorer-everywhere    文件:LegacyActionKeyBindingSupport.java   
@Override
public void addAction(final IAction action) {
    Check.notNull(action, "action"); //$NON-NLS-1$

    final String commandId = action.getActionDefinitionId();

    if (commandId == null) {
        throw new IllegalArgumentException("action does not have an action definition ID set"); //$NON-NLS-1$
    }

    final IHandler handler = new ActionHandler(action);
    final HandlerSubmission handlerSubmission =
        new HandlerSubmission(null, shell, site, commandId, handler, Priority.MEDIUM);

    workbenchCommandSupport.addHandlerSubmission(handlerSubmission);
    handlerSubmissions.add(handlerSubmission);
}