Provide an assistive technology application with access to information from a table

You can provide accessibility information about the custom UI components that display tabular information.

  1. Import the required interfaces.
    import net.rim.device.api.ui.accessibility.AccessibleContext;
    import net.rim.device.api.ui.accessibility.AccessibleTable;
    
    AccessibleContext provides the basic accessibility information about a custom UI component. AccessibleTable provides the information about the tabular information in a custom UI component.
  2. Create a class that implements AccessibleContext and AccessibleTable.
    public class AccessibleTableClass 
      implements AccessibleContext, AccessibleTable 
    {
    }
  3. Create the variables to store the accessibility information about the tabular custom UI component.
    private int _columnCount;
    private int _rowCount;    
    private String[] _columnNames;
    private String[][] _cells;    
    
  4. Implement the get() methods of AccessibleTable to provide the accessibility information about the table.
    public int getAccessibleColumnCount()
    {
      return _columnCount;
    }
    
    public int getAccessibleRowCount()
    {
      return _rowCount;
    }
    
    public AccessibleContext[] getAccessibleColumnHeader()
    {
      AccessibleContext[] result = new AccessibleContext[_columnNames.length];
            
      for( int i = 0; i < result.length; i++ ) 
      {
        result[i] = new AccessibleLabel(_columnNames[i], false);
      }
         
      return result;
    }
    
    public AccessibleContext[] getAccessibleRowHeader()
    {
      return null;
    }
    

Was this information helpful? Send us your comments.