Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 311163 - StackRenderer randomly selects the first tab if it has no selection
Summary: StackRenderer randomly selects the first tab if it has no selection
Status: RESOLVED FIXED
Alias: None
Product: e4
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 1.0   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 1.0 RC1   Edit
Assignee: Project Inbox CLA
QA Contact: Eric Moffatt CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-30 08:23 EDT by Remy Suen CLA
Modified: 2010-06-25 09:56 EDT (History)
0 users

See Also:


Attachments
Tests patch to reproduce the problem (5.56 KB, patch)
2010-04-30 08:25 EDT, Remy Suen CLA
no flags Details | Diff
Make bringToTop set the selected element *before* setting the TBR (1.29 KB, patch)
2010-06-22 11:41 EDT, Eric Moffatt CLA
no flags Details | Diff
Revert the previous fix and replace it (2.05 KB, patch)
2010-06-25 09:55 EDT, Eric Moffatt CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Remy Suen CLA 2010-04-30 08:23:39 EDT
1. Make a part stack that's not to be rendered and children that's also not to be rendered.
2. Render it, it will automatically select the first child.

1. Make a part stack that's not to be rendered and children that's also not to be rendered.
2. Set the second child to be rendered.
3. Set the stack to be rendered, it will automatically select the first child.
Comment 1 Remy Suen CLA 2010-04-30 08:25:27 EDT
Created attachment 166604 [details]
Tests patch to reproduce the problem

This has the effect of showing two tabs (the first and the desired tab) when you bring a stack back in the compatibility layer.
Comment 2 Remy Suen CLA 2010-04-30 08:30:57 EDT
Forgot to mention where the suspect code is in:

org.eclipse.e4.workbench.ui.renderers.swt.LazyStackRenderer
-postProcess(MUIElement)
Comment 3 Remy Suen CLA 2010-05-03 07:54:30 EDT
(In reply to comment #0)
> 3. Set the stack to be rendered, it will automatically select the first child.

The test checks that the second child is rendered. This may or may not be correct. But logically, it should either have nothing selected or the second child selected. Autoselecting the first child doesn't make any sense.
Comment 4 Remy Suen CLA 2010-06-21 09:22:54 EDT
You can observe this problem quite easily in your 4.0 SDK.

1. Start Eclipse.
2. Close the 'Problems', 'Javadoc', and 'Declaration' view.
3. Ctrl+3 > Javadoc
4. The 'Javadoc' view comes back but the 'Problems' view can also be seen in the tab folder.
5. Oddly enough, if you close the 'Javadoc' view, the entire stack will disappear!
Comment 5 Eric Moffatt CLA 2010-06-21 10:44:06 EDT
Still there, marking for a look in EC1.
Comment 6 Eric Moffatt CLA 2010-06-22 11:41:51 EDT
Created attachment 172433 [details]
Make bringToTop set the selected element *before* setting the TBR
Comment 7 Eric Moffatt CLA 2010-06-22 11:43:03 EDT
Committed in >20100622. Applied the patch.
Comment 8 Eric Moffatt CLA 2010-06-25 09:55:49 EDT
Created attachment 172751 [details]
Revert the previous fix and replace it


This fix does not mess with the TBR/Select order but fixes up the LSR to only 'auto-select' an element that is already TBR & visible true.
Comment 9 Eric Moffatt CLA 2010-06-25 09:56:52 EDT
Committed in >20100625. Applied the patch.