We updated the dependencies of an Eclipse RCP app from 2018-09 to 2025-06, and some toolbar items enabled state stopped getting updated automatically. The app is running on the compatibility layer and using custom source providers and <enabledWhen> expressions to control toolbar items handlers enabled state.
The following solutions didn't solve the problem:
- Storing the variables inside
IEclipseContext directly instead of using AbstractSourceProvider
- Using E4 handler with
canExecute method instead of E3 <enabledWhen> expressions
In all the cases above, the problem remain the same, toolbar items enabled state only changes when the focus change to another view regardless of the variable/data update.
Using IEvaluationService.requestEvaluation("variable") or IEventBroker.send(UIEvents.REQUEST_ENABLEMENT_UPDATE_TOPIC, selector) solves the problems but this is manual work.
A relevant question here is: what is the intended behavior of enabled the state? Should it get updated automatically when the data changes or not? If no, why was it working before the update?
Here is a simple project that illustrates the issue sample.zip.
We updated the dependencies of an Eclipse RCP app from
2018-09to2025-06, and some toolbar items enabled state stopped getting updated automatically. The app is running on the compatibility layer and using custom source providers and<enabledWhen>expressions to control toolbar items handlers enabled state.The following solutions didn't solve the problem:
IEclipseContextdirectly instead of usingAbstractSourceProvidercanExecutemethod instead of E3<enabledWhen>expressionsIn all the cases above, the problem remain the same, toolbar items enabled state only changes when the focus change to another view regardless of the variable/data update.
Using
IEvaluationService.requestEvaluation("variable")orIEventBroker.send(UIEvents.REQUEST_ENABLEMENT_UPDATE_TOPIC, selector)solves the problems but this is manual work.A relevant question here is: what is the intended behavior of enabled the state? Should it get updated automatically when the data changes or not? If no, why was it working before the update?
Here is a simple project that illustrates the issue sample.zip.