Help Center
Local Navigation
- Creating user interfaces
- Screens
- Touch screen orientation and direction
- Working with the accelerometer of a BlackBerry device
- Types of accelerometer data
- Accelerometer
- Retrieve accelerometer data at specific intervals
- Query the accelerometer when the application is in the foreground
- Query the accelerometer when the application is in the background
- Store accelerometer readings in a buffer
- Retrieve accelerometer readings from a buffer
- Get the time a reading was taken from the accelerometer
- UI components
- Add a UI component to a screen
- Create a dialog box
- Create a bitmap
- Create a button
- Create a list
- Create a drop-down list
- Create a search field
- Create a check box
- Create an option button
- Create a date field
- Creating a text field
- Create a progress indicator
- Create a text label
- Create a list box
- Create a field to display a tree view
- Add a UI component to a screen
- Create a custom field
- Add a menu item to a BlackBerry Device Software application
- Adding a menu item to a BlackBerry Device Software application
- Register a menu item
- Arrange UI components
- Events
- Touch screen events
- Types of touch screen events
- Respond to touch screen events
- Respond to system events while the user touches the screen
- Respond to a user sliding a finger up quickly on the screen
- Respond to a user sliding a finger down quickly on the screen
- Respond to a user sliding a finger to the left quickly on the screen
- Respond to a user sliding a finger to the right quickly on the screen
- Respond to a user clicking the screen
- Respond to a user touching the screen twice quickly
- Respond to a user touching and dragging an item on the screen
- Respond to a user touching the screen lightly
- Respond to a scroll action
- Respond to a user touching the screen in two locations at the same time
- Keyboard on a BlackBerry device with a touch screen
- Spell check
- Accessibility
- Integrating with assistive technology software
- Notifying an assistive technology application when the UI changes
- UI changes that trigger a notification to an assistive technology application
- UI component states and properties
- Provide an assistive technology application with information about a UI change
- Provide an assistive technology application with information about text changes
- Provide an assistive technology application with access to information from a table
- Provide an assistive technology application with access to numeric values
- Enable an assistive technology application to receive notification of UI events
- Storing data
- Creating connections
- Managing applications
- Using custom messages and folders in the message list
- Applications for push content
- Localizing BlackBerry device applications
- Controlling access to APIs and application data
- Testing a BlackBerry device application
- Packaging and distributing a BlackBerry Java Application
- Glossary
- Provide feedback
- Legal notice
BlackBerry Manuals & Help
>
Documentation for Developers
>
Java Development Guides and API Reference
>
Development Guide - BlackBerry Java Development Environment - 4.7.0
Provide an assistive technology application with information about a UI change
- Import the required interface.
import net.rim.device.api.ui.accessibility.AccessibleContext;
- Implement AccessibleContext to represent the information about changes to a custom UI component that an application can make available.
- Create variables to store the accessibility information for a custom UI component, such as state information.
private int _state = AccessibleState.UNSET; private String _accessibleName; private String _title;
- Create the methods that add and remove the states for a custom UI component.
protected void addAccessibleStates(int states) { _state = _state & ~AccessibleState.UNSET; _state = _state | states; } protected void removeAccessibleStates(int states) { _state = _state & ~states; } public void setAccessibleName(String accessibleName) { _accessibleName = accessibleName; } - Implement the get() methods of AccessibleContext, to allow access to tabular, textual, or numerical information for a custom UI component.
Return null if the method does not apply to a custom UI control. For example, if the control does not provide textual information, return null in getAccessibleText().
public AccessibleTable getAccessibleTable() { return null; } public AccessibleText getAccessibleText() { return null; } public AccessibleValue getAccessibleValue() { return null; } - Create a method that returns an instance of the class that implements AccessibleContext, to provide information about a change to a custom UI component.
public AccessibleContext getAccessibleContext() { return this; } - Implement AccessibleContext.getAccessibleRole(), to provide information about the type of custom UI control.
public int getAccessibleRole() { return AccessibleRole.PANEL; } - Implement AccessibleContext.getAccessibleChildCount(), to provide information about the number of accessible child components that a custom UI component contains. It is up to you as the developer of a custom UI component to decide whether or not it contains accessible children. One criterion you can use to decide whether a child element is an accessible child component is whether a child element can gain focus and whether the user can interact with the child element independently.
public int getAccessibleChildCount() { return _icons.size(); } - Implement AccessibleContext.getAccessibleChildAt(int), to provide information about an accessible child component that a custom UI component contains.
public AccessibleContext getAccessibleChildAt(int arg0) { return (Icon) _icons.elementAt( index ); } - Implement AccessibleContext.getAccessibleName(), to provide the name of a custom UI component that changes.
public String getAccessibleName() { return _accessibleName; } - Create a method that invokes AccessibleEventDispatcher.dispatchAccessibleEvent(stateChange, oldState, newState, this), to send a notification when the state of a custom UI component changes. Use the following information as arguments to the method:
- the event
- the old state of the custom UI component
- the new state of the custom UI component
- an instance of the custom UI component
protected void onFocus(int direction) { super.onFocus(direction); int oldState = _state; _state = _state | AccessibleState.FOCUSED; if(isVisible()) { AccessibleEventDispatcher.dispatchAccessibleEvent( AccessibleContext.ACCESSIBLE_STATE_CHANGED, new Integer(oldState), new Integer(_state), this); } }
Parent topic: Accessibility