This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Accessible [ak-ses-uh-buhl]adjective1. Easy to approach, reach, enter, speak with, or use.2. That can be used, entered, reached, etc.3. Obtainable; attainable.
Accessibility means making something usable by everyone—including people with disabilities.
Examples of improving accessibility– Ramps– curb cuts– accessible doors
According to the World Health Organization, more than 750 million people worldwide have a disability and over 54 million are in the United States.
Reasons to produce Accessible products – Social Responsibility
• Organization’s commitment to people with disabilities– Business Case
• People with disabilities who want and need to use technology have an estimated $175 billion in disposable income
• In many cases, they are the untapped market– Legal Case
• Commitment to comply with worldwide regulations and standards• US Section 508 is the standard that has been most critical• Your Organization checklists will include all of the requirements necessary to
Low Vision– Cannot use the mouse for input, cannot see the screen – Assistive Technology - Need magnification and color contrast– Software should render well for High Contrast mode(Left ALT + left Shift + PrtSc )
Blind – Rely only on audio for navigation– Assistive technology - Need audio output– Software should be compatible for screen readers like Freedom Scientific's JAWS TM
– Need alternate text (Alt+Text)
Mobility– Do not have very good motor skills to use Mouse– Keyboard shortcuts should be present for all actions
For most GUI systems, the default tab order is the order in which the controls are added to the GUI component hierarchy.
Typically the order should follow the physical placement of the visual controls. Often a left−to−right, top−to−bottom order is used, but other orders may be more effective depending on the actual layout.
Methods to override the behaviour»org.eclipse.swt.widgets.Composite getTabList »setTabList methods.
SampleButton b1 = new Button(shell, SWT.PUSH); b1.setText("Button1"); Button b2 = new Button(shell, SWT.PUSH); b2.setText("Button2"); Button b3 = new Button(shell, SWT.PUSH); b3.setText("Button3"); Control[] controls = new Control[] { b2, b1, b3 }; shell.setTabList(controls);
While SWT tries to use native widgets as much as possible, it can not fulfill all common requirements with the native widgets. Therefore some widgets extend the capabilities of the native platform. These are part of the org.eclipse.swt.custom package and usually start with the additional prefix C to indicate that they are custom widgets, e.g. CCombo.
Example - Compared to the Combo class, the CCombo class provides the ability to set the height of the widget.
In such cases, the right associations should be set
A Group name in association with the widget name gives better context to the user
Group group = new Group (shell, SWT.NONE);group.setText ("Contact preference");Button button1 = new Button (group, SWT.RADIO);Button1.setText ("Standard ground mail");Button button2 = new Button (group, SWT.RADIO);Button2.setText ("email");Button button3 = new Button (group, SWT.RADIO);Button3.setText ("Telephone");Button button4 = new Button (group, SWT.RADIO);Button4.setText ("Do not contact")
The group widget allows related widgets to be identified by an additional label for clarification when reading. The name of the group will be read in addition to the name of the widget with focus.
For the elements which do not take focus, e.g Composite, we need to set focus explicitly on the selected element.
When a UI element is in focus, it will be read out.
Useful for dialogs that pop-up a while after they have been triggered
group.setFocus();
In addition accessibility listener should be added to the element. group.getAccessible().addAccessibleListener(new AccessibleAdapter() { public void getName(AccessibleEvent e) { e.result = "Group Label"; } });
A Label will be visible in normal mode and in High Contrast mode, if it has both the background colour and the foreground colour set. The background colour should be set to white so that black characters are visible in normal mode. The foreground colour should be set to black so that the same characters will be visible in white colour in high contrast mode. .
imageLabel = new Label(group, SWT.None);imageLabel.setImage(getIcon());imageLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER | GridData.GRAB_HORIZONTAL));imageLabel.setBackground(RCPCommonImageLibrary.getColor(RCPCommonImageLibrary.WHITE_COLOR));imageLabel.setForeground(RCPCommonImageLibrary.getColor(RCPCommonImageLibrary.BLACK_COLOR));
Classes that implement this interface provide methods that deal with the events that are generated when an accessibility client sends a message to a control.
For example in the following code getName method sets the result on event which can be used by accessibility client.
The accessible of the tree control is retrieved and an AccessibleListener is created and added. The method getName is provided. The results are passed back in the AccessibleEvent member result
Any control can be given a name which can be retrieved by the assistive technology.
3 types of interfaces/classes:– Listeners – Interfaces that provide methods that handle accessibility events.– Adapters – Default implementations of Listeners provided by SWT.– Events – Instances of these classes are sent from accessibility clients to accessible
objects.
– Examples of Listeners:• AccessibleActionListener, AccessibleAttributeListener, AccessibleListener