DESCRIPTION

Bug 437747 - A part's view menu does not work after opening the menu,
closing the part, and then reopening the part

Change-Id: I58bc5f7b4ddc2be7afba9e0d0d2f535cea2fc4aa
Signed-off-by: Arturo Copeland xxx@xxx.xxx

COMMENTS

author: Zaid Mosley
date: 2014-07-23 17:42:21.000000000

Uploaded patch set 4.

-------------------------------------
author: Brenden Conley
date: 2014-07-23 18:07:32.000000000

Patch Set 4:

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

-------------------------------------
author: Brenden Conley
date: 2014-07-23 18:16:41.000000000

Patch Set 4: Verified+1

Build Successful 

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

-------------------------------------
author: Zaid Mosley
date: 2014-07-23 18:34:52.000000000

Patch Set 4:

Should that not be handled by MenuManagerRenderer?

-------------------------------------
author: Arturo Copeland
date: 2014-07-23 19:25:09.000000000

Patch Set 4:

I don't know why the menu manager is not disposed along with the menu.   But it hangs around for some reason, and the dirty flag is its responsibility.

-------------------------------------
author: Zaid Mosley
date: 2014-07-23 20:03:23.000000000

Patch Set 4:

MenuManagerRenderer already set a dispose listener in createWidget. I guess the cleanUp method might be incorrect.

-------------------------------------
author: Arturo Copeland
date: 2014-07-23 20:15:05.000000000

Patch Set 4:

I could not determine if this was by design or not.  After a silly amount of time I came to the conclusion that there was less chance of breaking something by just clearing the dirty flag.

This fixes all of my issues, so perhaps we mark it as a work around until we can test other options?

Using E4 menus in parts is really going to discourage adopters if this is not fixed.

-------------------------------------
author: Zaid Mosley
date: 2014-07-25 05:42:59.000000000

Patch Set 4: Code-Review+1 Verified+1

Eric or Paul can you have a look? This fix from Steven works but I'm not sure if this is the "right" way of doing it. We should fix this for 4.4.1 as it affects RCP adapters.

-------------------------------------
author: Sebastian Porter
date: 2014-07-25 09:09:36.000000000

Patch Set 4: Code-Review-1

This doesn't look like the right fix to me. The MenuManager either manages a non-dynamic context menu (#createContextMenu) or a possible dynamic one via #fill((Menu,int). For the former, the menu should not change and for the latter, setDirty(true) is called after the menu is shown.

Maybe a call to #update is missing? Maybe something is wrong in the workflow that involves DirectContributionItem or the menu manger under pure e4?


Note that the fix also causes useless calls: during update, the menu items are disposed and then the dirty state is set to 'false'. With the suggested patch, the dirty state is changed during the update call.

-------------------------------------
author: Slade Moran
date: 2014-07-25 09:46:55.000000000

Patch Set 4: Code-Review-1

I agree with Dani, the MenuManager is not the correct place to fix this.  There must be something wrong with the re-open/re-create cycle of the part's view menu

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