This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 318435 - [Contributions] Changes in the application model for the menu are not reflected in the user interface
Summary: [Contributions] Changes in the application model for the menu are not reflect...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.3.1   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 4.4 M3   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact: Daniel Rolka CLA
URL:
Whiteboard:
Keywords:
Depends on: 376254
Blocks:
  Show dependency tree
 
Reported: 2010-06-30 06:50 EDT by Lars Vogel CLA
Modified: 2014-06-04 11:38 EDT (History)
6 users (show)

See Also:


Attachments
Screenshot (17.11 KB, image/gif)
2010-07-13 09:48 EDT, Lars Vogel CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2010-06-30 06:50:41 EDT
If I use Toms live model editor to change the label of a menu this change is not reflected in the running app.
Comment 1 Eric Moffatt CLA 2010-07-13 09:35:42 EDT
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...
Comment 2 Paul Webster CLA 2010-07-13 09:40:11 EDT
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
Comment 3 Lars Vogel CLA 2010-07-13 09:48:31 EDT
Thank you.

I used the contact example and the entry file. Screenshot attached.
Comment 4 Lars Vogel CLA 2010-07-13 09:48:46 EDT
Created attachment 174144 [details]
Screenshot
Comment 5 Lars Vogel CLA 2012-08-15 07:06:51 EDT
I think Sopots should also fix that issue.
Comment 6 Lars Vogel CLA 2012-08-15 07:08:03 EDT
@Sopot: Could you check if you patch in Bug 376254 also fixes this one and if, mark this one as duplicate?
Comment 7 Nobody - feel free to take it CLA 2012-08-15 07:26:15 EDT
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.
Comment 8 Lars Vogel CLA 2012-09-18 14:19:27 EDT
@Sopot: any news on your testing?
Comment 9 Nobody - feel free to take it CLA 2012-09-18 17:49:10 EDT
Heck, this went off my radar. Thanks for reminding me. I will take a look soon (for real this time :).
Comment 10 Nobody - feel free to take it CLA 2012-10-15 09:46:25 EDT
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.
Comment 11 Lars Vogel CLA 2013-10-09 16:28:06 EDT
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
Comment 12 Paul Webster CLA 2013-10-09 16:33:17 EDT
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
Comment 13 Paul Webster CLA 2013-10-09 16:34:56 EDT
(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
Comment 14 Nobody - feel free to take it CLA 2013-11-13 04:23:30 EST
I'll take a stab.
Comment 15 Nobody - feel free to take it CLA 2013-11-15 03:50:51 EST
https://git.eclipse.org/r/#/c/18419/
Comment 16 Lars Vogel CLA 2013-11-18 04:40:48 EST
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.
Comment 17 Nobody - feel free to take it CLA 2013-11-18 05:20:48 EST
I'll take a look at that as part of bug 391430.
Comment 18 Lars Vogel CLA 2013-11-18 05:23:12 EST
Thanks. I adjusted the title of Bug 391430 to cover menus in general. Marking this one as fixed.
Comment 19 Paul Webster CLA 2013-11-18 09:43:07 EST
(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
Comment 20 Nobody - feel free to take it CLA 2013-11-18 10:18:34 EST
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.
Comment 21 Paul Webster CLA 2013-11-18 10:24:22 EST
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
Comment 22 Nobody - feel free to take it CLA 2013-11-18 13:36:09 EST
(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 ?
Comment 24 Wojciech Sudol CLA 2014-06-04 11:38:52 EDT
Verified in I20140528-2000.