@Test public void testProposeContainingColumnWidthWhenSmallerThanExisting() { when(gridColumn.getWidth()).thenReturn(100.0); tuple.proposeContainingColumnWidth(50.0, BaseExpressionGrid.RESIZE_EXISTING); verify(gridColumn).setWidth(50.0); }
public void proposeContainingColumnWidth(final double proposedWidth, final Function<BaseExpressionGrid, Double> requiredWidthSupplier) { final GridColumn<?> parentColumn = gridWidget.getModel().getColumns().get(columnIndex); final double requiredWidth = Math.max(proposedWidth, getRequiredParentColumnWidth(proposedWidth, requiredWidthSupplier)); parentColumn.setWidth(requiredWidth); }
GridCellTuple implements RequiresResize { public void proposeContainingColumnWidth(final double proposedWidth, final Function<BaseExpressionGrid, Double> requiredWidthSupplier) { final GridColumn<?> parentColumn = gridWidget.getModel().getColumns().get(columnIndex); final double requiredWidth = Math.max(proposedWidth, getRequiredParentColumnWidth(proposedWidth, requiredWidthSupplier)); parentColumn.setWidth(requiredWidth); } }
GridCellTuple implements RequiresResize { public void proposeContainingColumnWidth(final double proposedWidth, final Function<BaseExpressionGrid, Double> requiredWidthSupplier) { final GridColumn<?> parentColumn = gridWidget.getModel().getColumns().get(columnIndex); final double requiredWidth = Math.max(proposedWidth, getRequiredParentColumnWidth(proposedWidth, requiredWidthSupplier)); parentColumn.setWidth(requiredWidth); } GridCellTuple(final int rowIndex,
                         final int columnIndex,
                         final GridWidget gridWidget); }
GridCellTuple implements RequiresResize { public void proposeContainingColumnWidth(final double proposedWidth, final Function<BaseExpressionGrid, Double> requiredWidthSupplier) { final GridColumn<?> parentColumn = gridWidget.getModel().getColumns().get(columnIndex); final double requiredWidth = Math.max(proposedWidth, getRequiredParentColumnWidth(proposedWidth, requiredWidthSupplier)); parentColumn.setWidth(requiredWidth); } GridCellTuple(final int rowIndex,
                         final int columnIndex,
                         final GridWidget gridWidget); int getRowIndex(); void setRowIndex(final int rowIndex); int getColumnIndex(); void setColumnIndex(final int columnIndex); GridWidget getGridWidget(); void proposeContainingColumnWidth(final double proposedWidth,
                                             final Function<BaseExpressionGrid, Double> requiredWidthSupplier); @Override void onResize(); }
GridCellTuple implements RequiresResize { public void proposeContainingColumnWidth(final double proposedWidth, final Function<BaseExpressionGrid, Double> requiredWidthSupplier) { final GridColumn<?> parentColumn = gridWidget.getModel().getColumns().get(columnIndex); final double requiredWidth = Math.max(proposedWidth, getRequiredParentColumnWidth(proposedWidth, requiredWidthSupplier)); parentColumn.setWidth(requiredWidth); } GridCellTuple(final int rowIndex,
                         final int columnIndex,
                         final GridWidget gridWidget); int getRowIndex(); void setRowIndex(final int rowIndex); int getColumnIndex(); void setColumnIndex(final int columnIndex); GridWidget getGridWidget(); void proposeContainingColumnWidth(final double proposedWidth,
                                             final Function<BaseExpressionGrid, Double> requiredWidthSupplier); @Override void onResize();  }