|
Re: Using JAWS with a Table widget [message #666712 is a reply to message #666269] |
Thu, 21 April 2011 18:42 |
Carolyn MacLeod Messages: 149 Registered: July 2009 |
Senior Member |
|
|
JAWS 12 will read the accessible name. JAWS 11 or earlier did not. So for example, in the following snippet, JAWS 12 will say "Accessible Name For Table" when the table gets focus, followed by "item 0 not selected" or something like that. Note that JAWS will not say the preceding label "Table Label". (Window-Eyes 7.11 reads the preceding label, so one suggestion is to use the same string for both). (NVDA, like JAWS 12, says the accessible name).
import org.eclipse.swt.*;
import org.eclipse.swt.accessibility.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;
public class TableLabelTest {
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new GridLayout());
Label label = new Label(shell,SWT.NONE);
label.setText("Table Label");
final Table table = new Table(shell,SWT.SINGLE | SWT.BORDER | SWT.FULL_SELECTION);
for (int i = 0; i < 20; i++) {
TableItem item1 = new TableItem(table, SWT.NULL);
item1.setText("item" + i);
}
table.getAccessible().addAccessibleListener(new AccessibleAdapter() {
public void getName(AccessibleEvent e) {
if (e.childID == ACC.CHILDID_SELF) {
e.result = "Accessible Name For Table";
}
}
});
Text text = new Text(shell, SWT.BORDER);
text.setText("Tab here to change focus");
shell.pack();
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
}
|
|
|
|
Powered by
FUDForum. Page generated in 0.03396 seconds