Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Dynamic View Menu
Dynamic View Menu [message #792691] Tue, 07 February 2012 09:38 Go to next message
Thomas  Mäder is currently offline Thomas MäderFriend
Messages: 46
Registered: July 2009
Member
I'm trying to offer a view menu for a part which allows to save the current configuration of the part under a given name. Later, I'd like to be able to recall that configuration. The view menu looks like this:

Save...
-----------
Load > Config 1
       Config 2
       Config 3

I'm building the Load submenu from the configurations I get from a backend service. This works when I'm initially building the part, but when I change the part menu from the Save... DirectMenuItem handler, the Load submenu is not properly rebuilt.
I've tracked the problem down to the this code in StackRenderer:
		Object obj = menuModel.getWidget();
		if (obj instanceof Menu) {
			menu = (Menu) obj;
		}
		if (menu == null || menu.isDisposed()) {
                   ...build the menu from the model

, so the menu is never rebuilt. As I understand the "modeled workbench" concept, it should be sufficient to update the model, correct?

Any suggestions are welcome.
Re: Dynamic View Menu [message #792719 is a reply to message #792691] Tue, 07 February 2012 10:21 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5487
Registered: July 2009
Senior Member
Am 07.02.12 10:38, schrieb Thomas äder:
> I'm trying to offer a view menu for a part which allows to save the
> current configuration of the part under a given name. Later, I'd like to
> be able to recall that configuration. The view menu looks like this:
>
> Save...
> -----------
> Load > Config 1
> Config 2
> Config 3
>
> I'm building the Load submenu from the configurations I get from a
> backend service. This works when I'm initially building the part, but
> when I change the part menu from the Save... DirectMenuItem handler, the
> Load submenu is not properly rebuilt. I've tracked the problem down to
> the this code in StackRenderer:
>
> Object obj = menuModel.getWidget();
> if (obj instanceof Menu) {
> menu = (Menu) obj;
> }
> if (menu == null || menu.isDisposed()) {
> ...build the menu from the model
>
> , so the menu is never rebuilt. As I understand the "modeled workbench"
> concept, it should be sufficient to update the model, correct?
>

Yes - all model changes should be reflected in the UI.

Would you be able to make a small test part and submit a bug report?

Tom
Re: Dynamic View Menu [message #792781 is a reply to message #792719] Tue, 07 February 2012 12:01 Go to previous message
Thomas  Mäder is currently offline Thomas MäderFriend
Messages: 46
Registered: July 2009
Member
Done:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=370811
Previous Topic:E4 application accessibility question
Next Topic:Discouraged Access
Goto Forum:
  


Current Time: Fri Dec 19 02:24:13 GMT 2014

Powered by FUDForum. Page generated in 0.11661 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software