private void updateCommandEnablement(String commandId) { IHandlerService handlerService = window.getService(IHandlerService.class); ICommandService commandService = window.getService(ICommandService.class); if (handlerService != null && commandService != null) { Command buildAllCmd = commandService.getCommand(commandId); buildAllCmd.setEnabled(handlerService.getCurrentState()); } } };
@Override public boolean isEnabled() { if (command != null) { command.getCommand().setEnabled(menuService.getCurrentState()); return command.getCommand().isEnabled(); } return false; }
@Override public boolean canExecute(ParameterizedCommand command, IEclipseContext staticContext) { final IEclipseContext executionContext = getExecutionContext(); addParms(command, staticContext); // executionContext.set(STATIC_CONTEXT, staticContext); push(executionContext, staticContext); try { Command cmd = command.getCommand(); cmd.setEnabled(new ExpressionContext(peek().context)); return cmd.isEnabled(); } finally { pop(); // executionContext.remove(STATIC_CONTEXT); } }
setEnabled(event.getApplicationContext()); if (!isEnabled()) { final NotEnabledException exception = new NotEnabledException(
setEnabled(event.getApplicationContext()); if (!isEnabled()) { final NotEnabledException exception = new NotEnabledException(
setEnabled(event.getApplicationContext()); if (!isEnabled()) { final NotEnabledException exception = new NotEnabledException(
parameterizedCommand.getCommand().setEnabled( handlerService.getCurrentState()); setEnabled(parameterizedCommand.getCommand().isEnabled());