Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 320066

Summary: DROP_DOWN ToolItems need accessible name
Product: [Eclipse Project] Platform Reporter: Carolyn MacLeod <carolynmacleod4>
Component: SWTAssignee: Carolyn MacLeod <carolynmacleod4>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Silenio_Quarti
Version: 3.7Flags: Silenio_Quarti: review+
Target Milestone: 3.6.1   
Hardware: PC   
OS: Windows All   
Whiteboard:
Attachments:
Description Flags
initial patch
none
new patch
none
final patch none

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".