DESCRIPTION

Bug 391430 - Dynamically creating / deleting menu items in Menu and MPopupMenu doesn't work

Reactivate the fix of Sopot and modify it so it can handle the remove
and add of many elements. Additionally the determination of the insert
index changes so it can handle the differences between MenuManager and
E4 model.

Change-Id: I800574190347c0f94e4a2d951bb7611ab73cc9e3
Signed-off-by: Jaydon Logan xxx@xxx.xxx


COMMENTS

author: Brenden Conley
date: 2014-03-31 10:01:59.000000000

Patch Set 3:

Build Started https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/1637/

-------------------------------------
author: Brenden Conley
date: 2014-03-31 10:16:47.000000000

Patch Set 3: Verified+1

Build Successful 

https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/1637/ : SUCCESS

-------------------------------------
author: Jaydon Logan
date: 2014-04-01 07:38:41.000000000

Patch Set 3:

Hi Sopot,

I've added an updated version of your sample project to the Bug (https://bugs.eclipse.org/bugs/attachment.cgi?id=241415). So you don't have to find your old sample project and upgrade it.

Regards
  René

-------------------------------------
author: Chase Horton
date: 2014-04-01 08:23:58.000000000

Patch Set 3:

Thanks Rene. I'll take a look a bit later today.

-------------------------------------
author: Chase Horton
date: 2014-04-01 21:13:37.000000000

Patch Set 3: Code-Review-1

I took a look and I have some concerns.

Through the live editor I did some tests on the original test project. The main menu of the window doesn't seem to respond to additions or removals. If you add a MMenu to the main menu it doesn't add it.

Also, wouldn't it be better to use UIEvents.asIterable to handle ADD ALL/REMOVE ALL scenarios in the event handler rather than adding your own method?

-------------------------------------
author: Jaydon Logan
date: 2014-04-02 05:30:53.000000000

Patch Set 3:

Hi,

I will take a look at that tonight.
Thanks for the hint, I didn't know the UIEvents.asIterable() method.

René

-------------------------------------
author: Jaydon Logan
date: 2014-04-02 18:04:38.000000000

Patch Set 3:

Hi,

I started to check the reason for the add/remove problem you mentioned, but I think the problem is related to the nature of the LiveEditor. The LiveEditor adds the Menu/MenuItem immediately which means that they aren't complete (e.g.: MenuItems don't have a Label and so they aren't visible at the beginning, HandledMenuItems don't have a command associated with them and so they aren't created correctly, Menu's don't have any child's and so the MenuManager doesn't create any MenuItem for them, ...).

Tomorrow I will check if this also happens with correctly created Menu-Modelelements or only with those "incorrect" Menu-Modelelements. If this only happens with the incorrect Menu-Modelelements we have to make a decision if it's worth to handle those as well.

René

-------------------------------------
