Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 320066 - DROP_DOWN ToolItems need accessible name
Summary: DROP_DOWN ToolItems need accessible name
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows All
: P3 normal (vote)
Target Milestone: 3.6.1   Edit
Assignee: Carolyn MacLeod CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-16 01:49 EDT by Carolyn MacLeod CLA
Modified: 2011-01-10 12:42 EST (History)
1 user (show)

See Also:
Silenio_Quarti: review+


Attachments
initial patch (2.12 KB, patch)
2010-07-16 02:02 EDT, Carolyn MacLeod CLA
no flags Details | Diff
new patch (2.99 KB, patch)
2010-08-20 15:16 EDT, Carolyn MacLeod CLA
no flags Details | Diff
final patch (4.06 KB, patch)
2010-08-23 16:41 EDT, Carolyn MacLeod CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carolyn MacLeod CLA 2010-07-16 01:49:50 EDT
The JFace ToolBarManager adds an accessible listener to automatically use a graphic ToolItem's tooltip text as its accessible name. This does not work for split buttons (aka ToolItems with DROP_DOWN style). To see this, run inspect32.exe and tab or arrow through the Eclipse tool bar. The tool items with a drop down menu will have role "split button" but they will not have a name.
Comment 1 Carolyn MacLeod CLA 2010-07-16 02:02:22 EDT
Created attachment 174468 [details]
initial patch

This patch needs further testing (i.e. add/delete tool items was not tested) but I am attaching it here so that it is not lost. With this patch, the ToolBarManager needs some additional code as well, something along the lines of the following (which was taken from the AccessibleToolBarTest snippet in the Car project):

toolBar.getAccessible().addAccessibleControlListener(new AccessibleControlAdapter() {
	public void getChild(AccessibleControlEvent e) {
		Accessible accessible = (Accessible) e.getSource();
		ToolBar toolBar = (ToolBar) accessible.getControl();
		final ToolItem item = toolBar.getItem(e.childID);
		if (item != null && (item.getStyle() & SWT.DROP_DOWN) != 0) {
			e.accessible.addAccessibleListener(new AccessibleAdapter() {
				public void getName(AccessibleEvent e) {
					if (e.childID == ACC.CHILDID_SELF) {
						e.result = item.getToolTipText();
					}
				}
			});
		}
	}
});
Comment 2 Carolyn MacLeod CLA 2010-08-20 15:16:05 EDT
Created attachment 177136 [details]
new patch

New patch that does not require any JFace changes. Still needs further testing for add/remove of tool items.
Comment 3 Carolyn MacLeod CLA 2010-08-23 16:41:34 EDT
Created attachment 177264 [details]
final patch
Comment 4 Carolyn MacLeod CLA 2010-08-23 16:42:47 EDT
Final patch does not require JFace changes, and add/dispose has been tested. Eclipse toolbar has been tested. SSQ, please review for 3.6.1.
Comment 5 Carolyn MacLeod CLA 2010-08-23 16:52:57 EDT
3.7 patch is the same.
Comment 6 Carolyn MacLeod CLA 2010-08-23 16:56:49 EDT
Fixed > 20200823 in 3.6.1 stream.
Comment 7 Carolyn MacLeod CLA 2010-08-23 16:58:59 EDT
Fixed > 20100823 in HEAD for 3.7.
Comment 8 Carolyn MacLeod CLA 2011-01-10 12:42:40 EST
Changing from "Closed->Fixed" to "Resolved->Fixed".