Provide an assistive technology
application
with access to numeric values
You can provide accessibility information about custom UI components that display numeric values, such as progress indicators.
- Import the required interfaces.
import net.rim.device.api.ui.accessibility.AccessibleContext;
import net.rim.device.api.ui.accessibility.AccessibleValue;
AccessibleContext provides the basic accessibility information about a custom UI component.
AccessibleValue provides the information about the numeric values in a custom UI component that displays numeric values.
- Create a class that extends the Field class and implements AccessibleContext and AccessibleValue.
public class GaugeFieldAccessibleValue extends Field
implements AccessibleContext, AccessibleValue
{
}
- Create the variables to store the custom UI component's state and contents.
private int _state;
private int _min;
private int _current;
private int _max;
- Implement the get() methods of AccessibleValue to provide the information about the numeric values.
public int getCurrentAccessibleValue()
{
return _current;
}
public int getMaxAccessibleValue()
{
return _max;
}
public int getMinAccessibleValue()
{
return _min;
}
Was this information helpful? Send us your comments.