Project: Eclipse_Platform_UI
Bug 65606 [ViewMgmt] IPerspectiveListener2 is notified too late
Reported: 2004-06-03 15:26:33 | Status: verified fixed

When a view is hidden, the new IPerspectiveListener2 listeners are notified after dispose events have been received. This affects the DisplayView, which wants to persist its contents on closure. The events look like so: 1. IPartListener notified. 2. The ViewPane's DisposeListeners notified. 3. IPerspectiveListener2 notified. This means that by the time IPerspectiveListener2 hears about the view being closed, important state can already be lost. In the case of the DisplayView, we have a TextListener which deletes its document in response to the dispose. This prevents us from accessing the view contents to persist them. The code in question looks like it's in WorkbenchPage: private void hideView(Perspective persp, IViewReference ref) { // Hide the part. persp.hideView(ref); // Notify interested listeners window.firePerspectiveChanged(this, getPerspective(), ref, CHANGE_VIEW_HIDE); ... } Would it make any sense to just reorder these lines?

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java