use of org.gwtproject.dom.client.TableElement in project gwtproject by treblereel.
the class DataGridTest method testDataGridWidgetStyle.
/**
* Test if the dataGridWidget style is applied.
*/
public void testDataGridWidgetStyle() {
Resources res = new DataGrid_ResourcesImpl();
DataGrid<String> dataGrid = new DataGrid<String>(20, res);
String dataGridWidgetStyle = res.dataGridStyle().dataGridWidget();
TableElement tableElem = dataGrid.getElement().cast();
assertTrue(tableElem.getClassName().contains(dataGridWidgetStyle));
}
use of org.gwtproject.dom.client.TableElement in project gwtproject by treblereel.
the class DataGridTest method getHeaderElement.
@Override
protected TableCellElement getHeaderElement(DataGrid<String> table, int column) {
TableElement tableElem = table.tableHeader.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 getHeaderCount.
@Override
protected int getHeaderCount(CellTable<String> table) {
TableElement tableElem = table.getElement().cast();
TableSectionElement thead = tableElem.getTHead();
if (thead.getRows().getLength() == 0) {
return 0;
}
TableRowElement tr = thead.getRows().getItem(0);
return tr.getCells().getLength();
}
use of org.gwtproject.dom.client.TableElement in project gwtproject by treblereel.
the class CellTableTest method testTableWidgetStyle.
/**
* Test if the tableWidget style is applied.
*/
public void testTableWidgetStyle() {
Resources res = new CellTable_ResourcesImpl();
CellTable<String> table = new CellTable<String>(10, res);
String tableWidgetStyle = res.cellTableStyle().cellTableWidget();
TableElement tableElem = table.getElement().cast();
assertTrue(tableElem.getClassName().contains(tableWidgetStyle));
}
use of org.gwtproject.dom.client.TableElement in project gwtproject by treblereel.
the class GwtElementBuilderImplTestBase method testBuildTable.
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());
}
}
}
Aggregations