Accessible name? [message #468576] |
Wed, 03 September 2008 17:33  |
Eclipse User |
|
|
|
I'm tinkering with the Java Validation Componentry. I've created a
simple subclass of Composite with a standard two-argument constructor.
I've added a Text to the composite.
The validator is complaining that I'm "Missing accessible name" on both
the Composite and the Text. It's not clear to me how I go about setting
the accessible name. Any pointers?
Wayne
|
|
|
|
Re: Accessible name? [message #468582 is a reply to message #468576] |
Fri, 03 October 2008 09:34  |
Eclipse User |
|
|
|
Wayne:
Sorry for this delayed response but have been traveling quite a bit and on
vacation this week.
The accessibleNmae on the Composite is missing bc Composite's simply do
not have an accessible name associated with them by default. This is a bug
in the validation document for SWT. You can, however, corect the error by
getting the accessible for the Composite and overwriting the getName
method:
public MyComposite (Composite parent, int style) {
super(parent, style);
getAccessible().addAccessibleListener(new AccessibleListener() {
public void getName (AccessibleEvent event) { event.result =
"composite name"; }
:
} });
For the text field, the validation is correct as the only way to get a
name for a text field is to asssociate itwith a label. Add a Label to the
composite prior to adding the Text object and this should repair that
error.
|
|
|
Re: Accessible name? [message #560492 is a reply to message #468576] |
Tue, 30 September 2008 14:44  |
Eclipse User |
|
|
|
Hi Wayne,
Sorry for this late reply. I had not noticed that my news reader doesn't
work well. I'll forward this to Mike Squillace who leads the validation
component.
|
|
|
Re: Accessible name? [message #560498 is a reply to message #468576] |
Fri, 03 October 2008 09:34  |
Eclipse User |
|
|
|
Wayne:
Sorry for this delayed response but have been traveling quite a bit and on
vacation this week.
The accessibleNmae on the Composite is missing bc Composite's simply do
not have an accessible name associated with them by default. This is a bug
in the validation document for SWT. You can, however, corect the error by
getting the accessible for the Composite and overwriting the getName
method:
public MyComposite (Composite parent, int style) {
super(parent, style);
getAccessible().addAccessibleListener(new AccessibleListener() {
public void getName (AccessibleEvent event) { event.result =
"composite name"; }
:
} });
For the text field, the validation is correct as the only way to get a
name for a text field is to asssociate itwith a label. Add a Label to the
composite prior to adding the Text object and this should repair that
error.
|
|
|
Powered by
FUDForum. Page generated in 0.04771 seconds