java - Dynamically build table from bean -
i'm building application lot of tables (or forms) representing details of given data row. quite big , not nice have add fields (with handler, logic, etc.) 1 one.
what have factory able build form (or table) given bean. created pretty nice factory using java reflection discover gwt not support it...
is there suit needs?
because gwt's compilation monolithic (there can no class that'd unknown @ compile-time used @ runtime), means code generated.
because can generated, means can during gwt compilation using so-called deferred binding. gwt generator can use reflection on classes known @ compile-time, it'll distinct api java.reflect
(just java annotation processors use distinct api).
you common-denominator identify classes need taken account in generation (e.g. implement same marker interface, or extend same base class) , generate 1 table/form each, , either:
- an interface type parameter object edit/render, directly represent generated table/form; you'd create child interface fixing type parameter ,
gwt.create()
interface,placehistorymapperwithfactory
,uibinder
orsimplebeaneditordriver
work. - a factory return correct table/form given
class<?>
object (using cascade ofif (klazz == foo.class) { return new … } else if …
); work requestfactory'srequestcontext.create()
all see code be:
- the marker interface or base class identifying objects can rendered
- an interface or base class generated forms/tables returned factory or
gwt.create()
- possibly interface or base class factory, can pass
gwt.create()
trigger generator , generated implementation of it
Comments
Post a Comment