Summary: | Mac OS X accessibility does not have the standard relations | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] Platform | Reporter: | Carolyn MacLeod <carolynmacleod4> | ||||
Component: | SWT | Assignee: | Carolyn MacLeod <carolynmacleod4> | ||||
Status: | RESOLVED FIXED | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | CC: | duongn, grant_gayed, steve_northover | ||||
Version: | 3.4 | Keywords: | accessibility | ||||
Target Milestone: | 3.4 RC1 | Flags: | grant_gayed:
review+
|
||||
Hardware: | Macintosh | ||||||
OS: | Mac OS X - Carbon (unsup.) | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Carolyn MacLeod
2007-12-14 04:51:09 EST
Implementation info: Use HIObjectSetAuxiliaryAccessibilityAttribute for both elements. Example: HIObjectSetAuxiliaryAccessibilityAttribute(x, kAXTitleUIElementAttribute, y); and HIObjectSetAuxiliaryAccessibilityAttribute(x, kAXServesAsTitleForUIElementsAttribute, y); Created attachment 99124 [details]
_patch.txt
Patch for the fix. One new native.
Test snippet that tests label and control insertions and deletions to make sure all relations are added and removed correctly. import org.eclipse.swt.*; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.layout.*; import org.eclipse.swt.widgets.*; public class LabelForTextTest { static int count = 0; static Label currentLabel; static Text currentText; public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setLayout(new GridLayout(2, false)); final Composite parent = new Composite(shell, SWT.BORDER); parent.setLayout(new FillLayout()); parent.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1)); currentLabel = new Label(parent, SWT.NONE); currentLabel.setText("Title:"); currentText = new Text(parent, SWT.BORDER); currentText.setText("Hello"); Button button = new Button(shell, SWT.PUSH); button.setText("Insert Label"); button.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { Label label = new Label(parent, SWT.NONE); count++; label.setText("Title" + count + ":"); if (currentText != null) label.moveAbove(currentText); // if (currentLabel != null) label.moveBelow(currentLabel); currentLabel = label; parent.layout(); } }); button = new Button(shell, SWT.PUSH); button.setText("Insert Text"); button.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { Text text = new Text(parent, SWT.BORDER); count++; text.setText("Hello" + count); if (currentText != null) text.moveAbove(currentText); currentText = text; parent.layout(); } }); button = new Button(shell, SWT.PUSH); button.setText("Delete Label"); button.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { if (currentLabel != null) { currentLabel.dispose(); currentLabel = null; Control [] children = parent.getChildren(); for (int i = 0; i < children.length; i++) { if (children[i] instanceof Label) { currentLabel = (Label)children[i]; } } } parent.layout(); } }); button = new Button(shell, SWT.PUSH); button.setText("Delete Text"); button.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { if (currentText != null) { currentText.dispose(); currentText = null; Control [] children = parent.getChildren(); for (int i = 0; i < children.length; i++) { if (children[i] instanceof Text) { currentText = (Text)children[i]; break; } } } parent.layout(); } }); shell.pack(); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); } } Fixed > 20080507 |