Bug 385555 - [Viewers] JAWS cannot read out image icon's tooltip in TableViewer cell
Summary: [Viewers] JAWS cannot read out image icon's tooltip in TableViewer cell
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: accessibility
Depends on:
Blocks:
 
Reported: 2012-07-19 17:39 EDT by Chunqiu Ji CLA
Modified: 2019-11-27 06:59 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chunqiu Ji CLA 2012-07-19 17:39:32 EDT
Build Identifier: 

With TableViewer cell, when getColumnImage returns the image with tooltip specified, image's tooltip can NOT be read out by JAWS when the table cell gains the focus. Only label text returned by getColumnText can be read out by JAWS. But we have a lot of cases that we only put image in the cell without having any label text in the cell, then JAWS will read nothing for this case.

Reproducible: Always
Comment 1 Carolyn MacLeod CLA 2012-07-23 14:44:15 EDT
You need to do 2 things to get JAWS to read the accessible name for an image in a table:
1) Tell JAWS to "Use MSAA for ListViews" as follows (note that you do not need to do this if you are running JAWS 14.0.399 or higher):
- with <your app> and JAWS both running, give focus to <your app>
  and type INS+F2
- select Settings Center and OK
- say OK to create a new JAWS configuration file with the name <your app>
- in the Settings Center filter text, type MSAA
- select the "Use MSAA for ListViews" checkbox and OK

2) Add an accessible listener to the Table to specify the accessible name for the current table item. Here is an SWT-only snippet that does this by using TableItem.setData() to store the name for an item:

import org.eclipse.swt.*;
import org.eclipse.swt.widgets.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.accessibility.*;

public class AccessibleTableWithIconsTest2 {
	static int[] Images = new int[] {SWT.ICON_ERROR, SWT.ICON_INFORMATION, SWT.ICON_QUESTION, SWT.ICON_WARNING};
	static String[] ImageNames = new String[] {"ERROR", "INFORMATION", "QUESTION", "WARNING"};
	
	public static void main(String[] args) {
		Display display = new Display();
		Shell shell = new Shell(display);
		shell.setLayout(new GridLayout());
		shell.setText("TableItem Image Names");
		
		final Table table = new Table(shell, SWT.BORDER);
		table.setHeaderVisible(true);
		TableColumn imageColumn = new TableColumn(table, SWT.NONE);
		imageColumn.setText("Image");
		TableColumn imageIdColumn = new TableColumn(table, SWT.NONE);
		imageIdColumn.setText("Image ID");
		for (int i = 0; i < Images.length; i++) {
			TableItem item = new TableItem(table, SWT.NONE);
			item.setImage(0, display.getSystemImage(Images[i]));
			item.setText(1, "Image 0x" + Images[i]);
			item.setData("AccessibleName", ImageNames[i]);
		}
		imageColumn.pack();
		imageIdColumn.pack();
		
		table.getAccessible().addAccessibleListener(new AccessibleAdapter() {
			public void getName(AccessibleEvent e) {
				int i = e.childID;
				if (0 <= i && i < Images.length) {
					TableItem item = table.getItem(i);
					e.result = (String)item.getData("AccessibleName");
				}
			}
		});
		
		shell.pack();
		shell.open();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch()) display.sleep();
		}
		display.dispose();
	}
}

Perhaps step 2 (hooking the accessible listener so that the table item has an accessible name) might be something that JFace should do for free? Eclipse UI, what do you think? This would be along the lines of making the accessible name of an image tool item available for free (as mentioned in bug 385552). If you decide not to do this, please close this bug as "works for me", because the user should be able to reach into the TableViewer and get the Table and come up with a solution by hooking the accessible listener themselves.
Comment 2 Chunqiu Ji CLA 2012-07-25 16:35:25 EDT
Thanks for looking into the issue. Is it possible to fix the problem from Eclipse base side so that we consumer do not need to modify the codes in a lot of places?

Thanks!
Comment 3 Paul Webster CLA 2012-07-26 10:56:18 EDT
Are you already using the org.eclipse.jface.viewers.TableViewerFocusCellManager with a TableViewer?

PW
Comment 4 Chunqiu Ji CLA 2012-07-26 17:09:35 EDT
Hi,
We currently have not used the org.eclipse.jface.viewers.TableViewerFocusCellManager
with a TableViewer.
Comment 5 Lars Vogel CLA 2019-11-27 06:59:48 EST
This bug hasn't had any activity in quite some time. Maybe the problem got
resolved, was a duplicate of something else, or became less pressing for some
reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it.
The information can be, for example, that the problem still occurs, that you
still want the feature, that more information is needed, or that the bug is
(for whatever reason) no longer relevant.

If the bug is still relevant, please remove the stalebug whiteboard tag.