Community
Participate
Working Groups
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(); } }
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.
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.
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.
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.
Also note that JAWS does not use the accessibility support for buttons - it always uses the name.
Groups and labels consistent with other applications on Win 2000. Closing.