This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 413590 - Close All doesn't work when a second editor is opened in another area in another perspective
Summary: Close All doesn't work when a second editor is opened in another area in anot...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.3   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.4 M3   Edit
Assignee: Eric Moffatt CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 400960 417122 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-07-24 00:10 EDT by Marc-André Laperle CLA
Modified: 2014-03-31 15:08 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marc-André Laperle CLA 2013-07-24 00:10:25 EDT
Using 4.3.0-I20130605-2000.

1. Open a Java source file in Java perspective
2. Change perspective (Debug for example)
3. Open a second source file
4. Drag the second file tab so that it gets opened in a second editor in it's own view (not in the same area)
5. Go back to Java perspective
6. Try to close all files (Ctrl+Shift+W). Files don't close.
Comment 1 Dani Megert CLA 2013-07-24 05:38:33 EDT
Can reproduce using latest 4.4 build.
Comment 2 Marc-André Laperle CLA 2013-08-02 02:32:40 EDT
Proposed fix:
https://git.eclipse.org/r/#/c/15079/

I am not completely sure about this fix since I don't know the semantics of some things. Basically, hidePart fails because it's called with local == true and partService.getParts() doesn't contain the second editor part. I'm not sure what the semantics of local or getParts are supposed to be but it seems to me that whether or not the part is local, it should be closed which is what this fix does.

I looked at PartServiceImpl.getParts and interestingly, it doesn't return all parts:
EModelService.OUTSIDE_PERSPECTIVE | EModelService.IN_ACTIVE_PERSPECTIVE	| EModelService.IN_SHARED_AREA

It seems like this is meant to be a "getVisibleParts" and there might be a wrong assumption that all editors will be in the shared area. But this is just a theory.
Comment 3 Paul Webster CLA 2013-08-12 12:45:07 EDT
Eric, could you take a look at this fix?  It's the case where the editor is outside the shared area.

PW
Comment 4 Marc-André Laperle CLA 2013-09-12 22:36:03 EDT
Eric? ;)
Comment 6 Eric Moffatt CLA 2013-09-24 14:49:25 EDT
BTW, I think this has also pointed out a bug in the 'findElements' API; the PartService's 'getParts' call is explicit that it should only look in the 'ACTIVE' perspective so it shouldn't really have even found the editor in the Debug perspective...

No problem for this but I'll open a defect to track down what's wrong in the find code (then change the part service to match..;-).
Comment 7 Krzysztof Kazmierczyk CLA 2013-10-24 11:31:41 EDT
*** Bug 417122 has been marked as a duplicate of this bug. ***
Comment 8 Eric Moffatt CLA 2013-10-29 13:12:52 EDT
Verified in 4.4.0.I20131028-2000.
Comment 9 Lars Vogel CLA 2014-03-31 15:08:13 EDT
*** Bug 400960 has been marked as a duplicate of this bug. ***