| Summary: | [Contributions] Changes in the application model for the menu are not reflected in the user interface | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Lars Vogel <Lars.Vogel> | ||||
| Component: | UI | Assignee: | Nobody - feel free to take it <nobody> | ||||
| Status: | VERIFIED FIXED | QA Contact: | Daniel Rolka <daniel.rolka> | ||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | bugs.eclipse.org, emoffatt, Lars.Vogel, nobody, pwebster, tom.schindl | ||||
| Version: | 4.3.1 | ||||||
| Target Milestone: | 4.4 M3 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | |||||||
| Bug Depends on: | 376254 | ||||||
| Bug Blocks: | |||||||
| Attachments: |
|
||||||
|
Description
Lars Vogel
This is really strange since it was one of the first responses we added and certainly worked at some point...What type of Menu(Item) was it? I ask because at least some of the UILabel info for a 'HandledItem' comes from the MCommand backing it... MenuItemRenderer (MenuItems) have an event handler that responds to model changes. MenuRenderer doesn't create an equivalent handler For the handled items, it should take the text from the model first, and the command name if the model doesn't set a label. That allows a local menu item to override it's name with extra information (About SDK Product as opposed to simply About, for example). PW Thank you. I used the contact example and the entry file. Screenshot attached. Created attachment 174144 [details]
Screenshot
I think Sopots should also fix that issue. @Sopot: Could you check if you patch in Bug 376254 also fixes this one and if, mark this one as duplicate? Sure, I will check this when I get home tonight. If this bug is related to the automatic processing of handlers it will likely be a duplicate. @Sopot: any news on your testing? Heck, this went off my radar. Thanks for reminding me. I will take a look soon (for real this time :). Not a duplicate from an initial test. I guess the problem is that the MenuRenderer doesn't define an updater at all, meanwhile my patch updates a handler if it is defined and context chagnes. Eric / Sopot, any hints what to do to make the menu react to changes in the application model? E4Workbench.processHierarchy has been removed by Bug 376254 Could you change the title back? If this is a problem, it's per-renderer (in this case the MenuManagerRenderer and maybe the HandledContributionItem). PW (In reply to Paul Webster from comment #12) > Could you change the title back? If this is a problem, it's per-renderer > (in this case the MenuManagerRenderer and maybe the HandledContributionItem). It's OK now, I didn't see the title change PW I'll take a stab. Thanks Sopot, applied with https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=1e515cb836966de51ea94bf3545746cd5e56fbd7 This fixes the case that the menu is changed. What is still open that if you add a new menu entry to a menu that this is also not changed. I leave this bug open for this, would be great if you can also have a look at that. I'll take a look at that as part of bug 391430. Thanks. I adjusted the title of Bug 391430 to cover menus in general. Marking this one as fixed. (In reply to Lars Vogel from comment #16) > Thanks Sopot, applied with > https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/ > ?id=1e515cb836966de51ea94bf3545746cd5e56fbd7 > This fix isn't correct. You need to update the MenuManager (which is the IContributionItem for a MMenu). It looks like this fix is simply doing an endrun by updating the SWT widget directly, which can be overriden by the information in the MenuManager at a later date. You might need to add API (carefully :-) to MenuManager to update the image. PW This direct access is the only way I found to change the text. I was supposing I should not touch MenuManager. So I should add API to the MenuManager to update the image ? Is there already API to tell the manager to change the text? ATM the only way its menuText field is mutated is through the constructor. Right, so you might have to consider adding setters for those 2 attributes, and then hook into the code that would update it (update(String) maybe)? PW (In reply to Paul Webster from comment #21) > Right, so you might have to consider adding setters for those 2 attributes, > and then hook into the code that would update it (update(String) maybe)? > > PW How does this look https://git.eclipse.org/r/18518 ? Released as http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=2567dba51f81fdcf892197c4eca533f3ce5fa57e PW Verified in I20140528-2000. |