/** * Sets the column's width. * * @param colIndex the column index * @param width the width */ public void setColumnWidth(int colIndex, int width) { setColumnWidth(colIndex, width, false); }
@SuppressWarnings("unchecked") protected void onColumnSplitterMoved(int colIndex, int width) { stopEditing(); userResized = true; width = Math.max(grid.getMinColumnWidth(), width); cm.setColumnWidth(colIndex, width); GridEvent<ModelData> e = (GridEvent<ModelData>) createComponentEvent(null); e.setColIndex(colIndex); e.setWidth(width); grid.fireEvent(Events.ColumnResize, e); }
int i = cols.pop(); int ww = Math.max(grid.getMinColumnWidth(), (int) Math.floor(w + w * frac)); cm.setColumnWidth(i, ww, true); int i = cols.pop(); int ww = Math.max(grid.getMinColumnWidth(), (int) Math.floor(w + w * frac)); cm.setColumnWidth(i, ww, true);
protected void autoExpand(boolean preventUpdate) { if (!userResized && grid.getAutoExpandColumn() != null) { int tw = cm.getTotalWidth(false); int aw = grid.getWidth(true) - getScrollAdjust(); if (tw != aw) { int ci = cm.getIndexById(grid.getAutoExpandColumn()); assert ci != Style.DEFAULT : "auto expand column not found"; if (cm.isHidden(ci)) { return; } int currentWidth = cm.getColumnWidth(ci); int cw = Math.min(Math.max(((aw - tw) + currentWidth), grid.getAutoExpandMin()), grid.getAutoExpandMax()); if (cw != currentWidth) { cm.setColumnWidth(ci, cw, true); if (!preventUpdate) { updateColumnWidth(ci, cw); } } } } }