/** * Construct a table with the given model. The table will use the following * strategies for all cells, unless overridden:<ul> * <li>{@link DefaultFormatter default formatting} using {@literal toString()}</li> * <li>{@link AutoSizeConstraints sizing strategy} trying to use the maximum space, resorting to splitting lines on * spaces</li> * <li>{@link DelimiterTextWrapper wrapping text} on space characters</li> * <li>{@link SimpleHorizontalAligner left aligning} text.</li> * </ul> */ public TableBuilder(TableModel model) { this.model = model; rows = model.getRowCount(); columns = model.getColumnCount(); formatters.put(CellMatchers.table(), new DefaultFormatter()); sizeConstraints.put(CellMatchers.table(), new AutoSizeConstraints()); wrappers.put(CellMatchers.table(), new DelimiterTextWrapper()); aligners.put(CellMatchers.table(), left); }
.on(CellMatchers.table()).addSizer(new AbsoluteWidthSizeConstraints(30)).and(); result.add(builder.build());
.on(CellMatchers.table()).addSizer(new AbsoluteWidthSizeConstraints(30)).and(); result.add(builder.build());
.on(CellMatchers.table()).addSizer(new AbsoluteWidthSizeConstraints(30)).and(); result.add(builder.build());