summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarolyn MacLeod <carolyn>2010-05-03 14:41:23 +0000
committerCarolyn MacLeod <carolyn>2010-05-03 14:41:23 +0000
commit7ec2365e574fa94931f825758a919e817b6c4d46 (patch)
tree15e37a8eb13b7eb3d7536fab7d077cd5cb5ec3cb
parent9dd3e692c3c205731e26903aaef61e84c3954b64 (diff)
downloadeclipse.platform.swt-7ec2365e574fa94931f825758a919e817b6c4d46.tar.gz
eclipse.platform.swt-7ec2365e574fa94931f825758a919e817b6c4d46.tar.xz
eclipse.platform.swt-7ec2365e574fa94931f825758a919e817b6c4d46.zip
try adding live region info for Orca
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet340.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet340.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet340.java
index 1294d40922..d719619324 100644
--- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet340.java
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet340.java
@@ -12,7 +12,7 @@ package org.eclipse.swt.snippets;
/*
* Accessibility example snippet: tell a screen reader about updates
- * to a non-focused descriptive area
+ * to a non-focused descriptive area (sometimes called a "live region")
*
* For a list of all SWT example snippets see
* http://www.eclipse.org/swt/snippets/
@@ -31,11 +31,19 @@ public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new GridLayout());
- shell.setText("Description Relation Example");
+ shell.setText("Live Region Example");
final Label liveLabel = new Label(shell, SWT.BORDER);
liveLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
liveLabel.setText("Live region messages go here");
+ liveLabel.getAccessible().addAccessibleAttributeListener(new AccessibleAttributeAdapter() {
+ public void getAttributes(AccessibleAttributeEvent e) {
+ e.attributes = new String[] {
+ "aria-live", "assertive",
+ "aria-atomic", "true"
+ };
+ }
+ });
new Label(shell, SWT.NONE).setText("Type an integer from 1 to 4:");