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

Bug 398957

Summary: [TabFolder] Resetting selected TabItem brings Server and Client out of sync
Product: [RT] RAP Reporter: Heiner Napp <h.napp>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: h.napp, tbuschto
Version: 2.0   
Target Milestone: 2.0 RC2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed fix ivan: review?

Description Heiner Napp CLA 2013-01-24 05:15:53 EST
The following SNIPPET demonstrates the wrong behaviour:


final TabFolder tabFolder = new TabFolder( mainPanel,SWT.NONE );
TabItem item1 = new TabItem( tabFolder, SWT.NONE );
item1.setText("Item1");
Label label1 = new Label( tabFolder, SWT.NONE );
label1.setText("item1");
item1.setControl(label1);
TabItem item2 = new TabItem( tabFolder, SWT.NONE );
item2.setText("Item2");
Label label2 = new Label( tabFolder, SWT.NONE );
label2.setText("item2");
item2.setControl(label2);
tabFolder.addSelectionListener(new SelectionAdapter() {
	@Override
	public void widgetSelected(SelectionEvent event) {
		tabFolder.setSelection(0);
	}
});
Comment 1 Tim Buschtoens CLA 2013-01-24 06:25:04 EST
It's an issue in TabFolderLCA i think. Also exists in RAP 1.5.
Comment 2 Ivan Furnadjiev CLA 2013-01-24 10:23:32 EST
Created attachment 226050 [details]
Proposed fix

This patch preserved the selection set in the ProcessActionRunner
Comment 3 Ivan Furnadjiev CLA 2013-01-24 10:25:19 EST
The attached patch is against master, but it could be easily backported to 1.5 if needed. Ralf, please review?
Comment 4 Ralf Sternberg CLA 2013-01-24 11:25:26 EST
I agree with the patch for 2.0 RC2, actually we have the same pattern in CTabFolderLCA.
We've agreed not to include it in 1.5.2 because it seems to be a rare case and not critical.
Comment 5 Ivan Furnadjiev CLA 2013-01-24 11:33:55 EST
Applied the patch with commit 4392cf2595d839057db14a7ba0026ebe1f4b2c37.