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.

  1. 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.
  2. Create a class that extends the Field class and implements AccessibleContext and AccessibleValue.
    public class GaugeFieldAccessibleValue extends Field
      implements AccessibleContext, AccessibleValue 
  3. 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;
  4. 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.