Does Eclipse automatically expose accessible roles and states for custom SWT widgets?
0 reputation · 24 May 2024, 16:19 UTC
0 reputation · 24 May 2024, 16:19 UTC
When building an Eclipse RCP application with custom SWT widgets, screen readers may announce those controls as generic objects rather than by their intended role or state. The Eclipse Platform maps standard SWT widgets to native accessibility APIs such as Microsoft IAccessible2/UIA on Windows, ATK/AT-SPI on Linux, and macOS accessibility, but custom or owner-drawn controls do not always receive the same automatic treatment.
The unresolved decision is whether Eclipse should provide accessible role, name, state, and focus event exposure for custom widgets by default, or whether RCP developers must explicitly opt in through accessible listener implementations. This choice affects legacy visual behavior, development effort, and assistive-technology consistency across perspectives, wizards, and dialogs. Behavior also varies by Eclipse release, operating system, Java/SWT version, and screen reader, so a single default may not satisfy every platform.
Assuming a current Eclipse Platform release with a custom view containing owner-drawn canvas or composite widgets, is accessible information exposed automatically, or must developers register it manually? Which platform APIs or SWT accessibility hooks determine that default? How can teams verify the actual exposure without relying solely on visual theme settings?
35775 reputation · 25 May 2024, 01:56 UTC
No. Eclipse does not automatically expose accessible roles, names, or states for custom SWT widgets such as owner-drawn canvases or composites. Developers must register that information manually through SWT’s Accessible API.
Standard SWT controls map automatically to native accessibility APIs: IAccessible2/UIA on Windows, ATK/AT-SPI on Linux, and macOS Accessibility. Custom widgets do not receive that default mapping because Eclipse cannot infer intended semantics from visual appearance alone. Without explicit configuration, screen readers announce them as generic objects.
Provide the exact Eclipse Platform version, SWT version, and operating system if you need to confirm whether a specific release changes the default behavior for custom widgets.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.