Java 类org.eclipse.ui.commands.HandlerSubmission 实例源码
项目: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);
}
项目:team-explorer-everywhere
文件:LegacyActionKeyBindingSupport.java
@Override
public void dispose() {
for (final Iterator it = handlerSubmissions.iterator(); it.hasNext();) {
final HandlerSubmission handlerSubmission = (HandlerSubmission) it.next();
workbenchCommandSupport.removeHandlerSubmission(handlerSubmission);
handlerSubmission.getHandler().dispose();
}
handlerSubmissions.clear();
}