eclipse-rap / org.eclipse.rap

Eclipse RAP Runtime (Remote Application Platform)
https://www.eclipse.org/rap/
Eclipse Public License 1.0
17 stars 19 forks source link

CTabFolder always hides Control shared between CTabItems #200

Closed Sebastian-Habenicht closed 4 weeks ago

Sebastian-Habenicht commented 1 month ago

When two CTabItems share the same control it becomes invisible when switching between the items, because the old control is set invisible in CTabFolder#setSelection. This has been fixed in SWT years ago [1] by comparing the item's control with the selected control before setting it invisible. I have tested this approach with the RWT implementation and it works fine so far:

// Hide control of previous selection (if any) if( oldSelectionIndex >= 0 && oldSelectionIndex < getItemCount() ) { Control oldControl = getItem( oldSelectionIndex ).getControl(); if( oldControl != null && oldControl != control && !oldControl.isDisposed() ) { oldControl.setVisible( false ); } }

I would suggest to adopt the SWT approach to have the same behavior for SWT and RWT and support usage of shared components.

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=191650