use of org.gwtproject.dom.client.TableElement in project gwtproject by treblereel.
the class CellTableTest method getHeaderElement.
@Override
protected TableCellElement getHeaderElement(CellTable<String> table, int column) {
TableElement tableElem = table.getElement().cast();
TableSectionElement thead = tableElem.getTHead();
TableRowElement tr = thead.getRows().getItem(0);
return tr.getCells().getItem(column);
}
use of org.gwtproject.dom.client.TableElement in project gwtproject by treblereel.
the class CellTableTest method getBodyElement.
@Override
protected TableCellElement getBodyElement(CellTable<String> table, int row, int column) {
TableElement tableElem = table.getElement().cast();
TableSectionElement tbody = tableElem.getTBodies().getItem(0);
TableRowElement tr = tbody.getRows().getItem(row);
return tr.getCells().getItem(column);
}
use of org.gwtproject.dom.client.TableElement in project gwtproject by treblereel.
the class DataGridTest method getBodyElement.
@Override
protected TableCellElement getBodyElement(DataGrid<String> table, int row, int column) {
TableElement tableElem = table.tableData.getElement().cast();
TableSectionElement tbody = tableElem.getTBodies().getItem(0);
TableRowElement tr = tbody.getRows().getItem(row);
return tr.getCells().getItem(column);
}
use of org.gwtproject.dom.client.TableElement in project gwtproject by treblereel.
the class J2clElementBuilderImplTestBase method testBuildTable.
@Test
public void testBuildTable() {
// Build a table.
TableBuilder tableBuilder = factory.createTableBuilder().id("mytable");
TableSectionBuilder tbody = tableBuilder.startTBody();
for (int r = 0; r < 5; r++) {
TableRowBuilder tr = tbody.startTR().id("row" + r);
for (int c = 0; c < 3; c++) {
tr.startTD().text(r + ":" + c).endTD();
}
tr.endTR();
}
tbody.endTBody();
tableBuilder.endTable();
// Check the rendered element.
TableElement table = tableBuilder.finish().cast();
assertEquals(5, table.getRows().getLength());
for (int r = 0; r < 5; r++) {
TableRowElement tr = table.getRows().getItem(r);
assertEquals(3, tr.getCells().getLength());
for (int c = 0; c < 3; c++) {
TableCellElement td = tr.getCells().getItem(c);
assertEquals(r + ":" + c, td.getInnerText());
}
}
}
use of org.gwtproject.dom.client.TableElement in project gwtproject by treblereel.
the class DataGridTest method getHeaderCount.
@Override
protected int getHeaderCount(DataGrid<String> table) {
TableElement tableElem = table.tableHeader.getElement().cast();
TableSectionElement thead = tableElem.getTHead();
if (thead.getRows().getLength() == 0) {
return 0;
}
TableRowElement tr = thead.getRows().getItem(0);
return tr.getCells().getLength();
}
Aggregations