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:
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