diff options
author | Matti Tahvonen <matti.tahvonen@itmill.com> | 2010-06-04 13:22:00 +0000 |
---|---|---|
committer | Matti Tahvonen <matti.tahvonen@itmill.com> | 2010-06-04 13:22:00 +0000 |
commit | c64015c8904ab7f66521887db874ac798c49e42b (patch) | |
tree | a3ea1c4136831bebe5a78e68e90164d698c63dc4 /src/com/vaadin/ui/ClientWidget.java | |
parent | 2752d636743b1091b6c52baf26d39ce5c7d50964 (diff) | |
download | vaadin-framework-c64015c8904ab7f66521887db874ac798c49e42b.tar.gz vaadin-framework-c64015c8904ab7f66521887db874ac798c49e42b.zip |
initial implementation of code splitting #4408
svn changeset:13561/svn branch:6.4
Diffstat (limited to 'src/com/vaadin/ui/ClientWidget.java')
-rw-r--r-- | src/com/vaadin/ui/ClientWidget.java | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/com/vaadin/ui/ClientWidget.java b/src/com/vaadin/ui/ClientWidget.java index 989f70ce55..39aecf1f86 100644 --- a/src/com/vaadin/ui/ClientWidget.java +++ b/src/com/vaadin/ui/ClientWidget.java @@ -12,6 +12,7 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import com.vaadin.terminal.gwt.client.Paintable; +import com.vaadin.terminal.gwt.widgetsetutils.WidgetMapGenerator; /** * Annotation defining the default client side counterpart in GWT terminal for @@ -35,4 +36,34 @@ public @interface ClientWidget { * @return the client side counterpart for the annotated component */ Class<? extends Paintable> value(); + + /** + * The lazy loading of a widget implementation means the client side + * component is not included in the initial JavaScript application loaded + * when the application starts. Instead the implementation is loaded to the + * client when it is first needed. + * <p> + * Lazy loaded widgets don't stress the size and startup time of the client + * side as much as eagerly loaded widgets. On the other hand there is a + * slight latency when lazy loaded widgets are first used as the client side + * needs to visit the server to fetch the client side implementation. + * <p> + * In common situations the default value should be fine. If the widget + * implementation commonly used and often on first view it is better set + * lazy loading off for it. Also if the component implementation is really + * thing, it may by justified to make the widget implementation eagerly + * loaded. + * <p> + * Tunings to widget loading can also be made by overriding + * {@link WidgetMapGenerator} in GWT module. Tunings might be helpful if the + * end users have slow connections and especially if they have high latency + * in their network. + * + * @return if true (default), the GWT code generator will make the client + * side implementation lazy loaded. Displaying it first time on the + * screen slightly increases, but widgets implementation does not + * stress the initialization of the client side engine. + */ + boolean lazyLoad() default true; + } |