|
|
|
|
Re: Cannot replace menu items at runtime [message #909674 is a reply to message #909161] |
Fri, 07 September 2012 14:51 |
|
Have you tried inspecting your running application model?
(Include 'org.eclipse.e4.tools.emf.liveeditor' in your launch config and its associated dependencies)
That'll atleast give you a little insight into what's there. Also, maybe instead of replacing the menu items, you replace their content. You could keep a separate stack of "most recent" files and just push new ones on to the stack.
When something new is pushed onto the stack, it triggers an update of the associated menu items. Thus, the menu items never change only their name and location property. You would even be able to keep the same handlers that just read the location.
Hopefully some of that helps.
Take care,
JD
helps if i include the plugin name
[Updated on: Fri, 07 September 2012 14:52] Report message to a moderator
|
|
|
|
Re: Cannot replace menu items at runtime [message #910446 is a reply to message #909606] |
Sun, 09 September 2012 17:50 |
Eclipse User |
|
|
|
Thomas Schindl wrote on Fri, 07 September 2012 14:00There should not - if this is not working it is a bug. The bad thing
about the menu and toolbar stuff is that the renderers are overly
complex because the compat story got mixed in there.
If you are in a pure e4 app you could maybe simply replace the renderers
for the menus through home grown ones. Should not be very hard for them.
I've just written a JavaFX-Renderer and Menus are the simplest of all
Tom
Am 07.09.12 13:49, schrieb Markus Wiederkehr:
> Hi Marco, thanks, I have already seen that thread but I don't think it
> helps with my problem. In my understanding the thread is about menu
> items not being saved to the workspace after they have been removed by
> the handler's cleanup method.
>
> My problem is about menu items not being affected when I modify the
> corresponding MMenu hierarchy in the workbench model at runtime.
>
> Perhaps the following is related to the problem: open the Application
> Model Editor in your Eclipse IDE (Shift-Alt-F9) and try to manipulate
> the model. For example when you change the orientation of a
> PartSashContainer from horizontal to vertical you immediately see the
> change taking effect. But when you try to change properties of the main
> menu the changes have no apparent effect.
>
> It looks like something else is needed to let the framework know that
> the workbench model has changed and the menus have to be rendered again.
Yeah I got really shocked to see the menu renderers complexity. Don't know if to blame SWT or 3x legacy.
|
|
|
|
Powered by
FUDForum. Page generated in 0.06538 seconds