/** * Returns whether this command has a handler, and whether this handler is * also handled. * * @return <code>true</code> if the command is handled; <code>false</code> * otherwise. */ public final boolean isHandled() { if (handler == null) { return false; } return handler.isHandled(); }
/** * Returns whether this command has a handler, and whether this handler is * also handled. * * @return <code>true</code> if the command is handled; <code>false</code> * otherwise. */ public final boolean isHandled() { if (handler == null) { return false; } return handler.isHandled(); }
@Override public boolean isHandled() { return handler.isHandled(); }
/** * Returns whether this command has a handler, and whether this handler is * also handled. * * @return <code>true</code> if the command is handled; <code>false</code> * otherwise. */ public boolean isHandled() { if (handler == null) { return false; } return handler.isHandled(); }
@Override public boolean isHandled() { ExecutionContexts contexts = HandlerServiceImpl.peek(); if (contexts != null) { Object handler = HandlerServiceImpl.lookUpHandler(contexts.context, commandId); if (handler instanceof IHandler) { return ((IHandler) handler).isHandled(); } return handler != null; } return false; }
@Override public boolean isHandled() { boolean okToLoad = isOkToLoad(); if (okToLoad && loadHandler()) { return handler.isHandled(); } if (!okToLoad) { // That is crazy, but we should answer "true" for contributions from not loaded // plugins, otherwise pure declarative commands defined in not active bundles // will not run for the first time return true; } return false; }
@Override public void handlerChanged(HandlerEvent event) { final boolean enabledChanged = ((Boolean) event .getPreviousAttributeValuesByName().get( ILegacyAttributeNames.ENABLED)).booleanValue() != handler .isEnabled(); final boolean handledChanged = ((Boolean) event .getPreviousAttributeValuesByName().get( ILegacyAttributeNames.HANDLED)).booleanValue() != handler .isHandled(); listener.handlerChanged(new org.eclipse.core.commands.HandlerEvent( handler, enabledChanged, handledChanged)); } }
if ((handler != null) && (handler.isHandled())) { try { final Object returnValue = handler.execute(event);
if ((handler != null) && (handler.isHandled())) { try { final Object returnValue = handler.execute(event);
if ((handler != null) && (handler.isHandled())) { try { final Object returnValue = handler.execute(event);
@Execute public Object execute(IEclipseContext context, @Optional @Named(HandlerServiceImpl.PARM_MAP) Map parms, @Optional Event trigger, @Optional IEvaluationContext staticContext) throws ExecutionException, NotHandledException { if (Policy.DEBUG_CMDS) { Activator.trace(Policy.DEBUG_CMDS_FLAG, "execute " + command + " and " //$NON-NLS-1$ //$NON-NLS-2$ + handler + " with: " + context, null); //$NON-NLS-1$ } IEvaluationContext appContext = staticContext; if (appContext == null) { appContext = new ExpressionContext(context); } ExecutionEvent event = new ExecutionEvent(command, parms == null ? Collections.EMPTY_MAP : parms, trigger, appContext); if (handler != null) { if (handler.isHandled()) { final Object returnValue = handler.execute(event); return returnValue; } throw new NotHandledException("Handler " + handler //$NON-NLS-1$ + " is not handled for for command " + command); //$NON-NLS-1$ } throw new NotHandledException("There is no handler to execute for command " + command); //$NON-NLS-1$ }
if (obj != null) { if (obj instanceof IHandler) { commandHandled = ((IHandler) obj).isHandled(); } else { commandHandled = true;
if ((handler != null) && (handler.isHandled())) { setEnabled(event.getApplicationContext()); if (!isEnabled()) {
if ((handler != null) && (handler.isHandled())) { setEnabled(event.getApplicationContext()); if (!isEnabled()) {
private void addSave(IMenuManager menu) { ICommandService commandService = fContainer.getWorkbenchPart().getSite().getService(ICommandService.class); final Command command= commandService.getCommand(IWorkbenchCommandConstants.FILE_SAVE); final IHandler handler = command.getHandler(); if (handler != null) { if (fSaveContributionItem == null) { fSaveContributionItem = new CommandContributionItem( new CommandContributionItemParameter(fContainer .getWorkbenchPart().getSite(), null, command .getId(), CommandContributionItem.STYLE_PUSH)); } // save is an editable dependent action, ie add only when edit // is possible if (handler.isHandled() && getSourceViewer().isEditable()) menu.add(fSaveContributionItem); } }
if ((handler != null) && (handler.isHandled())) { setEnabled(event.getApplicationContext()); if (!isEnabled()) {
if (obj != null) { if (obj instanceof IHandler) { commandHandled = ((IHandler) obj).isHandled(); } else { commandHandled = true;