diff options
author | Johannes Dahlström <johannesd@vaadin.com> | 2014-11-05 15:56:58 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2014-11-13 14:21:09 +0000 |
commit | 1ac8b6bff007d997bf2cfc69954e69d8fa65e119 (patch) | |
tree | 58485a25a59988bbe54638bdf6c3944b3b0c46d1 /uitest/src | |
parent | effe4927119eed370bb7061300123877588c5432 (diff) | |
download | vaadin-framework-1ac8b6bff007d997bf2cfc69954e69d8fa65e119.tar.gz vaadin-framework-1ac8b6bff007d997bf2cfc69954e69d8fa65e119.zip |
Make ImageRenderers emit click events (#13334)
Change-Id: I1f98409e9787e1057ffaeebbe37427042a1e3233
Diffstat (limited to 'uitest/src')
-rw-r--r-- | uitest/src/com/vaadin/tests/components/grid/WidgetRenderers.java | 16 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/components/grid/WidgetRenderersTest.java | 6 |
2 files changed, 17 insertions, 5 deletions
diff --git a/uitest/src/com/vaadin/tests/components/grid/WidgetRenderers.java b/uitest/src/com/vaadin/tests/components/grid/WidgetRenderers.java index 534b8a9e4d..ba2fc4455b 100644 --- a/uitest/src/com/vaadin/tests/components/grid/WidgetRenderers.java +++ b/uitest/src/com/vaadin/tests/components/grid/WidgetRenderers.java @@ -24,8 +24,8 @@ import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.components.grid.Grid; import com.vaadin.ui.components.grid.Grid.SelectionMode; import com.vaadin.ui.components.grid.renderers.ButtonRenderer; -import com.vaadin.ui.components.grid.renderers.ButtonRenderer.RendererClickEvent; -import com.vaadin.ui.components.grid.renderers.ButtonRenderer.RendererClickListener; +import com.vaadin.ui.components.grid.renderers.ClickableRenderer.RendererClickEvent; +import com.vaadin.ui.components.grid.renderers.ClickableRenderer.RendererClickListener; import com.vaadin.ui.components.grid.renderers.ImageRenderer; import com.vaadin.ui.components.grid.renderers.ProgressBarRenderer; @@ -47,7 +47,7 @@ public class WidgetRenderers extends AbstractTestUI { item.getItemProperty(ProgressBarRenderer.class).setValue(0.3); item.getItemProperty(ButtonRenderer.class).setValue("Click"); item.getItemProperty(ImageRenderer.class).setValue( - new ThemeResource("window/img/resize.png")); + new ThemeResource("window/img/close.png")); Grid grid = new Grid(container); @@ -66,7 +66,15 @@ public class WidgetRenderers extends AbstractTestUI { } })); - grid.getColumn(ImageRenderer.class).setRenderer(new ImageRenderer()); + grid.getColumn(ImageRenderer.class).setRenderer( + new ImageRenderer(new RendererClickListener() { + + @Override + public void click(RendererClickEvent event) { + item.getItemProperty(ImageRenderer.class).setValue( + new ThemeResource("window/img/maximize.png")); + } + })); addComponent(grid); } diff --git a/uitest/src/com/vaadin/tests/components/grid/WidgetRenderersTest.java b/uitest/src/com/vaadin/tests/components/grid/WidgetRenderersTest.java index d18494d277..c6649326c8 100644 --- a/uitest/src/com/vaadin/tests/components/grid/WidgetRenderersTest.java +++ b/uitest/src/com/vaadin/tests/components/grid/WidgetRenderersTest.java @@ -60,8 +60,12 @@ public class WidgetRenderersTest extends MultiBrowserTest { WebElement image = getGridCell(0, 2).findElement( By.className("gwt-Image")); - assertTrue(image.getAttribute("src").endsWith("window/img/resize.png")); + assertTrue(image.getAttribute("src").endsWith("window/img/close.png")); + image.click(); + + assertTrue(image.getAttribute("src") + .endsWith("window/img/maximize.png")); } GridCellElement getGridCell(int row, int col) { |