Disable custom column widths on layouts.
18788
public function disableAreaLayoutCustomColumnWidths()
    {
        $db = Loader::db();
        $db->Execute('update AreaLayouts set arLayoutIsCustom = ? where arLayoutID = ?', array(0, $this->arLayoutID));
        $this->arLayoutIsCustom = false;
    }
1353851
protected void setColumnsFinalWidth() {
        log.debug("Setting columns final width.");
        float factor;
        int printableArea = report.getOptions().getColumnWidth();

        //Create a list with only the visible columns.
        List visibleColums = getVisibleColumns();


        if (report.getOptions().isUseFullPageWidth()) {
            int columnsWidth = 0;
            int notRezisableWidth = 0;

            //Store in a variable the total with of all visible columns
            for (Object visibleColum : visibleColums) {
                AbstractColumn col = (AbstractColumn) visibleColum;
                columnsWidth += col.getWidth();
                if (col.isFixedWidth())
                    notRezisableWidth += col.getWidth();
            }


            factor = (float) (printableArea - notRezisableWidth) / (float) (columnsWidth - notRezisableWidth);

            log.debug("printableArea = " + printableArea
                    + ", columnsWidth = " + columnsWidth
                    + ", columnsWidth = " + columnsWidth
                    + ", notRezisableWidth = " + notRezisableWidth
                    + ", factor = " + factor);

            int acumulated = 0;
            int colFinalWidth;

            //Select the non-resizable columns
            Collection resizableColumns = CollectionUtils.select(visibleColums, new Predicate() {
                public boolean evaluate(Object arg0) {
                    return !((AbstractColumn) arg0).isFixedWidth();
                }

            });

            //Finally, set the new width to the resizable columns
            for (Iterator iter = resizableColumns.iterator(); iter.hasNext(); ) {
                AbstractColumn col = (AbstractColumn) iter.next();

                if (!iter.hasNext()) {
                    col.setWidth(printableArea - notRezisableWidth - acumulated);
                } else {
                    colFinalWidth = (new Float(col.getWidth() * factor)).intValue();
                    acumulated += colFinalWidth;
                    col.setWidth(colFinalWidth);
                }
            }
        }

        // If the columns width changed, the X position must be setted again.
        int posx = 0;
        for (Object visibleColum : visibleColums) {
            AbstractColumn col = (AbstractColumn) visibleColum;
            col.setPosX(posx);
            posx += col.getWidth();
        }
    }
1023942
def delete_cols(self, col, no_cols=1):
        """"""

        # Mark content as changed
        post_command_event(self.main_window, self.ContentChangedMsg)

        tab = self.grid.current_table

        try:
            self.code_array.delete(col, no_cols, axis=1, tab=tab)

        except ValueError, err:
            post_command_event(self.main_window, self.StatusBarMsg,
                               text=err.message)
1272408
public final void setWidth(final int width) {
        if (style == Style.LIST_COLUMNS && (getDeviceType(context) == DeviceType.TABLET ||
                getOrientation(context) == Orientation.LANDSCAPE)) {
            columnCount = 2;
        } else if (style == Style.GRID) {
            int padding = context.getResources()
                    .getDimensionPixelSize(R.dimen.bottom_sheet_grid_item_horizontal_padding);
            int itemSize = context.getResources()
                    .getDimensionPixelSize(R.dimen.bottom_sheet_grid_item_size);
            columnCount = ((getDeviceType(context) != DeviceType.TABLET &&
                    context.getResources().getConfiguration().orientation ==
                            Configuration.ORIENTATION_PORTRAIT ?
                    context.getResources().getDisplayMetrics().widthPixels : width) - 2 * padding) /
                    itemSize;
        } else {
            columnCount = 1;
        }

        rawItems = null;
        notifyDataSetChanged();
    }
679132
def get_col_width(self, col, tab):
        """"""

        try:
            return self.col_widths[(col, tab)]

        except KeyError:
            return config["default_col_width"]
1171095
void updateWidth() {

        if (formCss().firstColumn().equals(m_compacteModeStyle.getValue())) {
            int width = getElement().getParentElement().getOffsetWidth() - formCss().SECOND_COLUMN_WIDTH();
            // if width could not be evaluated, fall back to a 'save' value
            if (width < 0) {
                width = 400;
            }
            getElement().getStyle().setWidth(width, Unit.PX);
        } else {
            getElement().getStyle().clearWidth();
        }
    }
764874
private void adaptWidth() {
        adapter.setWidth(width);

        if (rootView != null) {
            rootView.setWidth(width);
            rootView.requestLayout();
        }
    }
1166904
def OnInsertCols(self, event):
        """"""

        bbox = self.grid.selection.get_bbox()

        if bbox is None or bbox[1][1] is None:
            # Insert rows at cursor
            ins_point = self.grid.actions.cursor[1] - 1
            no_cols = 1
        else:
            # Insert at right edge of bounding box
            ins_point = bbox[0][1] - 1
            no_cols = self._get_no_rowscols(bbox)[1]

        with undo.group(_("Insert columns")):
            self.grid.actions.insert_cols(ins_point, no_cols)

        self.grid.GetTable().ResetView()

        # Update the default sized cell sizes
        self.grid.actions.zoom()

        event.Skip()
938581
function setColumnDefaults(columns) {
    if (!columns)
        return;
    // Only one column should hold the tree view
    // Thus if multiple columns are provided with
    // isTreeColumn as true we take only the first one
    var treeColumnFound = false;
    for (var _i = 0, columns_1 = columns; _i < columns_1.length; _i++) {
        var column = columns_1[_i];
        if (!column.$$id) {
            column.$$id = id_1.id();
        }
        // prop can be numeric; zero is valid not a missing prop
        // translate name => prop
        if (isNullOrUndefined(column.prop) && column.name) {
            column.prop = camel_case_1.camelCase(column.name);
        }
        if (!column.$$valueGetter) {
            column.$$valueGetter = column_prop_getters_1.getterForProp(column.prop);
        }
        // format props if no name passed
        if (!isNullOrUndefined(column.prop) && isNullOrUndefined(column.name)) {
            column.name = camel_case_1.deCamelCase(String(column.prop));
        }
        if (isNullOrUndefined(column.prop) && isNullOrUndefined(column.name)) {
            column.name = ''; // Fixes IE and Edge displaying `null`
        }
        if (!column.hasOwnProperty('resizeable')) {
            column.resizeable = true;
        }
        if (!column.hasOwnProperty('sortable')) {
            column.sortable = true;
        }
        if (!column.hasOwnProperty('draggable')) {
            column.draggable = true;
        }
        if (!column.hasOwnProperty('canAutoResize')) {
            column.canAutoResize = true;
        }
        if (!column.hasOwnProperty('width')) {
            column.width = 150;
        }
        if (!column.hasOwnProperty('isTreeColumn')) {
            column.isTreeColumn = false;
        }
        else {
            if (column.isTreeColumn && !treeColumnFound) {
                // If the first column with isTreeColumn is true found
                // we mark that treeCoulmn is found
                treeColumnFound = true;
            }
            else {
                // After that isTreeColumn property for any other column
                // will be set as false
                column.isTreeColumn = false;
            }
        }
    }
}
1035549
function disableBackspaceIntoATable() {
        editor.on('keydown', function (e) {
          if (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) {
            if (selection.isCollapsed() && selection.getRng(true).startOffset === 0) {
              var previousSibling = selection.getNode().previousSibling;
              if (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === "table") {
                e.preventDefault();
                return false;
              }
            }
          }
        });
      }
1345186
def clear(self):
        
        model = self.tree.model()
        # Don't use model.clear(). it will delete the column sizes
        model.removeRows(0, 1)
        model.setRowCount(1)
        self._setColumnCountForContents()
52739
def _xls2col_widths(self, worksheet, tab):
        """"""

        for col in xrange(worksheet.ncols):
            try:
                xls_width = worksheet.colinfo_map[col].width
                pys_width = self.xls_width2pys_width(xls_width)
                self.code_array.col_widths[col, tab] = pys_width

            except KeyError:
                pass
1286672
private void resetDefaults( TableView tView ) {
        Object[] colNames = tView.getColNames();
        Object[][] tableValues = tView.getCalcdValues();
        // dumpObjs( tableValues, System.out);
        JTable table = new JTable( tableValues, colNames );
        tView.setViewColumnsWidth( table );
        setTitle( tView.getViewTitle() );
        //
        if ( mainSP != null ) getContentPane().remove( mainSP );
        mainSP = new JScrollPane( table );
        getContentPane().add( mainSP, "Center" );
        validate();
    }
696078
public static void adjustColumnWidths(JTable table, int maxWidth)
    {
        final int safety = 20;
        for (int c = 0; c < table.getColumnCount(); c++)
        {
            TableColumn column = table.getColumnModel().getColumn(c);

            TableCellRenderer headerRenderer = column.getHeaderRenderer();
            if (headerRenderer == null) {
                headerRenderer = table.getTableHeader().getDefaultRenderer();
            }
            Component headerComponent = 
                headerRenderer.getTableCellRendererComponent(
                    table, column.getHeaderValue(), false, false, 0, 0);
            int width = headerComponent.getPreferredSize().width;

            for (int r = 0; r < table.getRowCount(); r++) 
            {
                TableCellRenderer cellRenderer = table.getCellRenderer(r, c);
                Component cellComponent = 
                    cellRenderer.getTableCellRendererComponent(
                        table, table.getValueAt(r, c), 
                        false, false, r, c);
                Dimension d = cellComponent.getPreferredSize();
                //System.out.println(
                //    "Preferred is "+d.width+" for "+cellComponent);
                width = Math.max(width, d.width);
            }
            column.setPreferredWidth(Math.min(maxWidth, width + safety));
        }
    }
1175068
def _adjust_rowcol(self, insertion_point, no_to_insert, axis, tab=None):
        """"""

        if axis == 2:
            self._shift_rowcol(insertion_point, no_to_insert)
            return

        assert axis in (0, 1)

        cell_sizes = self.col_widths if axis else self.row_heights
        set_cell_size = self.set_col_width if axis else self.set_row_height

        new_sizes = {}
        del_sizes = []

        for pos, table in cell_sizes:
            if pos > insertion_point and (tab is None or tab == table):
                if 0 <= pos + no_to_insert < self.shape[axis]:
                    new_sizes[(pos + no_to_insert, table)] = \
                        cell_sizes[(pos, table)]
                del_sizes.append((pos, table))

        for pos, table in new_sizes:
            set_cell_size(pos, table, new_sizes[(pos, table)])

        for pos, table in del_sizes:
            if (pos, table) not in new_sizes:
                set_cell_size(pos, table, None)
833673
function setColumnWidth(column, newWidth) {
    // if (column != this.lastVisibleColumn) {
    if (newWidth > this.minColumnWidth || newWidth == this.minColumnWidth) {
        var nowVisibleThIndex = this.getVisibleIndexOfColumn(column),
            oldWidth = column.options.width,
            changeWidth = newWidth - oldWidth,
            cWidth = this.contentWidth + changeWidth;
        this.contentWidth = this.contentWidthChange(cWidth);
        $('#' + this.options.id + '_header_table col:eq(' + nowVisibleThIndex + ')').css('width', newWidth + "px");
        $('#' + this.options.id + '_content_table col:eq(' + nowVisibleThIndex + ')').css('width', newWidth + "px");
        column.options.width = newWidth;
        column.options.realWidth = newWidth;
        this.resetThVariable();
        this.saveGridCompColumnArrToLocal();
    }
    this.resetLastVisibleColumnWidth();
    this.columnsVisibleFun();
    // }
}
236276
function() {
    // Calculate new column count after resize.
    columnCount = getColumnCount();
    if(columnHeights.length != columnCount) {
      // Reset array of column heights and container width.
      resetHeights(columnCount);
      adjustCells(cellsContainer.children, true);
    } else {
      manageCells();
    }
  }