/** * Returns the column width. * * @param colIndex the column index * @return the width */ public int getColumnWidth(int colIndex) { ColumnConfig c = getColumn(colIndex); return c != null ? c.getWidth() : -1; }
/** * Returns the total width of all columns. * * @param includeHidden true to include hidden column widths * @return the total */ public int getTotalWidth(boolean includeHidden) { int w = 0; for (ColumnConfig c : configs) { if (includeHidden || !c.isHidden()) { w += c.getWidth(); } } return w; }
int w = cc.getWidth(); Element cell = head.getElement().getParentElement().cast(); adjustCellWidth(cell, w);
public void handleEvent(GridEvent<RuleModel> be) { Dispatcher.forwardEvent(GeofenceEvents.SEND_INFO_MESSAGE, new String[]{"DEBUG","Resizing " + be.getGrid().getColumnModel().getColumnId(be.getColIndex())}); for (int i = 0; i < be.getGrid().getStore().getCount(); i++) { // there should be only 1 row // let's force a resize on all the columns for (int col = 0; col < be.getGrid().getColumnModel().getColumnCount(); col++) { // final Widget widget = be.getGrid().getView().getWidget(i, be.getColIndex()); final Widget widget = be.getGrid().getView().getWidget(i, col); // Dispatcher.forwardEvent(GeofenceEvents.SEND_INFO_MESSAGE, // new String[]{"DEBUG","Resizing " + widget.getClass().getName() + "--" + widget.getTitle()}); int colWidth = be.getGrid().getColumnModel().getColumn(col).getWidth(); if ((widget != null) && (widget instanceof BoxComponent)) { // ((BoxComponent) widget).setWidth(be.getWidth() - offset); ((BoxComponent) widget).setWidth(colWidth - offset); } } } } }