Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 378535 - "Close All" and "Close Others" menu options available when right clicking on tab in PartStack when no part is closeable
Summary: "Close All" and "Close Others" menu options available when right clicking on ...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.3 M4   Edit
Assignee: Eric Moffatt CLA
QA Contact:
URL:
Whiteboard: patch
Keywords:
: 394443 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-05-04 14:03 EDT by Sarah CLA
Modified: 2013-05-27 16:36 EDT (History)
5 users (show)

See Also:


Attachments
Patch that makes sure there are closeable sibling parts before adding Close All and Close Others options (5.76 KB, patch)
2012-05-04 14:04 EDT, Sarah CLA
no flags Details | Diff
Requested patch that does not have workbench changes using latest code (4.22 KB, patch)
2012-11-06 16:35 EST, Sarah CLA
curtis.windatt.public: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sarah CLA 2012-05-04 14:03:08 EDT
Build Identifier: I20110620-1631

If I create a PartStack that contains multiple parts but none of the parts are closeable, when I right click on any of the tabs I get menu options for "Close All" and "Close Others".  Selection of either of the menu options doesn't cause any tabs to be closed since none of the tabs can be closed.  I don't think the menu options should be available if none of the tabs can be closed.

I am attaching a patch that will prevent 

Reproducible: Always

Steps to Reproduce:
1. Create PartStack that contains multiple parts
2. Make sure none of the parts in the stack are marked as closeable.
3. Right click on any of the tabs.  A menu will be displayed even though none of the tabs can be closed.
Comment 1 Sarah CLA 2012-05-04 14:04:08 EDT
Created attachment 215089 [details]
Patch that makes sure there are closeable sibling parts before adding Close All and Close Others options
Comment 2 Sarah CLA 2012-06-26 17:05:29 EDT
Correcting platform
Comment 3 Eric Moffatt CLA 2012-11-06 15:53:39 EST
Sarah, good pickup ! However, your patch contains changes in to Workbench.java that appear to have no bearing on this defect...was this accidental ? 

If so could you update the patch based on the current source for StackRenderer ? I was going to apply it 'by hand' but I'm afraid of messing it up :-).
Comment 4 Sarah CLA 2012-11-06 16:35:46 EST
Created attachment 223276 [details]
Requested patch that does not have workbench changes using latest code

Here is the requested patch
Comment 5 Eric Moffatt CLA 2012-11-07 13:35:44 EST
Sarah, thanks for the quick response. I'll be committing the patch (thanks again!) since it's certainly better than what's there.

There was one thing I had to fix in the getCloseableSiblingParts...the handling for MPlaceholders didn't check the placeholder itself to see if it was 'toBeRendered', leading to issues in the eclipse IDE. Other than that it looks really good.
Comment 6 Eric Moffatt CLA 2012-11-07 13:50:19 EST
http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=3ca8456b51ad639447cf86250747e9c05ac972e6

Thanks Sarah...

It still has a glitch or two though, mostly in mixed stacks with some closeable and some not but it does cover off the case you've defined as we as being better overall. I'll mark this defect as fixed since it does address the 'all non-closeable' case nicely.
Comment 7 Paul Webster CLA 2012-11-16 07:14:15 EST
*** Bug 394443 has been marked as a duplicate of this bug. ***
Comment 8 Curtis Windatt CLA 2013-05-27 15:32:26 EDT
Not sure if changing the milestone to 4.4 was on purpose or by accident.  If this still requires additional work, I suggest cloning it.
Comment 9 Eric Moffatt CLA 2013-05-27 15:43:40 EDT
Curtis, are the 'glitches' I mentioned in Comment #6 no longer valid ? I was presuming that there were cases still left unhandled based on that comment (but I'd love to be wrong...;-).

If everything is working then we should be marking this as VERIFIED...
Comment 10 Curtis Windatt CLA 2013-05-27 16:36:15 EDT
(In reply to comment #9)
> Curtis, are the 'glitches' I mentioned in Comment #6 no longer valid ? I was
> presuming that there were cases still left unhandled based on that comment
> (but I'd love to be wrong...;-).
> 
> If everything is working then we should be marking this as VERIFIED...

No idea, but the bug was fixed in M4.  Marking the bug as 4.3.1 without even reopening isn't the right move :)  If the glitches warrant a 4.3.1 bug then a new bug report should be opened.