Bug 79423 - [consistency] TabFolder fires Selection for all mnemonics
Summary: [consistency] TabFolder fires Selection for all mnemonics
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.1 M4   Edit
Assignee: Grant Gayed CLA
QA Contact:
URL:
Whiteboard:
Keywords: consistency
Depends on:
Blocks:
 
Reported: 2004-11-24 13:15 EST by Grant Gayed CLA
Modified: 2004-11-24 16:56 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Grant Gayed CLA 2004-11-24 13:15:50 EST
- run the snippet below
- press Alt+1 to traverse to the second tab -> this will display a Selection 
event, which is expected
- press Alt+1 again -> this will display another Selection event, but should 
not since the selected tab has not changed
-> this is inconsistent with doing this on the other platforms, and also with 
the behaviour of other TabFolder traversals on win32 that do not change the 
selected tab (eg.- pressing left-arrow or Home while on the first tab)

public static void main(String[] args) {
	Display display = new Display ();
	final Shell shell = new Shell(display);
	shell.setBounds(10,10,200,200);
	TabFolder folder = new TabFolder(shell, SWT.NONE);
	folder.setBounds(10,10,150,150);
	for (int i = 0; i < 4; i++) {
		new TabItem(folder, SWT.NONE).setText("i&" + i);
	}
	folder.addSelectionListener(new SelectionAdapter() {
		public void widgetSelected(SelectionEvent e) {
			System.out.println(e.toString());
		}
	});
	shell.open();
	while (!shell.isDisposed()) {
		if (!display.readAndDispatch()) display.sleep();
	}
	display.dispose();
}
Comment 1 Grant Gayed CLA 2004-11-24 16:56:39 EST
fixed > 1124