18 package org.turro.jpa.grid;
20 import java.lang.reflect.ParameterizedType;
21 import java.util.function.Supplier;
22 import org.turro.jpa.Dao;
23 import org.zkoss.zul.Group;
24 import org.zkoss.zul.Row;
25 import org.zkoss.zul.RowRenderer;
35 private final Class<T> entityClass;
36 private final Class<ID> idClass;
37 private final Supplier<Dao> onDao;
40 entityClass = (Class<T>) ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[0];
41 idClass = (Class<ID>) ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[1];
46 public void render(Row row, Object data,
int index)
throws Exception {
48 if(data.getClass().isAssignableFrom(idClass)) {
50 }
else if(data.getClass().isAssignableFrom(entityClass)) {
54 if(row instanceof Group) {
70 protected abstract void renderRow(Row row, T value);
void renderGroup(Group group, T value)
abstract void renderRow(Row row, T value)
RendererOnDemand(Supplier< Dao > onDao)
void render(Row row, Object data, int index)