Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarolyn MacLeod2013-02-26 20:24:50 +0000
committerCarolyn MacLeod2013-02-26 20:27:27 +0000
commit55bec4cf2651738824fee3f0adede6b94a473ed3 (patch)
tree79b703dbe95f98f403a13324f8f520327a7ffa8b /examples
parentd0556da2c0afb55bdabc1964cd4ad301c5917e83 (diff)
downloadeclipse.platform.swt-55bec4cf2651738824fee3f0adede6b94a473ed3.tar.gz
eclipse.platform.swt-55bec4cf2651738824fee3f0adede6b94a473ed3.tar.xz
eclipse.platform.swt-55bec4cf2651738824fee3f0adede6b94a473ed3.zip
Bug 336125 - ACC.RELATION_DESCRIBED_BY does not work for TextI20130226-2100I20130226-2000
Diffstat (limited to 'examples')
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet340.java10
1 files changed, 9 insertions, 1 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..3707818974 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
@@ -33,7 +33,9 @@ public static void main(String[] args) {
shell.setLayout(new GridLayout());
shell.setText("Description Relation Example");
- final Label liveLabel = new Label(shell, SWT.BORDER);
+ // (works with either a Label or a READ_ONLY Text)
+ final Label liveLabel = new Label(shell, SWT.BORDER | SWT.READ_ONLY);
+// final Text liveLabel = new Text(shell, SWT.BORDER | SWT.READ_ONLY);
liveLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
liveLabel.setText("Live region messages go here");
@@ -60,6 +62,12 @@ public static void main(String[] args) {
}
});
textField.getAccessible().addRelation(ACC.RELATION_DESCRIBED_BY, liveLabel.getAccessible());
+ liveLabel.getAccessible().addRelation(ACC.RELATION_DESCRIPTION_FOR, textField.getAccessible());
+ textField.getAccessible().addAccessibleListener(new AccessibleAdapter() {
+ public void getDescription(AccessibleEvent event) {
+ event.result = liveLabel.getText();
+ }
+ });
shell.pack();
shell.open();

Back to the top