use of com.google.gwt.dom.client.TableCellElement in project drools-wb by kiegroup.
the class TemplateDataHeaderWidget method resizeColumn.
// Resize the inner DIV in each table cell
protected void resizeColumn(DynamicColumn<TemplateDataColumn> resizeColumn, int resizeColumnWidth) {
DivElement div;
TableCellElement tce;
// This is also set in the ColumnResizeEvent handler, however it makes
// resizing columns in the header more simple too
resizeColumn.setWidth(resizeColumnWidth);
int resizeColumnIndex = widget.headerColumns.indexOf(resizeColumn);
// Row 0 (General\Fact Type)
tce = widget.headerRows[0].getChild(resizeColumnIndex).<TableCellElement>cast();
div = tce.getFirstChild().<DivElement>cast();
div.getStyle().setWidth(resizeColumnWidth, Unit.PX);
// Row 1 (Sorters)
tce = widget.headerRows[1].getChild(resizeColumnIndex).<TableCellElement>cast();
div = tce.getFirstChild().<DivElement>cast();
div.getStyle().setWidth(resizeColumnWidth, Unit.PX);
// Fire event to any interested consumers
ColumnResizeEvent cre = new ColumnResizeEvent(widget.headerColumns.get(resizeColumnIndex), resizeColumnWidth);
eventBus.fireEvent(cre);
}
use of com.google.gwt.dom.client.TableCellElement in project gwt-test-utils by gwt-test-utils.
the class GridPatcher method createRow.
private static TableRowElement createRow(int columns, String cellContent) {
TableRowElement tr = Document.get().createTRElement();
for (int i = 0; i < columns; i++) {
TableCellElement cell = Document.get().createTDElement();
cell.setInnerHTML(cellContent);
tr.appendChild(cell);
}
return tr;
}
use of com.google.gwt.dom.client.TableCellElement in project gwt-test-utils by gwt-test-utils.
the class TableRowElementTest method deleteCell.
@Test
public void deleteCell() {
// Given
TableCellElement td0 = Document.get().createTDElement();
tr.appendChild(td0);
TableCellElement td1 = Document.get().createTDElement();
tr.appendChild(td1);
// When
tr.deleteCell(0);
// Then
assertThat(tr.getChildCount()).isEqualTo(1);
assertThat(tr.getChild(0)).isEqualTo(td1);
}
use of com.google.gwt.dom.client.TableCellElement in project gwt-test-utils by gwt-test-utils.
the class TableRowElementTest method insertCell.
@Test
public void insertCell() {
// Given
TableCellElement td0 = Document.get().createTDElement();
tr.appendChild(td0);
TableCellElement td1 = Document.get().createTDElement();
tr.appendChild(td1);
// When
TableCellElement insert = tr.insertCell(1);
// Then
assertThat(tr.getChildCount()).isEqualTo(3);
assertThat(tr.getChild(0)).isEqualTo(td0);
assertThat(tr.getChild(1)).isEqualTo(insert);
assertThat(tr.getChild(2)).isEqualTo(td1);
}
use of com.google.gwt.dom.client.TableCellElement in project rstudio by rstudio.
the class FindOutputCodec method addBreak.
@Override
protected int addBreak(TableRowElement row) {
TableRowElement tr = Document.get().createTRElement();
tr.setClassName(styles_.headerRow());
TableCellElement td = Document.get().createTDElement();
td.setColSpan(2);
td.setInnerText(row.getAttribute(DATA_FILE));
tr.appendChild(td);
row.getParentElement().insertBefore(tr, row);
return 1;
}
Aggregations