Bug 25740

Summary: Accessibility:SWT Label cannot be read by JAWS
Product: [Eclipse Project] Platform Reporter: Diana Lau <dhmlau>
Component: SWTAssignee: Carolyn MacLeod <carolynmacleod4>
Status: RESOLVED DUPLICATE QA Contact:
Severity: major    
Priority: P3 CC: grant_gayed, veronika_irvine
Version: 2.0.2Keywords: accessibility
Target Milestone: ---   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Diana Lau CLA 2002-11-05 14:31:06 EST
SWT Label cannot be read by JAWS.

I tried to add a AccessibleListener and AccessibleControlListener to the label,
but it still did not work.  Here is the code snippet I used:
imageLabel.getAccessible().addAccessibleListener(new AccessibleListener(){
		public void getName(AccessibleEvent e) {
			e.result = "Hello";
		}
		public void getDescription(AccessibleEvent e) {
			e.result = "Hello";
		}
		public void getHelp(AccessibleEvent e) {}
		public void getKeyboardShortcut(AccessibleEvent e) {}
	});

	imageLabel.getAccessible().addAccessibleControlListener( new 
AccessibleControlAdapter() {
                  public void getRole(AccessibleControlEvent e) {
			e.detail = ACC.ROLE_PUSHBUTTON;
		}
		public void getValue(AccessibleControlEvent e) {
			e.result = "aaa";
		}
		public void getFocus(AccessibleControlEvent e) {
			e.childID = ACC.CHILDID_SELF;
		}
	});

After having this code, the values shown in the inspect tool (Inspect32.exe 
from WIndows) are correct:
Name: "Hello"
Value: "aaa"
Comment 1 Veronika Irvine CLA 2003-10-16 09:21:42 EDT
Grant, can you try this on WIndowEyes?
Comment 2 Grant Gayed CLA 2003-10-16 10:58:18 EDT
This seems like the Label equivalent of bug 21771.  WindowEyes reads out the 
label's text, and doesn't ask our AccessibleListener and 
AccessibleControlListener for their responses.

As a side note, though it's not really relevant, the initial snippet should not 
be answering ROLE_PUSHBUTTON for its role.
Comment 3 Carolyn MacLeod CLA 2003-12-08 13:44:27 EST
This is the same problem as for bug #21771 about buttons. I am working with 
the Window-Eyes people on a (simple) partial fix for graphic labels, but the 
full fix is a feature request for them. The label problem is slightly 
different from the button problem, in that buttons will take focus and labels 
don't, but it's basically the same problem, namely "that's not how Window-Eyes 
works... it just uses the GetWindowText if there is one, and does not ask for 
the accName if it can read the text that is actually displayed".

If anyone has any examples of WHY one would want to override the visible label 
of a label so that it says something else, please let me know, because an 
example would help me in my discussions with the Window-Eyes people.

I am marking this bug as a duplicate of 21771.

*** This bug has been marked as a duplicate of 21771 ***