Eclipse Luna: @CanExecute handler methods that are not called due to the wrong context

I updated the RCP app for Eclipse from Juno to Luna. This caused my application toolbar to be disabled.

I found a solution in this thread: Eclipse Luna: @CanExecute handler methods are not called (Solution: generate the event manually). But, alas, the treatment did not work: - (.

I turned around with the debugger to find the root cause of the failure. I found that in the HandlerServiceHandler.class the setEnabled (ObjectConttext) method failed. This involves extracting the wrong execution context from the evaluation context.

I will tell in more detail: What happens is that after making a selection in the project explorer, I send my event. SetEnabled (ObjectificationContext) is looking for a handler for the corresponding command associated with my toolbar item. However, it searches for a handler in the context of the * run * project explorer. The handler is not in this context, so the method does not work !!

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

Thanks!!!!!

0
source share

Source: https://habr.com/ru/post/971843/


All Articles