Home » Eclipse Projects » Eclipse 4 » Menu shows only with -clearPersistedState
| Menu shows only with -clearPersistedState [message #997140] |
Thu, 03 January 2013 17:37  |
Frank Benoit Messages: 44 Registered: July 2009 |
Member |
|
|
Hi
when I run my application with compatibility layer with the argument -clearPersistedState it shows the menu, without the menu is no more shown.
I use a TrimmedWindow with Main Menu.
When I look at the
.metadata\.plugins\org.eclipse.e4.workbench\workbench.xmi the "mainMenu" element is missing.
I am using Eclipse 4.2.1 and e4 tools 0.12.
Is this a bug or is there something that I missed?
thanks
Frank
|
|
| | | | | | | |
| Re: Menu shows only with -clearPersistedState [message #1003939 is a reply to message #1003179] |
Tue, 22 January 2013 04:32   |
Frank Benoit Messages: 44 Registered: July 2009 |
Member |
|
|
Hi Sopot,
thanks for the hints. So far I did insert the breakpoint and find that the application break at close.
The MWindowImpl.setMainMenu is called with null, and the workbench.xmi is written afterwards without the main menu element.
At that time, this is the call stack:
Thread [main] (Suspended (breakpoint at line 511 in WindowImpl))
TrimmedWindowImpl(WindowImpl).setMainMenu(MMenu) line: 511
WorkbenchWindow$1.handleEvent(Event) line: 286
UIEventHandler$1.run() line: 41
UISynchronizer(Synchronizer).syncExec(Runnable) line: 180
UISynchronizer.syncExec(Runnable) line: 150
Display.syncExec(Runnable) line: 4687
E4Application$1.syncExec(Runnable) line: 187
UIEventHandler.handleEvent(Event) line: 38
EventHandlerWrapper.handleEvent(Event, Permission) line: 197
EventHandlerTracker.dispatchEvent(EventHandlerWrapper, Permission, int, Event) line: 197
EventHandlerTracker.dispatchEvent(Object, Object, int, Object) line: 1
EventManager.dispatchEvent(Set, EventDispatcher, int, Object) line: 230
ListenerQueue.dispatchEventSynchronous(int, Object) line: 148
EventAdminImpl.dispatchEvent(Event, boolean) line: 135
EventAdminImpl.sendEvent(Event) line: 78
EventComponent.sendEvent(Event) line: 39
EventBroker.send(String, Object) line: 81
UIEventPublisher.notifyChanged(Notification) line: 58
TrimmedWindowImpl(BasicNotifierImpl).eNotify(Notification) line: 374
TrimmedWindowImpl(UIElementImpl).setWidget(Object) line: 248
WBWRenderer(SWTPartRenderer).unbindWidget(MUIElement) line: 114
WBWRenderer(SWTPartRenderer).disposeWidget(MUIElement) line: 135
PartRenderingEngine.safeRemoveGui(MUIElement) line: 847
PartRenderingEngine.access$3(PartRenderingEngine, MUIElement) line: 775
PartRenderingEngine$8.run() line: 770
SafeRunner.run(ISafeRunnable) line: 42
PartRenderingEngine.removeGui(MUIElement) line: 755
PartRenderingEngine.stop() line: 1081
Workbench.busyClose(boolean) line: 1121
Workbench.access$16(Workbench, boolean) line: 1001
Workbench$17.run() line: 1182
BusyIndicator.showWhile(Display, Runnable) line: 70
Workbench.close(int, boolean) line: 1180
Workbench.close() line: 1153
WorkbenchWindow.busyClose(boolean) line: 1164
WorkbenchWindow.access$14(WorkbenchWindow, boolean) line: 1137
WorkbenchWindow$10.run() line: 1193
BusyIndicator.showWhile(Display, Runnable) line: 70
WorkbenchWindow.close(boolean) line: 1191
WorkbenchWindow.close() line: 1203
WorkbenchWindow$6.close(MWindow) line: 446
WBWRenderer$11.shellClosed(ShellEvent) line: 575
TypedListener.handleEvent(Event) line: 98
EventTable.sendEvent(Event) line: 84
Shell(Widget).sendEvent(Event) line: 1053
Shell(Widget).sendEvent(int, Event, boolean) line: 1077
Shell(Widget).sendEvent(int, Event) line: 1062
Shell(Decorations).closeWidget() line: 309
Shell(Decorations).WM_CLOSE(int, int) line: 1694
Shell(Control).windowProc(int, int, int, int) line: 4530
Shell(Canvas).windowProc(int, int, int, int) line: 341
Shell(Decorations).windowProc(int, int, int, int) line: 1627
Shell.windowProc(int, int, int, int) line: 2069
Display.windowProc(int, int, int, int) line: 4976
OS.DefWindowProcW(int, int, int, int) line: not available [native method]
OS.DefWindowProc(int, int, int, int) line: 2541
Shell.callWindowProc(int, int, int, int) line: 498
Shell(Control).windowProc(int, int, int, int) line: 4623
Shell(Canvas).windowProc(int, int, int, int) line: 341
Shell(Decorations).windowProc(int, int, int, int) line: 1627
Shell.windowProc(int, int, int, int) line: 2069
Display.windowProc(int, int, int, int) line: 4976
OS.DefWindowProcW(int, int, int, int) line: not available [native method]
OS.DefWindowProc(int, int, int, int) line: 2541
Shell.callWindowProc(int, int, int, int) line: 498
Shell(Control).windowProc(int, int, int, int) line: 4623
Shell(Canvas).windowProc(int, int, int, int) line: 341
Shell(Decorations).windowProc(int, int, int, int) line: 1627
Shell.windowProc(int, int, int, int) line: 2069
Display.windowProc(int, int, int, int) line: 4976
OS.DispatchMessageW(MSG) line: not available [native method]
OS.DispatchMessage(MSG) line: 2546
Display.readAndDispatch() line: 3756
PartRenderingEngine$9.run() line: 1029
Realm.runWithDefault(Realm, Runnable) line: 332
PartRenderingEngine.run(MApplicationElement, IEclipseContext) line: 923
E4Workbench.createAndRunUI(MApplicationElement) line: 86
Workbench$5.run() line: 588
Realm.runWithDefault(Realm, Runnable) line: 332
Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 543
PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 149
Application.start(IApplicationContext) line: 48
EclipseAppHandle.run(Object) line: 196
EclipseAppLauncher.runApplication(Object) line: 110
EclipseAppLauncher.start(Object) line: 79
EclipseStarter.run(Object) line: 353
EclipseStarter.run(String[], Runnable) line: 180
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: not available
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: not available
Method.invoke(Object, Object...) line: not available
Main.invokeFramework(String[], URL[]) line: 629
Main.basicRun(String[]) line: 584
Main.run(String[]) line: 1438
Main.main(String[]) line: 1414
The direct calling code in WorkbenchWindow$1.handleEvent(Event) line: 286 looks like this:
MMenu menu = model.getMainMenu();
if (menu != null) {
engine.removeGui(menu);
model.setMainMenu(null);
}
In the debugger, I changed the passed argument (null) to have the value of the existing menu. The result is a workbench.xmi which contains the main menu.
Any further hint how I can make the workbench not to remove the main menu.
Frank
|
|
| | | |
| Re: Menu shows only with -clearPersistedState [message #1110364 is a reply to message #1100752] |
Mon, 16 September 2013 15:46  |
Eric Moffatt Messages: 61 Registered: July 2009 |
Member |
|
|
For reference here's the comment that helped with this issue:
"Frank, perhaps it's just a case of starting with a cut-down copy of the LegacyIDE.xmi ? For example the compatibility code has expectations like the main menu having the elementId "org.eclipse.ui.main.menu"...
You might try by creating a new starting model for your app from an initial copy of the LegacyIDE and cutting out some stuff (but leaving the ids in place).."
Basically, we're reliant on the ids of trim bars and such for the compat layer to work.
|
|
|
Goto Forum:
Current Time: Mon Oct 07 15:29:25 EDT 2013
Powered by FUDForum. Page generated in 0.01986 seconds
|