diff options
author | Adam Wagner <wbadam@users.noreply.github.com> | 2017-10-20 10:14:33 +0200 |
---|---|---|
committer | Péter Török <31210544+torok-peter@users.noreply.github.com> | 2017-10-20 11:14:33 +0300 |
commit | df2157ab9f39f7170675c8540a589cdc101d9456 (patch) | |
tree | 34fa8aa72c59813f656f73292dc43b09dd0f908e /uitest/src/main | |
parent | cb85b628289d35619d512f519624e5b075dfc441 (diff) | |
download | vaadin-framework-df2157ab9f39f7170675c8540a589cdc101d9456.tar.gz vaadin-framework-df2157ab9f39f7170675c8540a589cdc101d9456.zip |
Check class name type on Grid cell mouse over (#10194)
* Check whether className is of type string
* Move string type checker method to widget util
* Fix formatting of WidgetUtil
* Break svg into lines
Diffstat (limited to 'uitest/src/main')
-rw-r--r-- | uitest/src/main/java/com/vaadin/tests/components/grid/GridSvgInCell.java | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridSvgInCell.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridSvgInCell.java new file mode 100644 index 0000000000..fbe59b8a88 --- /dev/null +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridSvgInCell.java @@ -0,0 +1,40 @@ +package com.vaadin.tests.components.grid; + +import com.vaadin.annotations.Widgetset; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Grid; +import com.vaadin.ui.renderers.HtmlRenderer; + +@Widgetset("com.vaadin.DefaultWidgetSet") +public class GridSvgInCell extends AbstractTestUI { + + private static class DataObject { + private String svg; + + public String getSvg() { + return svg; + } + + public void setSvg(String svg) { + this.svg = svg; + } + } + + @Override + protected void setup(VaadinRequest request) { + Grid<DataObject> grid = new Grid<>(); + grid.addColumn(DataObject::getSvg).setCaption("SVG") + .setRenderer(new HtmlRenderer("")); + + DataObject data = new DataObject(); + data.setSvg( + "<svg width=\"100%\" height=\"20px\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">" + + "<polygon id=\"bar_background_blue\" stroke=\"gray\" fill=\"#D6D6D6\" points=\"0 0,59 0,66 7,59 14,0 14\"></polygon>" + + "<rect id=\"bar_blue\" x=\"1\" y=\"1\" width=\"0px\" height=\"13\" fill=\"#7298C0\"></rect>" + + "</svg>"); + grid.setItems(data); + + addComponent(grid); + } +} |