| Summary: | StyledText and CCombo should also use preceding CLabel as accessible name | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Carolyn MacLeod <carolynmacleod4> | ||||||
| Component: | SWT | Assignee: | Carolyn MacLeod <carolynmacleod4> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | Silenio_Quarti | ||||||
| Version: | 3.7 | Keywords: | accessibility | ||||||
| Target Milestone: | 3.6.1 | Flags: | carolynmacleod4:
review+
|
||||||
| Hardware: | PC | ||||||||
| OS: | All | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Carolyn MacLeod
Created attachment 174467 [details]
patch for StyledText and CCombo to use CLabel as name
SSQ, please review for 3.6.1.
Here is a snippet:
import org.eclipse.swt.*;
import org.eclipse.swt.widgets.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.custom.*;
public class CLabelAccessibleNameTest {
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new GridLayout(2, false));
CLabel clabel = new CLabel(shell, SWT.NONE);
clabel.setText("CLabel for the StyledText:");
StyledText styledText = new StyledText(shell, SWT.SINGLE | SWT.BORDER);
styledText.setText("Some text");
CLabel clabel2 = new CLabel(shell, SWT.NONE);
clabel2.setText("CLabel for the CCombo:");
CCombo ccombo = new CCombo(shell, SWT.BORDER);
ccombo.setItems(new String[] {"one", "two", "three"});
ccombo.setText(ccombo.getItem(0));
shell.pack();
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) display.sleep();
}
}
}
Created attachment 175895 [details]
patch
Car, please try this patch out. Same idea but it avoids a couple of casts and instanceof checks.
It also fixes the fact that getAssociatedLabel() would loop through all siblings when the styledtext/ccombo is the first child and still return null.
I like that much better. I'll try it out when I get back. Works great - thanks. I'll release for 3.6.1 and 3.7. Fixed > 20100824 in HEAD for 3.7. Fixed > 20100824 in 3.6.1 stream. |