@Test @SuppressWarnings("unchecked") public void testRowHigherThanDefault() { when(view.getHeight()).thenReturn(DEFAULT_HEIGHT + 1); final GridRow row = spy(ExpressionEditorGridRow.class); final Map<Integer, GridCell<?>> cells = new Maps.Builder<Integer, GridCell<?>>() .put(0, new BaseGridCell<>(new ExpressionCellValue(Optional.of(view)))) .build(); when(row.getCells()).thenReturn(cells); assertThat(row.getHeight()).isGreaterThan(DEFAULT_HEIGHT); }
@Override public double getHeight() { long currentTimeMillis = log(LOGGER, " - Pre- ExpressionEditorGridRow.getHeight()"); final double height = this.getCells() .values() .stream() .filter(cell -> cell != null && cell.getValue() != null) .map(GridCell::getValue) .filter(value -> value instanceof ExpressionCellValue) .map(value -> (ExpressionCellValue) value) .filter(value -> value.getValue().isPresent()) .map(value -> value.getValue().get()) .map(editor -> editor.getHeight() + editor.getPadding() * 2) .reduce(Double::max) .orElse(defaultHeight); log(LOGGER, " - Post- ExpressionEditorGridRow.getHeight()", currentTimeMillis); return height; }
ExpressionEditorGridRow extends BaseGridRow { @Override public double getHeight() { long currentTimeMillis = log(LOGGER, " - Pre- ExpressionEditorGridRow.getHeight()"); final double height = this.getCells() .values() .stream() .filter(cell -> cell != null && cell.getValue() != null) .map(GridCell::getValue) .filter(value -> value instanceof ExpressionCellValue) .map(value -> (ExpressionCellValue) value) .filter(value -> value.getValue().isPresent()) .map(value -> value.getValue().get()) .map(editor -> editor.getHeight() + editor.getPadding() * 2) .reduce(Double::max) .orElse(defaultHeight); log(LOGGER, " - Post- ExpressionEditorGridRow.getHeight()", currentTimeMillis); return height; } }
ExpressionEditorGridRow extends BaseGridRow { @Override public double getHeight() { long currentTimeMillis = log(LOGGER, " - Pre- ExpressionEditorGridRow.getHeight()"); final double height = this.getCells() .values() .stream() .filter(cell -> cell != null && cell.getValue() != null) .map(GridCell::getValue) .filter(value -> value instanceof ExpressionCellValue) .map(value -> (ExpressionCellValue) value) .filter(value -> value.getValue().isPresent()) .map(value -> value.getValue().get()) .map(editor -> editor.getHeight() + editor.getPadding() * 2) .reduce(Double::max) .orElse(defaultHeight); log(LOGGER, " - Post- ExpressionEditorGridRow.getHeight()", currentTimeMillis); return height; } ExpressionEditorGridRow();  ExpressionEditorGridRow(final double height); }
ExpressionEditorGridRow extends BaseGridRow { @Override public double getHeight() { long currentTimeMillis = log(LOGGER, " - Pre- ExpressionEditorGridRow.getHeight()"); final double height = this.getCells() .values() .stream() .filter(cell -> cell != null && cell.getValue() != null) .map(GridCell::getValue) .filter(value -> value instanceof ExpressionCellValue) .map(value -> (ExpressionCellValue) value) .filter(value -> value.getValue().isPresent()) .map(value -> value.getValue().get()) .map(editor -> editor.getHeight() + editor.getPadding() * 2) .reduce(Double::max) .orElse(defaultHeight); log(LOGGER, " - Post- ExpressionEditorGridRow.getHeight()", currentTimeMillis); return height; } ExpressionEditorGridRow();  ExpressionEditorGridRow(final double height); @Override double getHeight(); }
ExpressionEditorGridRow extends BaseGridRow { @Override public double getHeight() { long currentTimeMillis = log(LOGGER, " - Pre- ExpressionEditorGridRow.getHeight()"); final double height = this.getCells() .values() .stream() .filter(cell -> cell != null && cell.getValue() != null) .map(GridCell::getValue) .filter(value -> value instanceof ExpressionCellValue) .map(value -> (ExpressionCellValue) value) .filter(value -> value.getValue().isPresent()) .map(value -> value.getValue().get()) .map(editor -> editor.getHeight() + editor.getPadding() * 2) .reduce(Double::max) .orElse(defaultHeight); log(LOGGER, " - Post- ExpressionEditorGridRow.getHeight()", currentTimeMillis); return height; } ExpressionEditorGridRow();  ExpressionEditorGridRow(final double height); @Override double getHeight(); static final double DEFAULT_HEIGHT; }