Fix toolbar items enabled state not updating automatically (#3953)#4073
Open
EdrilanBerisha wants to merge 5 commits into
Open
Fix toolbar items enabled state not updating automatically (#3953)#4073EdrilanBerisha wants to merge 5 commits into
EdrilanBerisha wants to merge 5 commits into
Conversation
…latform#3953) When an AbstractSourceProvider fires fireSourceChanged(), the EvaluationService contextUpdater listener was updating the legacy expression context variable but never sending REQUEST_ENABLEMENT_UPDATE_TOPIC on the event broker. As a result, ToolBarManagerRenderer (which listens for that topic) was never notified, so toolbar items relying on custom source providers with enabledWhen expressions stayed frozen until a focus change accidentally triggered an update. Fix: send REQUEST_ENABLEMENT_UPDATE_TOPIC after each source change originating from a registered ISourceProvider (both single-variable and multi-variable variants). This makes the toolbar enablement update automatic and consistent with requestEvaluation() and the RAT updater, which already send this event. Tests: added two regression tests to EvaluationServiceTest: - testSourceProviderFiresEnablementUpdateEvent: verifies that a single-variable fireSourceChanged() sends REQUEST_ENABLEMENT_UPDATE_TOPIC - testSourceProviderMultiVarFiresEnablementUpdateEvent: verifies the same for the multi-variable (Map) form of the source change Fixes: eclipse-platform#3953
|
Hi @EdrilanBerisha — thank you for your contribution! The Eclipse Contributor Agreement (ECA) check has failed for this pull request due to one of the following reasons:
To resolve this, please:
Once done, push a new commit (or rebase) to re-trigger the ECA validation. If you believe you've already completed these steps, please double-check your account settings or report an issue to Eclipse Foundation Helpdesk. Thanks again for your contribution! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
this PR fixes: #3953
When an AbstractSourceProvider fires fireSourceChanged(), the EvaluationService contextUpdater listener was updating the legacy expression context variable but never sending REQUEST_ENABLEMENT_UPDATE_TOPIC on the event broker.
As a result, ToolBarManagerRenderer (which listens for that topic) was never notified, so toolbar items relying on custom source providers with enabledWhen expressions stayed frozen until a focus change accidentally triggered an update
Fix: send REQUEST_ENABLEMENT_UPDATE_TOPIC after each source change originating from a registered ISourceProvider (both single-variable and multi-variable variants). This makes the toolbar enablement update automatic and consistent with requestEvaluation() and the RAT updater, which already send this event.
Tests: added two regression tests to EvaluationServiceTest: