|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.core.ext.Generator
com.vaadin.terminal.gwt.widgetsetutils.WidgetMapGenerator
public class WidgetMapGenerator
WidgetMapGenerator's are GWT generator to build WidgetMapImpl dynamically
based on ClientWidget
annotations available in workspace. By
modifying the generator it is possible to do some fine tuning for the
generated widgetset (aka client side engine). The components to be included
in the client side engine can modified be overriding
getUsedPaintables()
.
The generator also decides how the client side component implementations are
loaded to the browser. The default generator is
EagerWidgetMapGenerator
that builds a monolithic client side engine
that loads all widget implementation on application initialization. This has
been the only option until Vaadin 6.4.
This generator uses the loadStyle hints from the ClientWidget
annotations. Depending on the ClientWidget.LoadStyle
used, the widget may be
included in the initially loaded JavaScript, loaded when the application has
started and there is no communication to server or lazy loaded when the
implementation is absolutely needed.
The GWT module description file of the widgetset (
...Widgetset.gwt.xml
) can be used to define the
WidgetMapGenarator. An example that defines this generator to be used:
<generate-with
class="com.vaadin.terminal.gwt.widgetsetutils.MyWidgetMapGenerator">
<when-type-is class="com.vaadin.terminal.gwt.client.WidgetMap" />
</generate-with>
Vaadin package also includes LazyWidgetMapGenerator
, which is a good
option if the transferred data should be minimized, and
CustomWidgetMapGenerator
for easy overriding of loading strategies.
Constructor Summary | |
---|---|
WidgetMapGenerator()
|
Method Summary | |
---|---|
String |
generate(com.google.gwt.core.ext.TreeLogger logger,
com.google.gwt.core.ext.GeneratorContext context,
String typeName)
|
protected ClientWidget.LoadStyle |
getLoadStyle(Class<? extends Paintable> paintableType)
Returns true if the widget for given component will be lazy loaded by the client. |
protected Collection<Class<? extends Paintable>> |
getUsedPaintables()
This method is protected to allow creation of optimized widgetsets. |
Methods inherited from class com.google.gwt.core.ext.Generator |
---|
escape |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WidgetMapGenerator()
Method Detail |
---|
public String generate(com.google.gwt.core.ext.TreeLogger logger, com.google.gwt.core.ext.GeneratorContext context, String typeName) throws com.google.gwt.core.ext.UnableToCompleteException
generate
in class com.google.gwt.core.ext.Generator
com.google.gwt.core.ext.UnableToCompleteException
protected Collection<Class<? extends Paintable>> getUsedPaintables()
protected ClientWidget.LoadStyle getLoadStyle(Class<? extends Paintable> paintableType)
ClientWidget
annotation.
The method can be overridden to optimize the widget loading mechanism. If the Widgetset is wanted to be optimized for a network with a high latency or for a one with a very fast throughput, it may be good to return false for every component.
paintableType
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |