@Override public boolean isEnabled() { ExecutionContexts contexts = HandlerServiceImpl.peek(); // setEnabled(contexts); IEclipseContext executionContext = contexts != null ? contexts.context : null; // getExecutionContext(contexts); if (executionContext == null) { return super.isEnabled(); } Object handler = HandlerServiceImpl.lookUpHandler(executionContext, commandId); if (handler == null) { setBaseEnabled(false); return super.isEnabled(); } IEclipseContext staticContext = contexts.staticContext; // getStaticContext(contexts); Boolean result = (Boolean) ContextInjectionFactory.invoke(handler, CanExecute.class, executionContext, staticContext, Boolean.TRUE); setBaseEnabled(result.booleanValue()); return super.isEnabled(); }