@Test public void testMinimalWidthDefaultWidthWithPadding() { gridData.appendColumn(column); gridData.appendRow(new BaseGridRow()); gridData.appendRow(new BaseGridRow()); gridData.appendRow(new BaseGridRow()); mockCellsWithPadding(0, 0, PADDING, 99); mockCellsWithPadding(1, 0, PADDING, 30, 30, 30); mockCellsWithPadding(2, 0, PADDING, 49, 50); assertThat(column.getMinimumWidth()).isEqualTo(119); }
@Override public Double getMinimumWidth() { double minimumWidth = super.getMinimumWidth(); final GridData model = gridWidget.getModel(); final int columnIndex = getLogicalColumnIndex(model); if (columnIndex != -1) { for (GridRow row : model.getRows()) { final GridCell<?> cell = row.getCells().get(columnIndex); if (cell != null) { final GridCellValue<?> value = cell.getValue(); if (value instanceof ExpressionCellValue) { final ExpressionCellValue ecv = (ExpressionCellValue) value; final Optional<BaseExpressionGrid<? extends Expression, ? extends GridData, ? extends BaseUIModelMapper>> editor = ecv.getValue(); final double padding = editor.map(BaseExpressionGrid::getPadding).orElse(0.0); minimumWidth = Math.max(minimumWidth, ecv.getMinimumWidth().orElse(0.0) + padding * 2); } } } } return minimumWidth; }
ExpressionEditorColumn extends DMNGridColumn<BaseGrid<? extends Expression>, Optional<BaseExpressionGrid<? extends Expression, ? extends GridData, ? extends BaseUIModelMapper>>> implements HasDOMElementResources { @Override public Double getMinimumWidth() { double minimumWidth = super.getMinimumWidth(); final GridData model = gridWidget.getModel(); final int columnIndex = getLogicalColumnIndex(model); if (columnIndex != -1) { for (GridRow row : model.getRows()) { final GridCell<?> cell = row.getCells().get(columnIndex); if (cell != null) { final GridCellValue<?> value = cell.getValue(); if (value instanceof ExpressionCellValue) { final ExpressionCellValue ecv = (ExpressionCellValue) value; final Optional<BaseExpressionGrid<? extends Expression, ? extends GridData, ? extends BaseUIModelMapper>> editor = ecv.getValue(); final double padding = editor.map(BaseExpressionGrid::getPadding).orElse(0.0); minimumWidth = Math.max(minimumWidth, ecv.getMinimumWidth().orElse(0.0) + padding * 2); } } } } return minimumWidth; } }
ExpressionEditorColumn extends DMNGridColumn<BaseGrid<? extends Expression>, Optional<BaseExpressionGrid<? extends Expression, ? extends GridData, ? extends BaseUIModelMapper>>> implements HasDOMElementResources { @Override public Double getMinimumWidth() { double minimumWidth = super.getMinimumWidth(); final GridData model = gridWidget.getModel(); final int columnIndex = getLogicalColumnIndex(model); if (columnIndex != -1) { for (GridRow row : model.getRows()) { final GridCell<?> cell = row.getCells().get(columnIndex); if (cell != null) { final GridCellValue<?> value = cell.getValue(); if (value instanceof ExpressionCellValue) { final ExpressionCellValue ecv = (ExpressionCellValue) value; final Optional<BaseExpressionGrid<? extends Expression, ? extends GridData, ? extends BaseUIModelMapper>> editor = ecv.getValue(); final double padding = editor.map(BaseExpressionGrid::getPadding).orElse(0.0); minimumWidth = Math.max(minimumWidth, ecv.getMinimumWidth().orElse(0.0) + padding * 2); } } } } return minimumWidth; } ExpressionEditorColumn(final GridWidgetRegistry registry,
                                  final HeaderMetaData headerMetaData,
                                  final double width,
                                  final BaseGrid<? extends Expression> gridWidget);  ExpressionEditorColumn(final GridWidgetRegistry registry,
                                  final List<HeaderMetaData> headerMetaData,
                                  final double width,
                                  final BaseGrid<? extends Expression> gridWidget); protected  ExpressionEditorColumn(final List<HeaderMetaData> headerMetaData,
                                     final BaseGridColumnRenderer<Optional<BaseExpressionGrid<? extends Expression, ? extends GridData, ? extends BaseUIModelMapper>>> renderer,
                                     final double width,
                                     final BaseGrid<? extends Expression> gridWidget); }
ExpressionEditorColumn extends DMNGridColumn<BaseGrid<? extends Expression>, Optional<BaseExpressionGrid<? extends Expression, ? extends GridData, ? extends BaseUIModelMapper>>> implements HasDOMElementResources { @Override public Double getMinimumWidth() { double minimumWidth = super.getMinimumWidth(); final GridData model = gridWidget.getModel(); final int columnIndex = getLogicalColumnIndex(model); if (columnIndex != -1) { for (GridRow row : model.getRows()) { final GridCell<?> cell = row.getCells().get(columnIndex); if (cell != null) { final GridCellValue<?> value = cell.getValue(); if (value instanceof ExpressionCellValue) { final ExpressionCellValue ecv = (ExpressionCellValue) value; final Optional<BaseExpressionGrid<? extends Expression, ? extends GridData, ? extends BaseUIModelMapper>> editor = ecv.getValue(); final double padding = editor.map(BaseExpressionGrid::getPadding).orElse(0.0); minimumWidth = Math.max(minimumWidth, ecv.getMinimumWidth().orElse(0.0) + padding * 2); } } } } return minimumWidth; } ExpressionEditorColumn(final GridWidgetRegistry registry,
                                  final HeaderMetaData headerMetaData,
                                  final double width,
                                  final BaseGrid<? extends Expression> gridWidget);  ExpressionEditorColumn(final GridWidgetRegistry registry,
                                  final List<HeaderMetaData> headerMetaData,
                                  final double width,
                                  final BaseGrid<? extends Expression> gridWidget); protected  ExpressionEditorColumn(final List<HeaderMetaData> headerMetaData,
                                     final BaseGridColumnRenderer<Optional<BaseExpressionGrid<? extends Expression, ? extends GridData, ? extends BaseUIModelMapper>>> renderer,
                                     final double width,
                                     final BaseGrid<? extends Expression> gridWidget); @Override Double getMinimumWidth(); @Override void setWidth(final double width); @Override void setWidthInternal(final double width); @Override void edit(final GridCell<Optional<BaseExpressionGrid<? extends Expression, ? extends GridData, ? extends BaseUIModelMapper>>> cell,
                     final GridBodyCellEditContext context,
                     final Consumer<GridCellValue<Optional<BaseExpressionGrid<? extends Expression, ? extends GridData, ? extends BaseUIModelMapper>>>> callback); }
ExpressionEditorColumn extends DMNGridColumn<BaseGrid<? extends Expression>, Optional<BaseExpressionGrid<? extends Expression, ? extends GridData, ? extends BaseUIModelMapper>>> implements HasDOMElementResources { @Override public Double getMinimumWidth() { double minimumWidth = super.getMinimumWidth(); final GridData model = gridWidget.getModel(); final int columnIndex = getLogicalColumnIndex(model); if (columnIndex != -1) { for (GridRow row : model.getRows()) { final GridCell<?> cell = row.getCells().get(columnIndex); if (cell != null) { final GridCellValue<?> value = cell.getValue(); if (value instanceof ExpressionCellValue) { final ExpressionCellValue ecv = (ExpressionCellValue) value; final Optional<BaseExpressionGrid<? extends Expression, ? extends GridData, ? extends BaseUIModelMapper>> editor = ecv.getValue(); final double padding = editor.map(BaseExpressionGrid::getPadding).orElse(0.0); minimumWidth = Math.max(minimumWidth, ecv.getMinimumWidth().orElse(0.0) + padding * 2); } } } } return minimumWidth; } ExpressionEditorColumn(final GridWidgetRegistry registry,
                                  final HeaderMetaData headerMetaData,
                                  final double width,
                                  final BaseGrid<? extends Expression> gridWidget);  ExpressionEditorColumn(final GridWidgetRegistry registry,
                                  final List<HeaderMetaData> headerMetaData,
                                  final double width,
                                  final BaseGrid<? extends Expression> gridWidget); protected  ExpressionEditorColumn(final List<HeaderMetaData> headerMetaData,
                                     final BaseGridColumnRenderer<Optional<BaseExpressionGrid<? extends Expression, ? extends GridData, ? extends BaseUIModelMapper>>> renderer,
                                     final double width,
                                     final BaseGrid<? extends Expression> gridWidget); @Override Double getMinimumWidth(); @Override void setWidth(final double width); @Override void setWidthInternal(final double width); @Override void edit(final GridCell<Optional<BaseExpressionGrid<? extends Expression, ? extends GridData, ? extends BaseUIModelMapper>>> cell,
                     final GridBodyCellEditContext context,
                     final Consumer<GridCellValue<Optional<BaseExpressionGrid<? extends Expression, ? extends GridData, ? extends BaseUIModelMapper>>>> callback); static final double DEFAULT_WIDTH; }