Getting cell, column values from an SWT Table (Java, SWT)

Last edited on

def get_swt_table_cell_value(swt_table, row, column):
    row = swt_table.getItem(row)
    return row.getText(column)

def main():
    # ...

    swt_table = waitForObject("{isvisible='true' type='org.eclipse.swt.widgets.Table'}")
    for row in range(swt_table.getItemCount()):
        for column in range(swt_table.getColumnCount()):
            v = get_swt_table_cell_value(swt_table, row, column)
            test.log("%s/%s: %s" % (row, column, v))
test.py