Community
Participate
Working Groups
The fix in Bug 385394 replaced the 400 ms TimerTask which evaluated the @CanExecute methods of the handlers with an event system based on IEclipseContext changes. In RCP apps the handler state, may depend on a state outside the context, we should have a way to trigger the evaluation. Quote from Bug 385394: --------------- > E.g. button "Load server data" should be active if new data on the server is > available? You'll have to open a new bug for that. For Eclipse4 in theory you can set the "org.eclipse.ui.internal.services.EvaluationService.evaluate" variable to Boolean.TRUE or FALSE on the MApplication IEclipseContext, but that's not been formalized and it probably should be. In the Workbench, re-evaluation can be requested using the IEvaluationService. ------------- Maybe the IEvaluationService can be moved to be an IDE independend service?
Possible via sending out an event.
(In reply to Lars Vogel from comment #1) > Possible via sending out an event. Is there a special event that needs to be sent?
(In reply to Wim Jongman from comment #2) > (In reply to Lars Vogel from comment #1) > > Possible via sending out an event. > > Is there a special event that needs to be sent? I did some debugging and this works like a charm: /** * Update handlers enablement */ public static void updateHandlerEnablement() { IEventBroker broker = getContext().get(IEventBroker.class); broker.post("org/eclipse/e4/ui/renderer/requestEnablementUpdate", null); }