From 00394ba9a2622aca32e400b1e1c7efdf2d493481 Mon Sep 17 00:00:00 2001 From: Teemu Suo-Anttila Date: Wed, 17 May 2017 11:07:55 +0300 Subject: [PATCH] Add example of how to use ComponentRenderer to JavaDoc --- .../com/vaadin/ui/renderers/ComponentRenderer.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/server/src/main/java/com/vaadin/ui/renderers/ComponentRenderer.java b/server/src/main/java/com/vaadin/ui/renderers/ComponentRenderer.java index 1053907723..f5dd507cff 100644 --- a/server/src/main/java/com/vaadin/ui/renderers/ComponentRenderer.java +++ b/server/src/main/java/com/vaadin/ui/renderers/ComponentRenderer.java @@ -17,6 +17,8 @@ package com.vaadin.ui.renderers; import com.vaadin.shared.ui.grid.renderers.ComponentRendererState; import com.vaadin.ui.Component; +import com.vaadin.ui.Grid; +import com.vaadin.ui.Label; import elemental.json.Json; import elemental.json.JsonValue; @@ -34,10 +36,18 @@ import elemental.json.JsonValue; * runtime e.g. when selection changes. If your component has an internal state * that is not stored into the object, you should reuse the same component * instances. + *

+ * Example of how to add a {@link Label} component to {@link Grid}: + *

+ * Grid grid;
+ * grid.addColumn(person -> new Label(person.getFullName()), 
+ *     new ComponentRenderer()).setCaption("Full Name");
+ * 
* * @author Vaadin Ltd * @since 8.1 */ +@SuppressWarnings("serial") public class ComponentRenderer extends AbstractRenderer { /** -- 2.39.5