Bug 288272 - [Accessibility] FilteredList does not allow role to be overridden for JAWS screen reader
Summary: [Accessibility] FilteredList does not allow role to be overridden for JAWS sc...
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact: Carolyn MacLeod CLA
URL:
Whiteboard: stalebug
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2009-09-01 11:16 EDT by Barry Dow CLA
Modified: 2020-06-14 16:52 EDT (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 Barry Dow CLA 2009-09-01 11:16:04 EDT
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.11) Gecko/2009060403 Red Hat/3.0.11-2.el5_3 (CK-IBM) (CK-IBM) Firefox/3.0.11
Build Identifier: n/a - the version that is embedded in Rational Software Architect 7.5.3

I am trying to get the Label preceding a FilteredList to be read out by the JAWS screen reader when the list box is given focus by tabbing to it. The default behaviour is for JAWS to read out the first item in the list.

I tried to override that behaviour by adding an AccessibleControlListener to the FilteredList and provide an AccessibleControlAdapter and override the getRole method to specifiy that this custom control should behave like a Text widget like this: @Override
public void getRole(AccessibleControlEvent e) {
e.detail = ACC.ROLE_TEXT;
}

Is this right or am I doing something wrong?

Reproducible: Always

Steps to Reproduce:
1.Create a composite with a Label and a FilteredList 
2.Add some elements to the FilteredList
3.Using JAWS screen reader tab to FilteredList - the label is not read out just the first item in the list.
Comment 1 Carolyn MacLeod CLA 2009-10-14 12:10:56 EDT
I do not have the code for FilteredList, so I cannot try it.
I would have thought that JAWS would read the label text when the list takes focus - that it what it does with a platform list.
Note that the Label must immediately precede the list in the z-order, i.e. it has to be created immediately before the list is created.
You need to keep your list's role as ROLE_LIST and the items as ROLE_LISTITEM.
What happens when you add an AccessibleListener, and override getName to set the event result to the label text when the event childId is CHILDID_SELF?
Comment 2 Kerry Stares CLA 2010-01-19 09:22:31 EST
The wizards that are seeing the problem are slightly odd in that the first field in the first wizard page is the filtered list. Some initial pages do not have any input fields at all. The just is just required to select an item from the list contents. I have attached a rtaher large test case that demonstrates the problems. Its built as a two page wizard to simulate a wizard being launched fromt the Eclipse->File->New wizard select menu. As it uses wizard and wizard page it does require a jface jar. Hope thats not a problem. The suggestions about setting the accessibility role does not make any difference. You will see that the the label on the list of the second wizard page is never read.

package wizardExamp;

import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.accessibility.ACC;
import org.eclipse.swt.accessibility.AccessibleControlAdapter;
import org.eclipse.swt.accessibility.AccessibleControlEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.List;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TableItem;

public class WizardTestDialog {
  /**
   * Run the application
   */
	
 
  
  public void run() {
    Display display = new Display();

    // Create the parent shell for the dialog, but don't show it
    Shell shell = new Shell(display);

    // Create the dialog
    WizardDialog dlg = new WizardDialog(shell, new TestWizard());
    dlg.setTitle("Demonstrate Wizard JAWS issue");
    dlg.open();

    // Dispose the display
    display.dispose();
  }

  /**
   * The application entry point
   * 
   * @param args
   *            the command line arguments
   */
  public static void main(String[] args) {
    new WizardTestDialog().run();
  }
}

class TestWizard extends Wizard {
  public TestWizard() {
	setWindowTitle("Demonstrate Wizard JAWS issue");
    // Add the pages
    addPage(new FirstPage());
    addPage(new LastPage());
  }

  /**
   * Called when user clicks Finish
   * 
   * @return boolean
   */
  public boolean performFinish() {
    // End the wizard
    return true;
  }
}

class LastPage extends WizardPage {
  private String[] flistEntries = {"first", "second"};
  private boolean pageComplete = false;

  public LastPage() {
    super("LastPage");
    setTitle("Second page of test wizard");
  }

  /**
   * Create the page controls
   */
  public void createControl(Composite parent) {

    Composite selectFList = new Composite(parent, SWT.NONE);
    selectFList.setLayoutData(
        new GridData(SWT.FILL, SWT.FILL, true, true));
    
    selectFList.setLayout(new GridLayout(1, true));
    
    // label
    Label selectProjectLabel = new Label(selectFList, SWT.NONE);
    selectProjectLabel.setText("A Label for the filtered list below");              
    
    final List fList = new List(
    		selectFList, SWT.BORDER);
    
    fList.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    
    for(int i=0; i<flistEntries.length; i++) {
    	fList.add(flistEntries[i]);
    }
    
    fList.getAccessible().addAccessibleControlListener (new AccessibleControlAdapter () {
    	public void getRole(AccessibleControlEvent e) {
			e.detail = ACC.ROLE_LIST;
		}
	});

    setControl(selectFList);
  }

  public boolean isPageComplete() {
      return pageComplete;
  }
  
  public IWizardPage getNextPage() {
	  return null;
    // return getWizard().getPage("LastPage");
  }
}
/**
 * This page gathers more information about the complaint
 */
class FirstPage extends WizardPage {
  /**
   * MoreInformationPage constructor
   */
  public FirstPage() {
    super("FirstPage");
    setTitle("First page of test wizard");
  }
  
  /**
   * Creates the controls for this page
   */
  public void createControl(Composite parent) {
    Composite composite = new Composite(parent, SWT.NONE);
    composite.setLayout(new GridLayout(1, false));

    new Label(composite, SWT.LEFT).setText("Please press Next");

    setControl(composite);
  }
}
Comment 3 Leo Ufimtsev CLA 2017-08-03 12:32:01 EDT
This is a one-off bulk update. (The last one in the triage migration).

Moving bugs from swt-triaged@eclipse to platform-swt-inbox@eclipse.org and adding "triaged" keyword as per new triage process:
https://wiki.eclipse.org/SWT/Devel/Triage

See Bug 518478 for details.

Tag for notification/mail filters:
@TriageBulkUpdate
Comment 4 Eclipse Genie CLA 2020-06-14 16:52:14 EDT
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. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. 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.

--
The automated Eclipse Genie.