Eclipse Luna: Handlers' @CanExecute methods not called due to wrong context

点点圈 提交于 2019-12-02 15:23:30

问题


I upgraded my eclipse RCP application from Juno to Luna. This caused my application toolbar to be permenantly disabled.

I found a solution in this thread: Eclipse Luna: Handlers' @CanExecute methods not called (Solution: generate event manually). But alas, the cure didn't work :-(.

I drilled down with the debugger to find the root cause of failure. I found that in HandlerServiceHandler.class the method setEnabled(Object evaluationContext) fails. This is due to the extraction of the wrong execution context from the evaluation context.

I will go into more details: What is happening is that after I perform a selection on the project explorer I send my event. The setEnabled(Object evaluationContext) looks up the handler of the relevant command that is associated with my toolbar item. However, it looks for the handler within the * execution context* of the project explorer. The handler isn't in this context so the method fails!!

Any ideas on how to resolve this. I don't really understand how I can control my contexts well.

Thanks!!!!!

来源:https://stackoverflow.com/questions/25618903/eclipse-luna-handlers-canexecute-methods-not-called-due-to-wrong-context

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!