private Object getCellObject(Column column, Object object) { try { if (column.getProperty() != null) { final Method getter = object.getClass().getMethod("get" + WordUtils.capitalize(column.getProperty())); getter.setAccessible(true); return getter.invoke(object); } else { return object; } } catch (Exception ex) { getLogger().debug(null, ex); throw new SingularFormException("Não foi possivel recuperar a propriedade '" + column.getProperty() + "' via metodo get na classe " + object.getClass(), ex.getCause()); } }
public Result addColumn(String property, String label) { columns.add(Config.Column.of(property, label)); return this; }
builder.appendPropertyColumn(Model.of(column.getLabel()), object -> { try { if (column.getProperty() != null) { final Method getter = object.getClass().getMethod("get" + WordUtils.capitalize(column.getProperty())); getter.setAccessible(true); return getter.invoke(object); throw new SingularFormException("Não foi possivel recuperar a propriedade '" + column.getProperty() + "' via metodo get na classe " + object.getClass());
public static Column of(String label) { return of(null, label); }
public static Column of(String property, String label) { return new Column(property, label); }
public static Column of(String property, String label) { return new Column(property, label); }
public static Column of(String label) { return of(null, label); }
public Result addColumn(String label) { columns.add(Config.Column.of(label)); return this; }
public Result addColumn(String label) { columns.add(Config.Column.of(label)); return this; }
public Result addColumn(String property, String label) { columns.add(Config.Column.of(property, label)); return this; }
private void configureColumns(BSDataTableBuilder<Object, ?, ?> builder, Column column) { if (viewSupplier.get().isEnableRowClick()) { builder.appendPropertyActionColumn(Model.of(column.getLabel()), object -> getCellObject(column, object)); } else { builder.appendPropertyColumn(Model.of(column.getLabel()), object -> getCellObject(column, object)); } }