Bug 361177 - CTabFolder accessibility improvements
Summary: CTabFolder accessibility improvements
Status: RESOLVED FIXED
Alias: None
Product: e4
Classification: Eclipse Project
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Bogdan Gheorghe CLA
QA Contact:
URL:
Whiteboard:
Keywords: accessibility
Depends on:
Blocks:
 
Reported: 2011-10-17 14:48 EDT by Carolyn MacLeod CLA
Modified: 2012-03-05 14:24 EST (History)
0 users

See Also:


Attachments
Patch to fix 2 accessibility problems in CTabFolder (3.03 KB, patch)
2011-10-17 14:48 EDT, Carolyn MacLeod CLA
no flags Details | Diff
additional patch that covers comment 1 and comment 2 (1.15 KB, patch)
2011-10-18 17:12 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 2011-10-17 14:48:25 EDT
Created attachment 205364 [details]
Patch to fix 2 accessibility problems in CTabFolder

The attached patch fixes 2 accessibility problems in the e4 CTabFolder:
1) The min, max, and chevron buttons now have accessible names.
2) The keyboard shortcut for switching pages in a CTabFolder (ctrl+PageUp) is now available to screen readers and it can be announced (supported in JAWS 12 and up).
In addition, the patch removes a few lines of code that were not being used.
Comment 1 Carolyn MacLeod CLA 2011-10-18 16:42:12 EDT
After applying the patch, please change the getKeyboardShortcut method to the following (really only changes 2 lines). This removes the hard-coded strings for NLS purposes. You need the latest SWT.java and SWTMessages.properties for this NLS fix to work.

		public void getKeyboardShortcut(AccessibleEvent e) {
			String shortcut = null;
			int childID = e.childID;
			if (childID >= 0 && childID < items.length) {
				String text = items[childID].getText();
				if (text != null) {
					char mnemonic = _findMnemonic(text);	
					if (mnemonic != '\0') {
						shortcut = SWT.getMessage ("SWT_Page_Mnemonic", new Object[] {new Character(mnemonic)}); //$NON-NLS-1$
					}
				}
			}
			if (childID == ACC.CHILDID_SELF) {
				shortcut = SWT.getMessage ("SWT_SwitchPage_Shortcut"); //$NON-NLS-1$
			}
			e.result = shortcut;
		}
Comment 2 Carolyn MacLeod CLA 2011-10-18 17:09:28 EDT
One more. Please change the getChildAtPoint method to the following, so that the hit test does the right thing (this is only a one-line change):

		public void getChildAtPoint(AccessibleControlEvent e) {
			Point testPoint = toControl(e.x, e.y);
			int childID = ACC.CHILDID_NONE;
			for (int i = 0; i < items.length; i++) {
				if (items[i].getBounds().contains(testPoint)) {
					childID = i;
					break;
				}
			}
			if (childID == ACC.CHILDID_NONE) {
				Rectangle location = getBounds();
				location.x = location.y = 0;
				location.height = location.height - getClientArea().height;
				if (location.contains(testPoint)) {
					childID = ACC.CHILDID_SELF;
				}
			}
			e.childID = childID;
		}
Comment 3 Carolyn MacLeod CLA 2011-10-18 17:12:27 EDT
Created attachment 205461 [details]
additional patch that covers comment 1 and comment 2

This additional patch is identical to pasting in the 2 methods mentioned in comment 1 and comment 2.
Comment 4 Carolyn MacLeod CLA 2012-02-09 15:28:25 EST
ping
Please apply the patch in comment 0, and then apply the patch in comment 3.
Thanks!
Comment 5 Bogdan Gheorghe CLA 2012-03-05 14:24:03 EST
Patch(es) applied. Thanks Car!

Fixed in HEAD > 20120305

http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=cfd660823e5cba918ade43a0bd98ce8d102e7305