/** * Customize the given TableBuilder with almost same way than * {@link #applyStyle(TableBuilder)} but do not use any header styling. * * @param builder the table builder to use * @return the configured table builder */ public static TableBuilder applyStyleNoHeader(TableBuilder builder) { builder.addOutlineBorder(BorderStyle.fancy_double) .paintBorder(BorderStyle.air, BorderSpecification.INNER_VERTICAL).fromTopLeft().toBottomRight() .paintBorder(BorderStyle.fancy_light, BorderSpecification.INNER_VERTICAL).fromTopLeft() .toBottomRight(); return Tables.configureKeyValueRendering(builder, " = "); } }
/** * Customize the given TableBuilder with the following common features (these choices * can always be overridden by applying later customizations) : * <ul> * <li>double border around the whole table and first row</li> * <li>vertical space (air) borders, single line separators between rows</li> * <li>first row is assumed to be a header and is centered horizontally and * vertically</li> * <li>cells containing Map values are rendered as {@literal key = value} lines, * trying to align on equal signs</li> * </ul> * * @param builder the table builder to use * @return the configured table builder */ public static TableBuilder applyStyle(TableBuilder builder) { builder.addOutlineBorder(BorderStyle.fancy_double) .paintBorder(BorderStyle.air, BorderSpecification.INNER_VERTICAL).fromTopLeft().toBottomRight() .paintBorder(BorderStyle.fancy_light, BorderSpecification.INNER_VERTICAL).fromTopLeft().toBottomRight() .addHeaderBorder(BorderStyle.fancy_double).on(CellMatchers.row(0)) .addAligner(SimpleVerticalAligner.middle).addAligner(SimpleHorizontalAligner.center); return Tables.configureKeyValueRendering(builder, " = "); }
/** * Customize the given TableBuilder with the following common features (these choices * can always be overridden by applying later customizations) : * <ul> * <li>double border around the whole table and first row</li> * <li>vertical space (air) borders, single line separators between rows</li> * <li>first row is assumed to be a header and is centered horizontally and * vertically</li> * <li>cells containing Map values are rendered as {@literal key = value} lines, * trying to align on equal signs</li> * </ul> * * @param builder the table builder to use * @return the configured table builder */ public static TableBuilder applyStyle(TableBuilder builder) { builder.addOutlineBorder(BorderStyle.fancy_double) .paintBorder(BorderStyle.air, BorderSpecification.INNER_VERTICAL).fromTopLeft().toBottomRight() .paintBorder(BorderStyle.fancy_light, BorderSpecification.INNER_VERTICAL).fromTopLeft().toBottomRight() .addHeaderBorder(BorderStyle.fancy_double).on(CellMatchers.row(0)) .addAligner(SimpleVerticalAligner.middle).addAligner(SimpleHorizontalAligner.center); return Tables.configureKeyValueRendering(builder, " = "); }
/** * Customize the given TableBuilder with the following common features (these choices can * always be overridden by applying later customizations) : * <ul> * <li>double border around the whole table and first row</li> * <li>vertical space (air) borders, single line separators between rows</li> * <li>first row is assumed to be a header and is centered horizontally and * vertically</li> * <li>cells containing Map values are rendered as {@literal key = value} lines, trying to * align on equal signs</li> * </ul> * * @param builder the table builder to use * @return the configured table builder */ public static TableBuilder applyStyle(TableBuilder builder) { builder.addOutlineBorder(BorderStyle.fancy_double) .paintBorder(BorderStyle.air, BorderSpecification.INNER_VERTICAL).fromTopLeft().toBottomRight() .paintBorder(BorderStyle.fancy_light, BorderSpecification.INNER_VERTICAL).fromTopLeft() .toBottomRight() .addHeaderBorder(BorderStyle.fancy_double).on(CellMatchers.row(0)) .addAligner(SimpleVerticalAligner.middle).addAligner(SimpleHorizontalAligner.center); return Tables.configureKeyValueRendering(builder, " = "); }
for (int i = 2; i < model.getRowCount(); i++) { if (splits.contains(i)) { builder.paintBorder(BorderStyle.fancy_light, BorderSpecification.TOP).fromRowColumn(i, 0).toRowColumn(i + 1, model.getColumnCount()); builder.paintBorder(BorderStyle.fancy_light_quadruple_dash, BorderSpecification.TOP).fromRowColumn(i, 0).toRowColumn(i + 1, model.getColumnCount());
for (int i = 2; i < model.getRowCount(); i++) { if (splits.contains(i)) { builder.paintBorder(BorderStyle.fancy_light, BorderSpecification.TOP).fromRowColumn(i, 0).toRowColumn(i + 1, model.getColumnCount()); builder.paintBorder(BorderStyle.fancy_light_quadruple_dash, BorderSpecification.TOP).fromRowColumn(i, 0).toRowColumn(i + 1, model.getColumnCount());
.paintBorder(BorderStyle.fancy_light, BorderSpecification.INNER).fromTopLeft().toBottomRight() .on(CellMatchers.table()).addAligner(SimpleHorizontalAligner.center).on(CellMatchers.table()) .addAligner(SimpleVerticalAligner.middle); .addAligner(new KeyValueHorizontalAligner(":")).addSizer(new KeyValueSizeConstraints(": ")) .addWrapper(new KeyValueTextWrapper(": ")); rowsWithThinSeparators.forEach(row -> builder.paintBorder(BorderStyle.fancy_light_quadruple_dash, BorderSpecification.TOP) .fromRowColumn(row, 0).toRowColumn(row + 1, builder.getModel().getColumnCount()));
.paintBorder(BorderStyle.fancy_light, BorderSpecification.INNER).fromTopLeft().toBottomRight() .on(CellMatchers.table()).addAligner(SimpleHorizontalAligner.center).on(CellMatchers.table()) .addAligner(SimpleVerticalAligner.middle); .addAligner(new KeyValueHorizontalAligner(":")).addSizer(new KeyValueSizeConstraints(": ")) .addWrapper(new KeyValueTextWrapper(": ")); rowsWithThinSeparators.forEach(row -> builder.paintBorder(BorderStyle.fancy_light_quadruple_dash, BorderSpecification.TOP) .fromRowColumn(row, 0).toRowColumn(row + 1, builder.getModel().getColumnCount()));