diff options
author | Leif Åstrand <leif@vaadin.com> | 2015-11-13 10:58:35 +0200 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2015-11-13 10:58:35 +0200 |
commit | 8953147d96087582a7fea2c5284d585e70d768df (patch) | |
tree | 59aad73499a56283f299a9ed2b540063404f6ee0 | |
parent | 7c0c7af2d5a69018ebc38f153df1adb6f0cbaddb (diff) | |
download | vaadin-framework-8953147d96087582a7fea2c5284d585e70d768df.tar.gz vaadin-framework-8953147d96087582a7fea2c5284d585e70d768df.zip |
Add some performance guidance to renderer javadocs.
Change-Id: I5171c6eb6360a9c85b8afbc3096d9b6c5c8f4064
-rw-r--r-- | client/src/com/vaadin/client/renderers/Renderer.java | 8 | ||||
-rw-r--r-- | client/src/com/vaadin/client/renderers/WidgetRenderer.java | 5 |
2 files changed, 12 insertions, 1 deletions
diff --git a/client/src/com/vaadin/client/renderers/Renderer.java b/client/src/com/vaadin/client/renderers/Renderer.java index a3faa1e9df..b2e9acd582 100644 --- a/client/src/com/vaadin/client/renderers/Renderer.java +++ b/client/src/com/vaadin/client/renderers/Renderer.java @@ -35,7 +35,13 @@ import com.vaadin.client.widgets.Grid; public interface Renderer<T> { /** - * Called whenever the {@link Grid} updates a cell + * Called whenever the {@link Grid} updates a cell. + * <p> + * For optimal performance, work done in this method should be kept to a + * minimum since it will be called continuously while the user is scrolling. + * It is recommended to set up the cell's DOM structure in + * {@link ComplexRenderer#init(RendererCellReference)} and only make + * incremental updates based on cell data in this method. * * @param cell * The cell. Note that the cell is a flyweight and should not be diff --git a/client/src/com/vaadin/client/renderers/WidgetRenderer.java b/client/src/com/vaadin/client/renderers/WidgetRenderer.java index 1a33894e8e..d7219e7241 100644 --- a/client/src/com/vaadin/client/renderers/WidgetRenderer.java +++ b/client/src/com/vaadin/client/renderers/WidgetRenderer.java @@ -60,6 +60,11 @@ public abstract class WidgetRenderer<T, W extends Widget> extends * information in the widget that is cell specific. Do not detach the Widget * here, it will be done automatically by the Grid when the widget is no * longer needed. + * <p> + * For optimal performance, work done in this method should be kept to a + * minimum since it will be called continuously while the user is scrolling. + * The renderer can use {@link Widget#setLayoutData(Object)} to store cell + * data that might be needed in e.g. event listeners. * * @param cell * The cell to render. Note that the cell is a flyweight and |