From: <rom...@us...> - 2007-08-23 15:28:07
|
Revision: 444 http://daisymfcgui.svn.sourceforge.net/daisymfcgui/?rev=444&view=rev Author: romaindeltour Date: 2007-08-23 08:28:01 -0700 (Thu, 23 Aug 2007) Log Message: ----------- Added notes and bookmarks on accessibility related to Eclipse RCP/SWT Added Paths: ----------- trunk/notes/eclipse-accessibility.html trunk/notes/eclipse-accessibility.txt Added: trunk/notes/eclipse-accessibility.html =================================================================== --- trunk/notes/eclipse-accessibility.html (rev 0) +++ trunk/notes/eclipse-accessibility.html 2007-08-23 15:28:01 UTC (rev 444) @@ -0,0 +1,128 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> + <head> + <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8"/> + <title>Accessibility in Eclipse RCP</title> + <link rel="stylesheet" type="text/css" href="notes.css "/> + <meta name="Author" content="Romain Deltour "/> + <meta name="Date" content="2007-08-23"/> + </head> + <body> + <h1 id="accessibilityineclipsercp">Accessibility in Eclipse RCP</h1> + <div class="summary"> + <p>This document groups notes and bookmarks on accessibility and Eclipse (SWT/RCP) technologies.</p> + <p><em>Author</em>: Romain Deltour <br/><em>Date</em>: 2007-08-23</p> + </div> + <div id="toc"> + <h2>Table of Contents</h2> + <ul> + <li> + <a href="#settingtheaccessibleinformation">Setting the accessible information</a> + </li> + <li> + <a href="#swt.labelandaccessibility">SWT.Label and accessibility</a> + </li> + <li> + <a href="#links">Links</a> + <ul> + <li> + <a href="#guidelinesandapis">Guidelines and APIs</a> + </li> + <li> + <a href="#articlesblogswiki">Articles, Blogs, Wiki</a> + </li> + <li> + <a href="#toolsandprojects">Tools and Projects</a> + </li> + </ul> + </li> + </ul> + </div> + <h2 id="settingtheaccessibleinformation">Setting the accessible information</h2> + <p>Following list is taken from IBM's <a href="http://www-03.ibm.com/able/guidelines/software/swuiobject.html" title="IBM Human Ability and Accessibility Center | Developer guidelines">accessibility guidelines</a> for software developers</p> + <ul> + <li>In Eclipse, all widgets provided by the SWT toolkit support Active Accessibility. For text components the accessible name of the control will be set properly and no additional action is required by the application.</li> + <li>For non-text controls created using the org.eclipse.swt.widget.control the name must be explicitly established. This is done by creating an AccessibleListener and using the getName() method.</li> + <li>In Eclipse 3.1 or later, for non-text controls created using org.eclipse.swt.widget.item you must explicitly set the tooltip for each item.</li> + <li>All SWT controls must have and accessible: +<ul><li>Name, role and state</li><li>Must inherit the system setting for font and size, and system colors.</li></ul></li> + <li>If the application wishes to override the default behavior, it can choose to implement the org.eclipse.swt.accessibility.AccessibleListener. This can be used to override Name, Help, Description and Keyboard Shortcut information.</li> + <li>In Eclipse, when implementing a custom control you should also implement some or all of (as they apply to your control) org.eclipse.swt.accessibility.AccessibleListener, org.eclipse.swt.accessibility.AccessibleControlListener and org.eclipse.swt.accessibility.AccessibleTextListener. Also, the custom control can notify Active Accessibility of changes within the control using org.eclipse.swt.accessibility.Accessible methods such as setFocus(), selectionChanged(), textCaretMoved(), textChanged() and textSelectionChanged(). For additional information see section 7.3. When an image represents a program element, make the information conveyed by the image available in text.</li> + </ul> + <h2 id="swt.labelandaccessibility">SWT.Label and accessibility</h2> + <p> + <em>An intersting quote form Carolyn MacLeod (IBM), seen on <code>news.eclipse.platform.swt</code>:</em> + </p> + <p>The reason is that screen readers only speak the text of items that have +focus. And Labels can't take focus.</p> + <p>If, however, the Label happens to be "labelling" (i.e. preceding in the +z-order) something that can take focus, and that does not have a name +itself, such as: Combo, CCombo, List, Spinner, Text, StyledText, Table, or +Slider, then the screen reader will speak the Label.</p> + <p>Also, if a Label is the first Label in a Dialog (i.e. at the top of the +Dialog, and not embedded in more than 1 or maybe 2 composites - I can't +remember how deep) then the screen reader will speak it.</p> + <p>Any other label, then yes you have to use some kind of trick to have it +spoken. One trick, as you mentioned, is to turn it into a read-only Text. +Another trick is to add an accessible listener to the thing that will be +taking focus, perhaps the shell. Here's a snippet to use as an example:</p> + <pre> + <code>import org.eclipse.swt.*; +import org.eclipse.swt.widgets.*; +import org.eclipse.swt.layout.*; +import org.eclipse.swt.accessibility.*; + +public class LabelExampleSpeak { + static Display display; + static Shell shell; + + public static void main(String[] args) { + display = new Display(); + shell = new Shell(display); + shell.setLayout(new GridLayout()); + + Label label = new Label(shell, SWT.NONE); + label.setText("This is the label's text."); + + shell.getAccessible().addAccessibleListener(new AccessibleAdapter() { + public void getName(AccessibleEvent event) { + event.result = "This is the string that you want the screen reader to +speak when the shell gets focus."; + } + }); + + shell.pack(); + shell.open(); + while (!shell.isDisposed()) { + if (!display.readAndDispatch()) display.sleep(); + } + } +}</code> + </pre> + <h2 id="links">Links</h2> + <h3 id="guidelinesandapis">Guidelines and APIs</h3> + <ul> + <li> + <a href="http://www-03.ibm.com/able/guidelines/index.html" title="IBM Human Ability and Accessibility Center | Developer guidelines">IBM Accessibility Guidelines</a> + </li> + <li> + <a href="http://www.section508.gov/" title="Section 508: The Road to Accessibility">Section 508 website</a> + </li> + <li><a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msaa/msaastart_9w2t.asp?frame=true%29" title="Microsoft Active Accessibility">Microsoft Active Accessibility</a> (MSAA)</li> + <li><a href="http://www.linux-foundation.org/en/Accessibility/IAccessible2" title="Accessibility/IAccessible2 - The Linux Foundation">IAccessible2 page</a> of the Linux Foundation</li> + </ul> + <h3 id="articlesblogswiki">Articles, Blogs, Wiki</h3> + <ul> + <li><a href="http://www.eclipse.org/articles/article.php?file=Article-Accessibility/index.html">Designing Accessible Plugins in Eclipse</a> (Eclipse corner article, May 2003 - updated for Eclipse 3.2 in July 2006)</li> + <li><a href="http://www.ibm.com/developerworks/library/os-eclipse-raven/index.html" title="Test GUI accessibility the Eclipse RAVEN way">Test GUI accessibility the Eclipse RAVEN way</a> (IBM Article, May 2007)</li> + <li><a href="http://www-128.ibm.com/developerworks/rational/library/dec05/pilgrim/" title="Creating accessible applications with Eclipse: An introduction">Creating accessible applications with Eclipse: An introduction</a> (IBM Article, December 2005)</li> + <li><a href="http://wiki.eclipse.org/Platform_UI/Accessibility_Features" title="Platform UI/Accessibility Features - Eclipsepedia">Platform UI - Accessibility Features</a> (Eclipsepedia Wiki)</li> + </ul> + <h3 id="toolsandprojects">Tools and Projects</h3> + <ul> + <li><a href="http://www.alphaworks.ibm.com/tech/raven" title="alphaWorks : IBM Rule-based Accessibility Validation Environment : Overview">IBM Rule-based Accessibility Validation Environment</a> (RAVEN)</li> + <li><a href="http://www.microsoft.com/downloads/details.aspx?familyid=3755582A-A707-460A-BF21-1373316E13F0&displaylang=en" title="Active Accessibility 2.0 Software Development Kit Tools">Microsoft Active Accessibility 2.0 SDK Tools</a> (including Inspect32 for inspecting widgets accessible information)</li> + </ul> + </body> +</html> Added: trunk/notes/eclipse-accessibility.txt =================================================================== --- trunk/notes/eclipse-accessibility.txt (rev 0) +++ trunk/notes/eclipse-accessibility.txt 2007-08-23 15:28:01 UTC (rev 444) @@ -0,0 +1,96 @@ +Accessibility in Eclipse RCP +============================ +%CSS: notes.css +%Author: Romain Deltour +%Date: 2007-08-23 + +This document groups notes and bookmarks on accessibility and Eclipse (SWT/RCP) technologies. + +## Setting the accessible information + +Following list is taken from IBM's [accessibility guidelines](http://www-03.ibm.com/able/guidelines/software/swuiobject.html "IBM Human Ability and Accessibility Center | Developer guidelines") for software developers + +* In Eclipse, all widgets provided by the SWT toolkit support Active Accessibility. For text components the accessible name of the control will be set properly and no additional action is required by the application. +* For non-text controls created using the org.eclipse.swt.widget.control the name must be explicitly established. This is done by creating an AccessibleListener and using the getName() method. +* In Eclipse 3.1 or later, for non-text controls created using org.eclipse.swt.widget.item you must explicitly set the tooltip for each item. +* All SWT controls must have and accessible: + * Name, role and state + * Must inherit the system setting for font and size, and system colors. +* If the application wishes to override the default behavior, it can choose to implement the org.eclipse.swt.accessibility.AccessibleListener. This can be used to override Name, Help, Description and Keyboard Shortcut information. +* In Eclipse, when implementing a custom control you should also implement some or all of (as they apply to your control) org.eclipse.swt.accessibility.AccessibleListener, org.eclipse.swt.accessibility.AccessibleControlListener and org.eclipse.swt.accessibility.AccessibleTextListener. Also, the custom control can notify Active Accessibility of changes within the control using org.eclipse.swt.accessibility.Accessible methods such as setFocus(), selectionChanged(), textCaretMoved(), textChanged() and textSelectionChanged(). For additional information see section 7.3. When an image represents a program element, make the information conveyed by the image available in text. + +## SWT.Label and accessibility + +_An intersting quote form Carolyn MacLeod (IBM), seen on `news.eclipse.platform.swt`:_ + +The reason is that screen readers only speak the text of items that have +focus. And Labels can't take focus. + +If, however, the Label happens to be "labelling" (i.e. preceding in the +z-order) something that can take focus, and that does not have a name +itself, such as: Combo, CCombo, List, Spinner, Text, StyledText, Table, or +Slider, then the screen reader will speak the Label. + +Also, if a Label is the first Label in a Dialog (i.e. at the top of the +Dialog, and not embedded in more than 1 or maybe 2 composites - I can't +remember how deep) then the screen reader will speak it. + +Any other label, then yes you have to use some kind of trick to have it +spoken. One trick, as you mentioned, is to turn it into a read-only Text. +Another trick is to add an accessible listener to the thing that will be +taking focus, perhaps the shell. Here's a snippet to use as an example: + + + import org.eclipse.swt.*; + import org.eclipse.swt.widgets.*; + import org.eclipse.swt.layout.*; + import org.eclipse.swt.accessibility.*; + + public class LabelExampleSpeak { + static Display display; + static Shell shell; + + public static void main(String[] args) { + display = new Display(); + shell = new Shell(display); + shell.setLayout(new GridLayout()); + + Label label = new Label(shell, SWT.NONE); + label.setText("This is the label's text."); + + shell.getAccessible().addAccessibleListener(new AccessibleAdapter() { + public void getName(AccessibleEvent event) { + event.result = "This is the string that you want the screen reader to + speak when the shell gets focus."; + } + }); + + shell.pack(); + shell.open(); + while (!shell.isDisposed()) { + if (!display.readAndDispatch()) display.sleep(); + } + } + } + + +## Links + +### Guidelines and APIs + +* [IBM Accessibility Guidelines](http://www-03.ibm.com/able/guidelines/index.html "IBM Human Ability and Accessibility Center | Developer guidelines") +* [Section 508 website](http://www.section508.gov/ "Section 508: The Road to Accessibility") +* [Microsoft Active Accessibility](http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msaa/msaastart_9w2t.asp?frame=true%29 "Microsoft Active Accessibility") (MSAA) +* [IAccessible2 page](http://www.linux-foundation.org/en/Accessibility/IAccessible2 "Accessibility/IAccessible2 - The Linux Foundation") of the Linux Foundation + +### Articles, Blogs, Wiki + +* [Designing Accessible Plugins in Eclipse](http://www.eclipse.org/articles/article.php?file=Article-Accessibility/index.html) (Eclipse corner article, May 2003 - updated for Eclipse 3.2 in July 2006) +* [Test GUI accessibility the Eclipse RAVEN way](http://www.ibm.com/developerworks/library/os-eclipse-raven/index.html "Test GUI accessibility the Eclipse RAVEN way") (IBM Article, May 2007) +* [Creating accessible applications with Eclipse: An introduction](http://www-128.ibm.com/developerworks/rational/library/dec05/pilgrim/ "Creating accessible applications with Eclipse: An introduction") (IBM Article, December 2005) +* [Platform UI - Accessibility Features](http://wiki.eclipse.org/Platform_UI/Accessibility_Features "Platform UI/Accessibility Features - Eclipsepedia") (Eclipsepedia Wiki) + +### Tools and Projects + +* [IBM Rule-based Accessibility Validation Environment](http://www.alphaworks.ibm.com/tech/raven "alphaWorks : IBM Rule-based Accessibility Validation Environment : Overview") (RAVEN) +* [Microsoft Active Accessibility 2.0 SDK Tools](http://www.microsoft.com/downloads/details.aspx?familyid=3755582A-A707-460A-BF21-1373316E13F0&displaylang=en "Active Accessibility 2.0 Software Development Kit Tools") (including Inspect32 for inspecting widgets accessible information) \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |