Example usage for com.google.gwt.user.client.ui HTMLTable getCellCount

List of usage examples for com.google.gwt.user.client.ui HTMLTable getCellCount

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui HTMLTable getCellCount.

Prototype

public abstract int getCellCount(int row);

Source Link

Document

Gets the number of cells in a given row.

Usage

From source file:org.jax.gwtutil.client.WidgetUtilities.java

License:Open Source License

/**
 * Get the row index of the widget//from ww w. j a va 2s .  co m
 * @param widget
 *      the widget
 * @param table
 *      the table
 * @return
 *      the row index or -1 if the widget isn't in the table
 */
public static int getRowIndexOf(Widget widget, HTMLTable table) {
    int rowCount = table.getRowCount();
    for (int row = 0; row < rowCount; row++) {
        int cellCount = table.getCellCount(row);
        for (int column = 0; column < cellCount; column++) {
            if (table.getWidget(row, column) == widget) {
                return row;
            }
        }
    }

    return -1;
}

From source file:org.sigmah.client.ui.view.project.logframe.grid.HTMLTableUtils.java

License:Open Source License

/**
 * Applies the CSS header styles to a GWT table.
 * //from w  w w.  j a va 2s .c  om
 * @param table
 *          The GWT table.
 * @param applyToRows
 *          If the first column contains also headers (double entry array).
 */
public static void applyHeaderStyles(HTMLTable table, boolean applyToRows) {

    // Rows.
    if (applyToRows) {
        for (int row = 0; row < table.getRowCount(); row++) {
            applyRowStyles(table, row);
            applyRowHeaderStyles(table, row, 0);
            // for (int column = 0; column < table.getCellCount(row); column++) {
            //
            // }
        }
    }

    // Columns.
    for (int column = 0; column < table.getCellCount(0); column++) {
        applyColumnHeaderStyles(table, 0, column);
    }
}