use of org.gwtproject.dom.client.TableRowElement in project gwtproject by treblereel.
the class AbstractCellTableTestBase method testSetHeaderBuilder.
public void testSetHeaderBuilder() {
T table = createAbstractHasData();
HeaderBuilder<String> headerBuilder = new AbstractHeaderOrFooterBuilder<String>(table, false) {
@Override
protected boolean buildHeaderOrFooterImpl() {
TableRowBuilder tr = startRow();
tr.startTH().text("Col 0").endTH();
tr.startTH().text("Col 1").endTH();
tr.startTH().text("Col 2").endTH();
tr.endTR();
return true;
}
};
// Change the header builder.
table.setHeaderBuilder(headerBuilder);
assertEquals(headerBuilder, table.getHeaderBuilder());
table.getPresenter().flush();
// Verify the new header.
NodeList<TableRowElement> rows = table.getTableHeadElement().getRows();
assertEquals(1, rows.getLength());
NodeList<TableCellElement> cells = rows.getItem(0).getCells();
assertEquals(3, cells.getLength());
assertEquals("Col 0", cells.getItem(0).getInnerText());
assertEquals("Col 1", cells.getItem(1).getInnerText());
assertEquals("Col 2", cells.getItem(2).getInnerText());
}
use of org.gwtproject.dom.client.TableRowElement 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.TableRowElement 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.TableRowElement 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.TableRowElement in project gwtproject by treblereel.
the class AbstractCellTable method onBlur.
@Override
protected void onBlur() {
TableCellElement td = getKeyboardSelectedTableCellElement();
if (td != null) {
TableRowElement tr = td.getParentElement().cast();
td.removeClassName(style.keyboardSelectedCell());
setRowStyleName(tr, style.keyboardSelectedRow(), style.keyboardSelectedRowCell(), false);
}
}
Aggregations