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

Bug 320371

Summary: When using screen reader software read SWT application, the content is incorrect.
Product: [Eclipse Project] Platform Reporter: Yang Rui <yruicdl>
Component: SWTAssignee: Carolyn MacLeod <carolynmacleod4>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: eclipse.felipe
Version: 4.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug

Description Yang Rui CLA 2010-07-20 06:15:57 EDT
Build Identifier: 3.4.2

For blind people, using wineye to read screen, and using keyboard to navigate among controls.
In below steps, the content is not correct.

The example is a dialog which has two tabs(First tab, Second tab), every tab is a list view which has record called "Data2" and "Data3"
1 Open Wineye. 
2 When app opened, 'First tab' get focus.
3 Press '->' at keyboard. Then swtich to 'Second tab'
4 Press 'tab' in keyboard.

The wineye will read 'First tab, Data2, Data3', it should not read 'First tab', because user already in the second tab. 



Sample code for recreate this defect.



import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CTabFolder;
import org.eclipse.swt.custom.CTabItem;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem;

public class TabWithTable {

	public void run() {
		Display display = new Display();
		Shell shell = new Shell(display);
		shell.setLayout(new FillLayout());
		shell.setText("Test screen reader");
		createContents(shell);
		
		shell.setSize(200,200);
		shell.open();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		}
		display.dispose();
	}

	private void createContents(Shell shell) {

		final CTabFolder tabFolder = new CTabFolder(shell, SWT.NONE);

		CTabItem one = new CTabItem(tabFolder, SWT.NONE);
		one.setText("First tab");
		one.setToolTipText("This is tab one");
		one.setControl(getTabControl(tabFolder));

		CTabItem two = new CTabItem(tabFolder, SWT.NONE);
		two.setText("Second tab");
		two.setToolTipText("This is tab two");
		two.setControl(getTabControl(tabFolder));

	}

	static int index = 0;

	private Control getTabControl(CTabFolder tabFolder) {

		Table table = new Table(tabFolder, SWT.SINGLE | SWT.FULL_SELECTION
				| SWT.BORDER);
		table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
		table.setLinesVisible(true);
		table.setHeaderVisible(true);

		final TableColumn tc1 = new TableColumn(table, SWT.LEFT);
		final TableItem item1 = new TableItem(table, SWT.NONE);
		item1.setText(new String[] { "Data" + index++ });
		final TableItem item2 = new TableItem(table, SWT.NONE);
		item2.setText(new String[] { "Data" + index++ });

		for (int i = 0; i < table.getColumnCount(); i++) {
			table.getColumn(i).pack();
		}
		return table;
	}


	public static void main(String[] args) {
		new TabWithTable().run();
	}
}



Reproducible: Always
Comment 1 Yang Rui CLA 2010-07-27 01:13:25 EDT
Hi Carolyn MacLeod,
Could you please tell me when to fix this bug? One defect of our product is associate to this bug. 
Thanks!
Comment 2 Alexander Kurtakov CLA 2018-10-02 03:10:39 EDT
Is this still reproducible on supported Windows and SWT versions?
Comment 3 Eclipse Genie CLA 2020-09-22 07:57:20 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.