use of org.kie.workbench.common.widgets.decoratedgrid.client.widget.events.ColumnResizeEvent 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);
}
Aggregations