Bug 9904 - SWT Groups and Labels not found by JAWS
Summary: SWT Groups and Labels not found by JAWS
Status: RESOLVED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Tod Creasey CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 8877 8879
  Show dependency tree
 
Reported: 2002-02-15 09:27 EST by Tod Creasey CLA
Modified: 2002-03-19 13:27 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tod Creasey CLA 2002-02-15 09:27:31 EST
The text for SWT Groups and Labels is not read by JAWS

STEPS
1) Start up JAWS
2) Run the class below
3) It will read the window text and the button text but nothing else

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.*;
/*
 * (c) Copyright 2001 MyCorporation.
 * All Rights Reserved.
 */
/**
 * @version 	1.0
 * @author
 */
public class JAWSTest {

	public static void main(String[] args) {
		
		Display display = new Display();
		Shell shell = new Shell(display);
		shell.setText("JAWS test");

		Group group =  new Group(shell, SWT.SHADOW_NONE);
		group.setText("Group Title");
		
		Label label = new Label(group, SWT.NONE);
		label.setText("Sibling Label");
		label.setBounds(10,25,175,25);
		
		Composite buttonComposite = new Composite(group, SWT.NONE);
		GridLayout layout = new GridLayout();
		buttonComposite.setLayout(layout);
		GridData data =
			new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | 
GridData.GRAB_HORIZONTAL);
		buttonComposite.setData(data);	
		
		Button editorTopButton = new Button(buttonComposite, SWT.RADIO);
		editorTopButton.setText("First");
		
		Button editorBottomButton = new Button(buttonComposite, 
SWT.RADIO);
		editorBottomButton.setText("Second");
		editorBottomButton.setSelection(true);
		
		group.setBounds(0,0,200,200);
		buttonComposite.setBounds(10,50,180,100);

		shell.open();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch())
				display.sleep();
		}
		display.dispose();
	
	}
}
Comment 1 Carolyn MacLeod CLA 2002-02-15 11:35:07 EST
How does JAWS get the handle of the widget that it is supposed to be reading?
Because these widgets *are advertising their name - I can see them in the MSAA 
Inspector tool. I suspect strongly that JAWS only reads things that get focus. 
SWT Group and Label are platform widgets and they are behaving normally, but 
neither one will ever take focus. I suspect that JAWS would read the label if 
it had a Text to the right of it and the Text got focus - that seems to be one 
of the ways it can get the handle of the Label - if something doesn't have a 
name (like a Text) it looks to the left or above in the stacking order and if 
there is a Label there it reads that. I do not know when JAWS might read a 
Group title - perhaps if a nameless child has focus. Try putting a Text inside 
a Group and then giving the Text focus. Bottom line is I don't think this is a 
bug.
Comment 2 Nick Edgar CLA 2002-02-15 12:11:40 EST
Jaws does do heuristics like reading the preceeding label.
I've seen it work in other contexts, so there might be something particular 
about this case that keeps it from recognizing the label, e.g. if the field is 
in a different parent than the label.
We should also try using groups in the workbench prefs.

Comment 3 Nick Edgar CLA 2002-02-15 12:14:06 EST
Once we have the accessibility APIs, we could always give the indicated label 
to the field, so it would work even if Jaws is just reading the focus widget.
Comment 4 Carolyn MacLeod CLA 2002-02-15 12:56:04 EST
In this case there is no widget without a name, so no need to go looking at the 
preceding label. i.e. the radios - the only things that take focus - already 
have names, so JAWS reads those, and neither the preceding label nor the group 
name is read.
Comment 5 Tod Creasey CLA 2002-03-06 10:05:31 EST
Also note that JAWS does not use the accessibility support for buttons - it 
always uses the name.
Comment 6 Tod Creasey CLA 2002-03-19 13:27:49 EST
Groups and labels consistent with other applications on Win 2000. Closing.