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

Bug 51988

Summary: [Accessibility] JAWS does not read Eclipse custom tooltips
Product: [Eclipse Project] Platform Reporter: Tod Creasey <Tod_Creasey>
Component: SWTAssignee: Carolyn MacLeod <carolynmacleod4>
Status: CLOSED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: dipalerm, grant_gayed, hudsonr, Karice_McIntyre, Kevin_Haaland, lding, matt, ryanc, snorthov, veronika_irvine
Version: 3.0Keywords: accessibility
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Gifs to run test2 none

Description Tod Creasey CLA 2004-02-13 13:46:18 EST
M7

JAWS does not read Eclipse tooltips currently.

JAWS set up
Open cfg mgr (ins+f2), enter
go settings>verbosit
Press the button for the preferences that corresponds to the level you wish to 
adjust.
Check tooltip in the list of 19 items

Now bring up Windows Explorer and hover over toolbars
Tooltips are read

Bring up eclipse and hover
No tooltips
Comment 1 Tod Creasey CLA 2004-02-13 14:07:21 EST
With the latest JAWS update they work everywhere except in the GEF palette 
buttons.
Comment 2 Randy Hudson CLA 2004-02-13 14:51:26 EST
Correction:  It works everywhere that native tooltips are used.  We are popping 
up our own Shell with NO_TRIM.  JDT does the same thing for parameter assist 
and other features.  Does it work there?  BTW, the information on the popup can 
be obtained by accessibility clients by asking for "details".
Comment 3 Grant Gayed CLA 2004-02-13 16:07:27 EST
Car, are fake tooltips read out by JAWS on your machine?
Comment 4 Carolyn MacLeod CLA 2004-02-13 16:38:39 EST
No. I only get the tooltips on tools in toolbars, trees, etc.
"Tooltips" (i.e. yellow-colored hover-activated popup windows <g>) that do not 
get read are:
- CTabFolder tab tooltips (i.e. full text of filename in editor tabs)
- all popup javadoc, etc, in StyledTexts
Comment 5 Carolyn MacLeod CLA 2004-02-17 15:06:39 EST
Window-Eyes has the same behavior as JAWS, with the slight exception that you 
can "sort-of" get it to read the first line of a Javadoc popup window in a 
StyledText (i.e. the descriptive help text window that appears when you hover 
over a Java class). Since Window-Eyes will speak things the mouse cursor is 
over, and not just things that have focus, when the popup appears, you can 
move the mouse slightly so the first line of text is under the cursor, and 
Window-Eyes will read that. The same with the parameter assist pop-ups: JAWS 
will not speak them, but Window-Eyes will if you hover over them. Not too 
useful, but just fyi.

Note that if you give the javadoc hover help focus using F2, then both JAWS 
and Window-Eyes read the help text.

Since javadoc can be read using F2, and GEF palette info can be determined by 
asking for "details" (what exactly do you mean, Randy? Do you mean that you 
implemented getHelp on the accessible listener? or is there some menu item you 
are referring to or something?), then it looks like the only area where the 
information is not available in some other manner is the file path name on the 
tab tooltips of the editors tab folder. Can this information be determined in 
some other manner?
Comment 6 Randy Hudson CLA 2004-02-17 15:49:23 EST
I don't know if this is correct, but we implemented 
AccessibleListener#getDescription(AccessibleEvent).
Comment 7 Carolyn MacLeod CLA 2004-02-17 16:20:20 EST
I'm not 100% sure either - I guess it depends on how much faith the screen 
reader implementors have that people are providing that info <g>.
Here's what MSAA says about the "description" field, and for comparison, 
here's what they say about the "help" field, too:

----------------
Description Property
An object's Description property provides a textual description about an 
object's visual appearance. The description is primarily used to provide 
greater context for low-vision or blind users, but is also used for context 
searching or other applications. This property can help users understand an 
icon or the overall visual appearance.

The Description property is retrieved by calling 
IAccessible::get_accDescription. 

When to Support the Description Property
Servers support the Description property if the description is not obvious, or 
when it is not redundant based on the object's Name, Role, State, and Value 
properties. For example, a button labeled "OK" would not need additional 
information, whereas a button that shows a picture of a cactus would. The 
Name, Role, and Help properties for such a button describe its purpose, but 
the Description property conveys information that is less tangible for 
example, "This button shows a picture of a cactus." 

---------------
Help Property
The Help property provides information that tells the user about the function 
of an object.

The Help property is retrieved by calling IAccessible::get_accHelp. 

This property contains balloon-style information (as found in ToolTips) that 
is used either to describe what the object does or how to use it. For example, 
the Help property for a toolbar button that shows a printer might provide the 
following text: "Prints the current document." 

The text for the Help property does not have to be unique within the user 
interface.

When to Support the Help Property
Servers do not support the Help property if other properties provide 
sufficient information about the object's purpose and the actions the object 
performs. Accessible objects that expose system-provided controls do not 
support the Help property.
Comment 8 Carolyn MacLeod CLA 2004-02-17 16:23:05 EST
Frank, do you have insight into which MSAA fields the screen readers really 
care about?
Comment 9 Frank DiPalermo CLA 2004-02-27 17:21:21 EST
I really do not know what the JAWS screen reader is looking for.  After I work 
with the JAWS folks some more, I may have more information.
Comment 10 Carolyn MacLeod CLA 2004-03-29 14:21:51 EST
Reassigning priority to P1 because it is on Tod's hotlist for 3.0
Comment 11 Carolyn MacLeod CLA 2004-04-29 18:53:36 EDT
I have sent a small example to Frank, who is going to be working with the 
Freedom Scientific people on making JAWS work better with eclipse. The 
setTooltipText on CTabFolder (NO_TRIM Shell with a Label child) is fairly 
representative of the fake tooltips in eclipse, so if JAWS will speak those, 
we are part-way there.

The other type of fake tooltip in eclipse is a NO_TRIM Shell with a StyledText 
child that does not take focus. I have sent another little example to Frank in 
the context of speaking the F1 "infopop" StyledText. Hopefully, with these 2 
examples, we will cover all of the fake tooltips in eclipse. Randy, what child
(ren) are in your NO_TRIM Shell for the GEF palette tooltips? Is it a Label?

For info, here are the snippets I sent to Frank:

test1 - simulate an "infopop" (dialog 1 has a Label child that JAWS does 
speak, and dialog 2 has a StyledText child that JAWS does not speak):

import org.eclipse.swt.*;
import org.eclipse.swt.widgets.*;
import org.eclipse.swt.custom.*;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.accessibility.*;

public class StyledTextNoFocusTest {
	static Display display;
	static Shell shell;
	static Shell dialog;
	static StyledText styledText;
	static Accessible accessible;
	
	public static void main(String[] args) {
		display = new Display();
		shell = new Shell(display);
		shell.setText("Shell");
		shell.setLayout(new RowLayout());
		Button button1 = new Button(shell, SWT.PUSH);
		button1.setText("Dialog 1");
		button1.addSelectionListener(new SelectionAdapter() {
			public void widgetSelected(SelectionEvent e) {
				dialog = new Shell(shell);
				dialog.setText("Dialog");
				dialog.setLayout(new GridLayout(2, false));
				Label label = new Label(dialog, SWT.NONE);
				label.setText("JAWS always speaks this 
label.");
				label.setLayoutData(new GridData(SWT.LEFT, 
SWT.CENTER, false, false, 2, 1));
				new Label(dialog, SWT.NONE).setText("Text:");
				new Text(dialog, SWT.BORDER); // this will 
take focus because label doesn't
				dialog.pack();
				dialog.open();
			}
		});
		Button button2 = new Button(shell, SWT.PUSH);
		button2.setText("Dialog 2");
		button2.addSelectionListener(new SelectionAdapter() {
			public void widgetSelected(SelectionEvent e) {
				dialog = new Shell(shell);
				dialog.setText("Dialog");
				dialog.setLayout(new GridLayout(2, false));
				styledText = new StyledText(dialog, SWT.MULTI 
| SWT.READ_ONLY) {
					public boolean setFocus() {
						return false;
					}
					public boolean isFocusControl() {
						return false;
					}
				};
				styledText.getCaret().setVisible(false);
				styledText.setBackground(dialog.getBackground
());
				styledText.setText("JAWS, please speak this 
label too.");
				styledText.setLayoutData(new GridData
(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
				accessible = styledText.getAccessible();
				accessible.addAccessibleListener(new 
AccessibleAdapter() {
					public void getName(AccessibleEvent e) 
{
						e.result = styledText.getText
();
					}
				});
				accessible.addAccessibleControlListener(new 
AccessibleControlAdapter() {
					public void getRole
(AccessibleControlEvent e) {
						e.detail = ACC.ROLE_LABEL;
					}
					public void getState
(AccessibleControlEvent e) {
						e.detail = ACC.STATE_READONLY;
					}
					public void getValue
(AccessibleControlEvent e) {
						e.result = null;
					}
				});
				new Label(dialog, SWT.NONE).setText("Text:");
				new Text(dialog, SWT.BORDER); // this will 
take focus because the fake styledtext refused it
				
				dialog.pack();
				dialog.open();
			}
		});

		shell.pack();
		shell.open();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch()) display.sleep();
		}
	}
}

-----------------------

test2 - simulate a "tooltip" on the CTabFolder tab - the toolbar child has 
platform tooltips, for comparison (I will attach a zip of the gifs, in case 
anyone wants to run this) (note that you must have tooltip verbosity in JAWS 
turned on in order to hear tooltips):

import org.eclipse.swt.*;
import org.eclipse.swt.widgets.*;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.custom.*;

public class CTabFolderTooltipTest {
	static Display display;
	static Shell shell;
	static CTabFolder tabFolder;
	static Point maxSize;
	static Composite selectedContents;
	
	public static void main(String[] args) {
		display = new Display();
		shell = new Shell(display);
		shell.setLayout(new GridLayout());
		shell.setText("Tooltip Test");
		maxSize = new Point(0, 0);
		tabFolder = new CTabFolder(shell, SWT.BORDER);
		CTabItem item = new CTabItem(tabFolder, SWT.NULL);
		item.setText("Page 1 of 1");
		item.setToolTipText("JAWS, please read this custom tooltip 
also");
		Composite tabContents = new Composite(tabFolder, SWT.NONE);
		tabContents.setLayout(new GridLayout());
		ToolBar itemToolBar = new ToolBar(tabContents, SWT.FLAT);
		itemToolBar.setLayoutData(new GridData
(GridData.FILL_HORIZONTAL));
        String[] toolBarFileNames = new String [] 
{"save", "printer", "debug", "run", "search"};
		for (int tool = 0; tool < toolBarFileNames.length; tool++) {
			String fileName = toolBarFileNames[tool];
           	ToolItem toolItem = new ToolItem(itemToolBar, SWT.PUSH);
           	toolItem.setImage(createToolBarIcon(display, fileName));
           	toolItem.setToolTipText("Platform tooltip for " + fileName);
		}
		item.setControl(tabContents);
			
		shell.pack();
		shell.open();
		tabFolder.setSelection(0);
		
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch()) display.sleep();
		}
	}
	
	static Image createToolBarIcon(Display display, String fileName) {
		try {
			ImageData source = new ImageData
(CTabFolderTooltipTest.class.getResourceAsStream(fileName + ".gif"));
			ImageData mask = source.getTransparencyMask();
			return new Image(display, source, mask);
		} catch (Exception e) {
		}
		return null;
	}
}
Comment 12 Carolyn MacLeod CLA 2004-04-29 18:55:46 EDT
Created attachment 10144 [details]
Gifs to run test2
Comment 13 Randy Hudson CLA 2004-04-30 15:13:46 EDT
For GEF, it is simply a Shell with a paint listener.  I believe we could have 
it add an accessibility listener, but currently it does not.

Is it really necessary for tooltips to be read if the widget for which the 
tooltip appears already provides the tooltip text in its help/description??
Comment 14 Carolyn MacLeod CLA 2004-05-03 13:40:10 EDT
Well, to be honest, we are still trying to find out if the screen readers ever 
look at the help or the description field... but my best guess is "they 
don't". Frank should know soon - it's on his list of things to ask the JAWS 
folk about.

So, for the "most likely to succeed for the greatest number of accessible 
tools" solution, I do suggest that you hook the accName to the "fake tooltip" 
shell.

Thanks, Randy.
Comment 15 Carolyn MacLeod CLA 2004-05-06 12:27:06 EDT
Tod, there is nothing else we can do at this time for this bug (other than 
possibly writing a JAWS script, which I have never done and don't know if it 
would help).

I have sent all of the information and a simple test case to Frank, who will be 
working with the JAWS people to see that future versions of JAWS can read our 
fake tooltips when the "tooltips verbosity" mode is set in JAWS.

Unfortunately, the next JAWS release is not until late summer, which will be 
after our 3.0 release. So I am afraid that this will not happen in time for 
you. Note that it is one of your P1 bugs for 3.0. I am not sure what you want 
to do about this - is it possible for you to get someone to try writing a 
script?
Comment 16 Tod Creasey CLA 2004-05-06 13:59:23 EDT
Then we should defer to 3.1 - this has never worked with JAWS
Comment 17 Carolyn MacLeod CLA 2004-05-19 15:05:46 EDT
Downgrading to P3 because we are not fixing this for 3.0.
Comment 18 Carolyn MacLeod CLA 2004-08-24 10:50:48 EDT
Changing Summary to include the word "custom" for more precision.
Comment 19 Steve Northover CLA 2006-06-28 13:48:30 EDT
CAR, any update?
Comment 20 Karice McIntyre CLA 2006-12-04 11:55:27 EST
Carolyn, what is the status of this bug?  Is it still valid?
Comment 21 Veronika Irvine CLA 2007-08-10 17:15:42 EDT
Hi Car,

We keep running up against this problem too.  It is still a problem with JAWS 7.10.  Any news or suggestions on how to get JAWS to read this tooltip information?
Comment 22 Carolyn MacLeod CLA 2007-08-13 12:24:42 EDT
I tried JAWS 8.0 with the 2 snippets in comment 11, and they now both work correctly. (For test2, you do need to turn on ToolTips in JAWS:
Utilities -> Configuration Manager -> Set Options -> Beginner Preferences...
make sure Tool Tip is checked, then OK, OK, etc, File -> Exit on "default.jcf" and Yes to save).

So I tried hovering around in eclipse, and to my pleasant surprise, most tooltips work (with ToolTips turned on in JAWS).

The only one I could find that doesn't work as-is is the javadoc hover help in the editors, i.e. hover over a class name or method name, etc, and the javadoc for the class/method comes up. JAWS does not speak this, but if the user types F2 to give that window focus, it does.

So the question is, what exactly are you trying to have JAWS read? Is it something in eclipse? Or is it something you can provide a snippet for?
Comment 23 Carolyn MacLeod CLA 2007-08-13 12:37:12 EDT
Oops, just noticed that you are using JAWS 7.10.
Tried that, and it works well too - the tooltips in both snippets are read properly, and tooltips throughout eclipse are read correctly also, with the exception of javadoc hover help. You need to press F2 to give it focus before JAWS reads it.

Also, I noticed that my instructions to turn on Tool Tip reading in JAWS are missing one step:
- after "Set Options -> "
- insert "Verbosity Options..."
- and then click on the "Beginner Preferences..." button

Hope this helps - you do need to tell JAWS to read Tool Tips.

Actually, given this info, unless you can show me a place where JAWS is not reading a tooltip (other than the javadoc) then I should close this bug.
Comment 24 Carolyn MacLeod CLA 2010-09-01 10:31:23 EDT
This bug should have been closed long ago. Tooltips work everywhere now.
To bring up the Javadoc tooltip for the item at the caret from within an editor while just using the keyboard, type F2. JAWS reads this well now.