Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 357782

Summary: PartActivationHistory does not select proper activation candidate for part stacks
Product: [Eclipse Project] Platform Reporter: Dean Roberts <dean.t.roberts>
Component: UIAssignee: Platform-UI-Inbox <Platform-UI-Inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: remy.suen
Version: 4.2   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: stalebug
Bug Depends on:    
Bug Blocks: 340875    

Description Dean Roberts CLA 2011-09-15 08:05:49 EDT
There are two instances where PartActivationHistory selects an inappropriate candidate.  They are somewhat related, so I've only opened one defect.

Case 1:

1)Minimize the Problems/Javadoc/Declarations stack to a vast view
2)Open the problems fast view
3)Select the Javadoc then the Declarations tag
4) Close the declarations tab by clicking the close button on its TAB

Expected result: JavaDoc tab activates
Current result: Fast view closes

The problem is that PartActivationHistory.findActivationCandidate(Collection, MPart) only considers "valid" parts. And a part is not "valid" if it or any the elements in its parent chain are not visible.  

In this case, the minimized MPartStack containing the tabs is NOT visible.  The PartActivationHistory ends up returning a candidate outside the fast view which gets activated, causing the fast view to close.

This also explains why activation behaves as expected when the Problems view stack is NOT minimized.  Since everything in the stack is visible, an appropriate candidate is selected.
Comment 1 Dean Roberts CLA 2011-09-15 08:12:05 EDT
Case 2:

To see this case in action you would actually need the patches for the bug 340875 chain applied.

1) Open at least 2 editors
2) Minimize the editor area
3) Open the editor area fast view
4) Select each of the editor tabs
5) Press the editor area fast view tool bar button to close the editor area

Expected: Editor area fast view closes

Current: The penulutimate activated editor becomes active.

This behaviour, different from case 1, is happening because there is code in PartActivationHistory.getNextActivationCandidate(Collection, MPart) that handles MAreas as a special case.  The MArea code does NOT call findActeivationCandidate(Collectin, MPart) as Case 1 does, so does not consider the validity of the parts when returning a candidate.

The problem is that if we consider validity in the MArea case, then the editor area will begin to exhibit the problem described in Case 1.
Comment 2 Lars Vogel CLA 2019-11-14 03:24:12 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.