Community
Participate
Working Groups
Deleting an open perspective should close it prior to deletion. As exemplified below, strange effects can occur if the perspective is not closed first. BTW: Deleting a perspective in the preferences is far from intuitive. I'd rather rename Window > Open Perspective > Other... to Manage... and add a Delete button in the Select Perspective dialog. (see also http://bugs.eclipse.org/bugs/show_bug.cgi?id=6018 ) Eclipse Version: 2.0.1 Build id: 200208291828 Steps to Reproduce: - Open Java Perspective - Window > Save Perspective As ... : enter "Java2" - Window > Preferences - go to Workbench, Perspectives - select "Java2" from list - click Delete button - click OK Java2 Perspective is still active, but doesn't appear in Window > Open Perspective - Window > Open Perspective > Java - Switch back to Java2 Perspective (by using the Shortcut Bar) Note: Java2 reappears in Open Perspective submenu! - Window > Close Perspective - Window > Open Perspective > Java2 Bang! NPE because of invalid (deleted) perspective. Workbench Window Toolbar gets cleared, etc. Eclipse restart required. !ENTRY org.eclipse.ui 4 4 Sep 04, 2002 10:54:23.737 !MESSAGE Unhandled exception caught in event loop. !ENTRY org.eclipse.ui 4 0 Sep 04, 2002 10:54:23.757 !MESSAGE java.lang.NullPointerException !STACK 0 java.lang.NullPointerException at org.eclipse.ui.internal.Perspective.loadPredefinedPersp(Perspective.java:616) at org.eclipse.ui.internal.Perspective.createPresentation(Perspective.java:233) at org.eclipse.ui.internal.Perspective.<init>(Perspective.java:133) at org.eclipse.ui.internal.WorkbenchPage.createPerspective(WorkbenchPage.java:840) at org.eclipse.ui.internal.WorkbenchPage.busySetPerspective(WorkbenchPage.java:527) at org.eclipse.ui.internal.WorkbenchPage.access$6(WorkbenchPage.java:522) at org.eclipse.ui.internal.WorkbenchPage$11.run(WorkbenchPage.java:2234) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:66) at org.eclipse.ui.internal.WorkbenchPage.setPerspective(WorkbenchPage.java:2232) at org.eclipse.ui.internal.ChangeToPerspectiveMenu.run(ChangeToPerspectiveMenu.java:57) at org.eclipse.ui.actions.PerspectiveMenu.run(PerspectiveMenu.java:305) at org.eclipse.ui.actions.PerspectiveMenu$2.widgetSelected(PerspectiveMenu.java:93) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:87) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:77) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:833) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1622) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1368) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1256) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1239) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:775) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:462) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.eclipse.core.launcher.Main.basicRun(Main.java:247) at org.eclipse.core.launcher.Main.run(Main.java:703) at org.eclipse.core.launcher.Main.main(Main.java:539)
Released fix in the HEAD stream. Fix is in PerspectivesPreferencePage
Reopening PR. Following the original steps below, when I hit the Delete button, it disappears from the list, but then complains when I try to close the preferences dialog. The error dialog may be confusing at this time, because the user may have switched to another page. Having to cancel may lose other changes they've made. Recommend complaining that the perspective cannot be deleted immediately, and leaving it in the list. This is preferable to simply disabling the delete button, since this way you get an explanation.
I agree completely with Nick's statement. The complaining dialog could also ask whether Eclipse should simply close the perspective and then delete it.
*** Bug 26720 has been marked as a duplicate of this bug. ***
Reassigning bugs in component areas that are changing ownership.
Is this still a problem in 3.3? PW
The delete button now shows an "Unable to delete perspective" dialog when the perspective is still in use. This forces the user to leave the preference dialog, close the perspective(s) manually, reopen the dialog, select the perspective again, delete the perspective again. The original request was to close the perspective before deleting it. Best would be if the dialog asked "Are you sure you want to delete Perspective 'Java2'? It has open instances." and then closes the perspective before deleting it.
+1 for the suggested behaviour.
Created attachment 79030 [details] Patch to implement the suggested behaviour.
Paul, you mentioned to me that I should wait for bug 203631 to be closed before providing a patch, as you can see, I didn't. Do you want me to respin a patch using the handler or are you fine with me using IWorkbenchPage's closePerspective method?
Released to HEAD >20071130 PW
In I20071211-0010 PW
*** Bug 213738 has been marked as a duplicate of this bug. ***
*** Bug 85501 has been marked as a duplicate of this bug. ***