Package net.rim.device.api.ui.accessibility

Examples of net.rim.device.api.ui.accessibility.AccessibleTable


     * @param context
     *            Field on which event occured
     */
    static void handleTable(final int event, final int oldValue,
            final int newValue, final AccessibleContext context) {
        final AccessibleTable table = context.getAccessibleTable();
        if (table == null) {
            System.out
                    .println("Accessible Table doesn't provide table interface");
            return;
        }
View Full Code Here


        case AccessibleRole.TABLE:
            if (busy) {
                Util.speak("table " + name + " loading");
            } else {
                final AccessibleTable table = context.getAccessibleTable();
                if (table != null) {
                    readTableElement(context);
                    if (selectable) {
                        ScreenReaderHandler.handleTableSelection(table);
                    }
View Full Code Here

    static void readTableElement(final AccessibleContext context) {
        if (!(context instanceof AccessibleTable)) {
            return;
        }

        final AccessibleTable table = (AccessibleTable) context;

        // Evaluate number of columns and rows in the accessible table
        final int tableColCount = table.getAccessibleColumnCount();
        final int tableRowCount = table.getAccessibleRowCount();

        String name = context.getAccessibleName();

        if (name == null) {
            name = "";
        }

        // Describe the table
        final StringBuffer tableHeader = new StringBuffer();
        tableHeader.append(name);
        tableHeader.append(" table with ");
        tableHeader.append(tableColCount);
        tableHeader.append(" columns and ");
        tableHeader.append(tableRowCount);
        tableHeader.append(" rows");
        Util.speak(tableHeader.toString());

        // Get the column headers
        final AccessibleContext[] tableColumnsNames =
                table.getAccessibleColumnHeader();

        if (tableColumnsNames != null) {
            // Read cells, column by column
            for (int i = 0; i < tableColumnsNames.length; i++) {
                final AccessibleContext column = tableColumnsNames[i];
                Util.speak("column " + (i + 1));
                if (column == null) {
                    Util.speak("empty");
                } else {
                    readChildElement(column);
                }

                // Read cells in the column
                for (int row = 0; row < tableRowCount; row++) {
                    final AccessibleContext accessibleCell =
                            table.getAccessibleAt(row, i);
                    if (accessibleCell == null) {
                        Util.speak("empty");
                    } else {
                        readChildElement(accessibleCell);
                    }
                }
            }
        } else {
            // Read cells, row by row
            Util.speak("table data");
            for (int row = 0; row < tableRowCount; row++) {
                for (int col = 0; col < tableColCount; col++) {
                    final AccessibleContext accessibleCell =
                            table.getAccessibleAt(row, col);
                    if (accessibleCell == null) {
                        Util.speak("empty");
                    } else {
                        readChildElement(accessibleCell);
                    }
View Full Code Here

TOP

Related Classes of net.rim.device.api.ui.accessibility.AccessibleTable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.