Community
Participate
Working Groups
Build Identifier: My Eclipse application uses below codes to create the toolitem: ToolItem newButton = new ToolItem(toolBar, SWT.NONE); newButton.setImage(icon); newButton.setToolTipText(tooltip); When application is launched, the toolitem's tooltip cannot be readout by JAWS reader when the toolitem gets the focus via tab key. Reproducible: Always
In order to get tool items to be accessible, you need to add an accessible listener to the ToolBar that you created, as follows: toolBar.getAccessible().addAccessibleListener(new AccessibleAdapter() { public void getName(AccessibleEvent e) { if (e.childID != ACC.CHILDID_SELF) { ToolItem item = toolBar.getItem(e.childID); if (item != null) { String toolTip = item.getToolTipText(); if (toolTip != null) { e.result = toolTip; } } } } }); You can see an example of where this is done in org.eclipse.jface.action.ToolBarManager.createControl(Composite). If you use the org.eclipse.jface.action.ToolBarManager's ToolBarManager() or ToolBarManager(int) constructors to create your toolbars, then your tool items will have accessibility for free, and JAWS will read the tool item tooltips. The Eclipse SDK uses this method to create all of its toolbars. Note that if you use the ToolBarManager(ToolBar) constructor, the javadoc says: * <strong>NOTE</strong> When creating a ToolBarManager from an existing * {@link ToolBar} you will not get the accessible listener provided by JFace. so if you choose to use that constructor, you would have to add the accessible listener to your toolbar yourself.