| Summary: | NPE in SashLayout.adjustWeights() when re-opening a closed window | ||
|---|---|---|---|
| Product: | [Eclipse Project] e4 | Reporter: | Brian de Alwis <bsd> |
| Component: | UI | Assignee: | Project Inbox <e4.ui-inbox> |
| Status: | RESOLVED WORKSFORME | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | stalebug | ||
Similar problem; reopen a closed MUIElement opens the window/Dialog bug don't repaint the parts. windows.getChildren() still contains the partStack and the parts partially workaround:
close the window with a button
MWindow window
...
btnExit.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
window.setToBeRendered(false);
}
});
reopen it:
@Execute
public static void execute(final MApplication application,
final EModelService ms) {
MUIElement e = ms.find("...yourWindowID",application);
e.setToBeRendered(true);
e.setOnTop(true);
}
unfortunately, if the user closes the window with Alt-F4 or the close-Button from the window, the problem remains.
To hide the window-close-Button you had to override the renderer. Heard this wouldn't be very complex.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. This is a mass change to close all e4 bugs marked with "stalebug" whiteboard. If this bug is still valid, please reopen and remove the "stalebug" keyword. |
Build: 4.1M4 On a Windows 7 machine, having closed a TrimmedWindow (through the window manager), I then try to reopen the window with: @Inject @Optional IPresentationEngine engine; public MWindow open(MApplication app, MWindow window) { window.setToBeRendered(true); window.setVisible(true); app.setSelectedElement(window); if(window.getRenderer() == null && engine != null) { engine.createGui(window); } app.setSelectedElement(window); return window; } But what was the previously active perspective no longer renders -- it's just a blank canvas. The perspective is a simple PartSashContainer with some parts. The sash locations are still draggable, though there's nothing visible. Dragging the sash throws an NPE as the leftRect is null. Interestingly, the rightRect is not null. Thread [main] (Suspended (exception NullPointerException)) SashLayout.adjustWeights(List<SashRect>, int, int) line: 170 SashLayout$2.mouseMove(MouseEvent) line: 88 TypedListener.handleEvent(Event) line: 205 EventTable.sendEvent(Event) line: 84 Composite(Widget).sendEvent(Event) line: 1053 Display.runDeferredEvents() line: 4084 Display.readAndDispatch() line: 3675 PartRenderingEngine$6.run() line: 808 Realm.runWithDefault(Realm, Runnable) line: 332 PartRenderingEngine.run(MApplicationElement, IEclipseContext) line: 724 E4Workbench.createAndRunUI(MApplicationElement) line: 89 E4Application.start(IApplicationContext) line: 131 Application.start(IApplicationContext) line: 62 EclipseAppHandle.run(Object) line: 196 EclipseAppLauncher.runApplication(Object) line: 110 EclipseAppLauncher.start(Object) line: 79 EclipseStarter.run(Object) line: 369 EclipseStarter.run(String[], Runnable) line: 179 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: 622 Main.basicRun(String[]) line: 577 Main.run(String[]) line: 1410