Bug 358165 - [ViewMgmt] Stacked Views do not honor Extension Point (restorable=“false”)
Summary: [ViewMgmt] Stacked Views do not honor Extension Point (restorable=“false”)
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2011-09-19 22:13 EDT by Marco Lopes CLA
Modified: 2019-11-14 03:50 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marco Lopes CLA 2011-09-19 22:13:28 EDT
Build Identifier: Indigo Release 20110609-2236

In the Extension Points, define a vew NOT restorable.

 <view
            id="..."
            name="..."
            class="..."
            allowMultiple="true"
            restorable="false">
    </view>

All the views that are "stacked" (minimized) are NOT closed when the workbench closes

Manually closing the views causes undesired effects on ISaveablePart2

Reproducible: Always

Steps to Reproduce:
1. Define a "restorable=false" view Extension point
2. Run app and MINIMIZE view
3. Restart app
4. The minimized view is restored with the workbench

This does not happen with maximized views.
Comment 1 Marco Lopes CLA 2011-09-19 22:31:40 EDT
I use a workaround: manually close the views

public static void hideViews(IWorkbenchPage page) {
    //list of views VISIBLE on this page
    IViewReference[] views=page.getViewReferences();
    for(int i=0; i<views.length; i++) {
        //hide view
    }
}

but this triggers the promptToSaveOnClose on ISaveablePart2
that was already called by the closing workbench (i assume)
Comment 2 Marco Lopes CLA 2011-09-19 23:39:54 EDT
Implemented a workaround to avoid the "double" question on promptToSaveOnClose

	public int promptToSaveOnClose() {
		if (PlatformUI.getWorkbench().isClosing())
			return ISaveablePart2.CANCEL;
		...
	}

So, a nice workaround:
1) Closing the views manually
2) A promptToSaveOnClose method that avoids the prompt when the workbench is closing

It will work for now, until you verify the BUG.
Comment 3 Remy Suen CLA 2011-09-22 09:05:58 EDT
Certainly sounds like a bug to me, Marco.

I have fixed this in the 4.x stream. See bug 358578.
Comment 4 Lars Vogel CLA 2019-11-14 03:50:54 EST
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.

If the bug is still relevant, please remove the "stalebug" whiteboard tag.