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

Bug 60479

Summary: [EditorMgmt] switch to tabs on bottom then back to top redraws poorly
Product: [Eclipse Project] Platform Reporter: Michael Van Meekeren <michaelvanmeekeren>
Component: UIAssignee: Stefan Xenos <sxenos>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: eclipse, ed.burnette, ines, veronika_irvine
Version: 3.0Keywords: helpwanted
Target Milestone: 3.0 M9   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Patch to add the “resizeListener” code back in “DefaultPartPresentation”
none
Patch for the tab folders none

Description Michael Van Meekeren CLA 2004-04-29 14:06:40 EDT
- open eclipse
- switch to use tabs on the bottom appearance in (Window > workbench > 
preferences > appearance ) 
- tabs are now on the bottom for the editor
- now switch them back

NOTE that for me the tab was not visible until i resized the window
Comment 1 Ed Burnette CLA 2004-05-06 15:23:33 EDT
This just started happening to me with N20040506 with *both* views and 
editors. For example if the tabs are on top and I change the option to make 
them be on the bottom and press Apply or OK, they're invisible until I do a 
resize or reset perspective.
Comment 2 Stefan Xenos CLA 2004-05-11 13:27:57 EDT
*** Bug 61661 has been marked as a duplicate of this bug. ***
Comment 3 Ines Khelifi CLA 2004-05-12 10:35:55 EDT
After comparing several versions of eclipse with a correct one (“N20040404”), I
found the problem.

In the oldest version I compared (“I20040504“), the “resizeListener” in
“BasicStackPresentation” was present, but the content of the "handleEvent"
method was commented out. The commented code was a call to "setControlSize()"
which performs a layout.

The newest version I examined is build id: 200405110800. In that build, the
“BasicStackPresentation” class replaces "DefaultPartPresentation". In the latter
class, the "resize" listener is completely removed. I added that part back and
the tab folders behave correctly.

I am going to attach a patch to this bug, but if the "resize" listener was
removed intentionally and you need an alternative solution, let me know.
Comment 4 Ines Khelifi CLA 2004-05-12 11:00:03 EDT
Created attachment 10540 [details]
Patch to add the “resizeListener” code back in “DefaultPartPresentation”

Since SWT throws a resize event after it sets the tab position, I put back the
code to layout on the resize event to fix the drawing issues.
Comment 5 Stefan Xenos CLA 2004-05-12 15:28:02 EDT
The resize listener was removed because it would cause 2 layouts to occur when
calling setBounds(...). Also, the fact that we got a resize event even though
the size of the CTabFolder had not changed would seem to be an SWT bug and we
should not be relying on it.

I would suggest calling layout(false) inside the property listener.
Comment 6 Ines Khelifi CLA 2004-05-12 15:31:23 EDT
Created attachment 10563 [details]
Patch for the tab folders

Added “layout(false)” to “DefaultViewPresentation” and
“DefaultEditorPresentation” in their property change methods.
Comment 7 Ines Khelifi CLA 2004-05-12 15:32:42 EDT
Re-assigning to Stefan so he can apply the patch.
Comment 8 Stefan Xenos CLA 2004-05-12 20:03:41 EDT
Patch applied. Bug fixed.

Thanks, Ines.
Comment 9 Ines Khelifi CLA 2004-05-18 16:30:03 EDT
Verified on Mac OS X and Windows XP with Build id: 200405181200.
Comment 10 Ines Khelifi CLA 2004-05-19 11:18:59 EDT
Verified with Build id: 200405190010 on Windows XP and Mac OS X.
Comment 11 Stefan Xenos CLA 2004-05-26 17:39:25 EDT
*** Bug 61786 has been marked as a duplicate of this bug. ***