class ColumnPicker extends UberfireColumnPicker<T> {

    public void adjustColumnWidths() {
        super.adjustColumnWidths();
        List<GridColumnPreference> preferences = getColumnsState();

        if (preferences.isEmpty()) {
            return;
        }

        // If there's only 1 column then set it's width to 100%. However store the original 'requested' preferences
        // in case a 2nd or 3rd etc column is added and we then need to revert to the 'requested' width
        if (preferences.size() == 1) {
            columnZeroWidth = Optional.of(preferences.get(0).getWidth());
            dataGrid.setColumnWidth(dataGrid.getColumn(0),
                                    100,
                                    Style.Unit.PCT);
            dataGridMinWidth = defaultColumnWidthSize;
            return;
        }

        //So.. more than one column; we best restore column zero's original 'requested' width
        columnZeroWidth.ifPresent(w -> {
            preferences.get(0).setWidth(w);
            columnZeroWidth = Optional.empty();
        });

        int fixedColumnsWidth = 0;
        Map<String, String> fixedWidths = new HashMap<String, String>();
        List<String> columnsToCalculate = new ArrayList<String>();

        for (GridColumnPreference preference : preferences) {
            if (preference.getWidth() != null && preference.getWidth().endsWith(Style.Unit.PX.getType())) {
                String width = preference.getWidth().substring(0,
                                                               preference.getWidth().indexOf(Style.Unit.PX.getType()));
                if (width.contains(".")) {
                    width = width.substring(0,
                                            width.indexOf("."));
                }

                fixedWidths.put(preference.getName(),
                                width + Style.Unit.PX.getType());

                fixedColumnsWidth += Integer.decode(width);
            } else {
                columnsToCalculate.add(preference.getName());
            }
        }

        if (columnsToCalculate.size() > 0) {

            double columnPCT = (100 / columnsToCalculate.size());

            if (dataGrid.getOffsetWidth() != 0) {
                int availableColumnSpace = dataGrid.getOffsetWidth() - fixedColumnsWidth;
                double availablePCT = availableColumnSpace * 100 / dataGrid.getOffsetWidth();
                columnPCT = columnPCT * availablePCT / 100;
            }

            for (ColumnMeta<T> cm : columnMetaList) {
                if (cm.isVisible()) {
                    if (columnsToCalculate.contains(getColumnStoreName(cm))) {
                        dataGrid.setColumnWidth(cm.getColumn(),
                                                columnPCT,
                                                Style.Unit.PCT);
                    } else {
                        dataGrid.setColumnWidth(cm.getColumn(),
                                                fixedWidths.get(getColumnStoreName(cm)));
                    }
                }
            }
        }
        dataGridMinWidth = fixedColumnsWidth + columnsToCalculate.size() * defaultColumnWidthSize;
    }

    public  ColumnPicker(DataGrid<T> dataGrid,
                        GridPreferencesStore gridPreferences);
    public  ColumnPicker(DataGrid<T> dataGrid);

}