diff options
author | Guillermo Alvarez <guillermo@vaadin.com> | 2014-10-02 17:43:52 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2014-10-07 12:49:11 +0000 |
commit | e20a1594dd347f562145fea6a8645123c86fa3ec (patch) | |
tree | 605ef08f525a4a7edc784af77d0c1e2b885eac09 /uitest | |
parent | 7d4884fab4b224c2cff88038ceed51cb554d575a (diff) | |
download | vaadin-framework-e20a1594dd347f562145fea6a8645123c86fa3ec.tar.gz vaadin-framework-e20a1594dd347f562145fea6a8645123c86fa3ec.zip |
TreeTable should support font icons for items (#14077)
Change-Id: I758e0f80446290f17280447b1ff5c1f44cb8604b
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/src/com/vaadin/tests/components/treetable/TreeTableRowIcons.java | 57 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/components/treetable/TreeTableRowIconsTest.java | 34 |
2 files changed, 91 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/treetable/TreeTableRowIcons.java b/uitest/src/com/vaadin/tests/components/treetable/TreeTableRowIcons.java new file mode 100644 index 0000000000..0668a6aeeb --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/treetable/TreeTableRowIcons.java @@ -0,0 +1,57 @@ +package com.vaadin.tests.components.treetable; + +import static com.vaadin.server.Sizeable.Unit.PIXELS; + +import com.vaadin.server.FontAwesome; +import com.vaadin.server.Resource; +import com.vaadin.server.ThemeResource; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.HorizontalLayout; +import com.vaadin.ui.TreeTable; + +public class TreeTableRowIcons extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + HorizontalLayout layout = new HorizontalLayout(); + layout.setSpacing(true); + addComponent(layout); + + layout.addComponent(createTreeTableAndPopulate(new ThemeResource( + "../runo/icons/16/ok.png"))); + layout.addComponent(createTreeTableAndPopulate(FontAwesome.ANDROID)); + } + + private TreeTable createTreeTableAndPopulate(Resource icon) { + TreeTable tt = new TreeTable(); + tt.addContainerProperty("Foo", String.class, ""); + tt.setColumnWidth("Foo", 100); + tt.addContainerProperty("Bar", String.class, ""); + tt.setColumnWidth("Bar", 100); + tt.setIcon(icon); + tt.setHeight(400, PIXELS); + + Object item1 = tt.addItem(new Object[] { "Foo", "Bar" }, null); + Object item2 = tt.addItem(new Object[] { "Foo2", "Bar2" }, null); + tt.setItemIcon(item1, icon); + tt.setItemIcon(item2, icon); + + tt.setParent(item2, item1); + + tt.setCollapsed(item1, false); + + return tt; + } + + @Override + protected String getTestDescription() { + return "TreeTable should support font icons for items"; + } + + @Override + protected Integer getTicketNumber() { + return 14077; + } + +}
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/components/treetable/TreeTableRowIconsTest.java b/uitest/src/com/vaadin/tests/components/treetable/TreeTableRowIconsTest.java new file mode 100644 index 0000000000..2e299d62ea --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/treetable/TreeTableRowIconsTest.java @@ -0,0 +1,34 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.treetable; + +import java.io.IOException; + +import org.junit.Test; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class TreeTableRowIconsTest extends MultiBrowserTest { + + public final String SCREENSHOT_NAME = "TreeTableRowIcons"; + + @Test + public void checkScreenshot() throws IOException { + openTestURL(); + compareScreen(SCREENSHOT_NAME); + } + +} |