protected int getColumnWidths(int start, int end) { int w = 0; for (int i = start; i < end; i++) { if (!cm.isHidden(i)) { w += cm.getColumnWidth(i); } } return w; }
protected String renderHiddenHeaders(int[] columnWidths) { StringBuffer heads = new StringBuffer(); heads.append("<tr>"); for (int i = 0; i < columnWidths.length; i++) { // unlike GridView, we do NOT render TH's for hidden elements because of // support of // rowspan and colspan with header configs if (cm.isHidden(i)) { continue; } String styles = "height: 0px; width: " + columnWidths[i] + "px;"; heads.append("<th style=\"" + styles + "\"></th>"); } heads.append("</tr>"); return heads.toString(); }
public void componentSelected(MenuEvent ce) { cm.setHidden(fcol, !cm.isHidden(fcol)); restrictMenu(columnMenu); } });
private boolean shouldNotCount(int columnIndex, boolean includeHidden) { return cm.getColumnHeader(columnIndex) == null || cm.getColumnHeader(columnIndex).equals("") || (includeHidden && cm.isHidden(columnIndex)) || cm.isFixed(columnIndex); }
protected String getColumnStyle(int colIndex, boolean isHeader) { String style = !isHeader ? cm.getColumnStyle(colIndex) : ""; if (style == null) style = ""; style += "width:" + (getColumnWidth(colIndex)) + "px;"; if (cm.isHidden(colIndex)) { style += "display:none;"; } HorizontalAlignment align = cm.getColumnAlignment(colIndex); if (align != null) { style += "text-align:" + align.name() + ";"; } return style; }
public void updateColumnWidth(int column, int width) { if (!cm.isHidden(column)) { for (int i = 0; i < rows.size(); i++) { FooterRow row = rows.get(i); El.fly(row.table.getCellFormatter().getElement(0, column)).setWidth(width, true); Widget w = row.table.getWidget(0, column); El.fly(w.getElement()).setWidth(width - 2, 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); } } } } }
if (cm.isHidden(i)) { continue;
ColumnModel cm = grid.getColumnModel(); for (int i = 0, len = cm.getColumnCount(); i < len; i++) { if (!cm.isHidden(i)) { Component c = getItem(i); if (c instanceof LabelField) {
if (!cm.isHidden(i)) { before = i; break;
protected void onDragStart(DragEvent e) { headerDisabled = true; dragging = true; setStyleAttribute("borderLeft", "1px solid black"); setStyleAttribute("cursor", "default"); el().setStyleAttribute("opacity", "1"); el().setWidth(1); startX = e.getX(); int cols = cm.getColumnCount(); for (int i = 0, len = cols; i < len; i++) { if (cm.isHidden(i) || !cm.isResizable(i)) continue; Element hd = getHead(i).getElement(); if (hd != null) { Region rr = El.fly(hd).getRegion(); if (startX > rr.right - 5 && startX < rr.right + 5) { colIndex = heads.indexOf(getHead(i)); if (colIndex != -1) break; } } } if (colIndex > -1) { Element c = getHead(colIndex).getElement(); int x = startX; int minx = x - fly((com.google.gwt.user.client.Element) c).getX() - minColumnWidth; int maxx = (container.el().getX() + container.el().getWidth()) - e.getEvent().getClientX(); d.setXConstraint(minx, maxx); } }
protected void verifyLayout(boolean force) { if (initialized && (isVisible() || force)) { Element row = (Element) grid.getView().getRow(rowIndex); setSize(El.fly(row).getWidth(false), renderButtons ? btns.getHeight() : 0); syncSize(); ColumnModel cm = grid.getColumnModel(); for (int i = 0, len = cm.getColumnCount(); i < len; i++) { if (!cm.isHidden(i)) { Field<?> f = (Field<?>) getItem(i); f.show(); f.getElement().setAttribute("gxt-dindex", "" + cm.getDataIndex(i)); MarginData md = (MarginData) ComponentHelper.getLayoutData(f); f.setWidth(cm.getColumnWidth(i) - md.getMargins().left - md.getMargins().right); } else { getItem(i).hide(); } } layout(true); positionButtons(); } }
if (cm.isHidden(i)) { updateColumnHidden(i, true);
Element cellEl = null; if (!(!hscroll && col == 0)) { while (cm.isHidden(col)) { col++;
check.setHideOnClick(false); check.setHtml(cm.getColumnHeader(i)); check.setChecked(!cm.isHidden(i)); check.addSelectionListener(new SelectionListener<MenuEvent>() { public void componentSelected(MenuEvent ce) {