diff options
author | Henri Sara <henri.sara@itmill.com> | 2011-08-01 11:30:59 +0000 |
---|---|---|
committer | Henri Sara <henri.sara@itmill.com> | 2011-08-01 11:30:59 +0000 |
commit | b3347b132a9280613f7eb110c969527bf2837c42 (patch) | |
tree | 737f815f361bcdb7a7bfe5806452bc9fa29475b6 | |
parent | a568d3af8f1a3eceb9733aef7ff1b26759376bf9 (diff) | |
download | vaadin-framework-b3347b132a9280613f7eb110c969527bf2837c42.tar.gz vaadin-framework-b3347b132a9280613f7eb110c969527bf2837c42.zip |
#7266 eliminate some Sampler dependencies in Vaadin 6.7 tests etc.
svn changeset:20059/svn branch:6.7
-rwxr-xr-x | WebContent/VAADIN/themes/tests-tickets/icons/au.gif | bin | 0 -> 378 bytes | |||
-rwxr-xr-x | WebContent/VAADIN/themes/tests-tickets/icons/fi.gif | bin | 0 -> 371 bytes | |||
-rwxr-xr-x | WebContent/VAADIN/themes/tests-tickets/icons/hu.gif | bin | 0 -> 357 bytes | |||
-rwxr-xr-x | WebContent/VAADIN/themes/tests-tickets/icons/se.gif | bin | 0 -> 367 bytes | |||
-rw-r--r-- | build/package/WebContent/WEB-INF/web.xml | 4 | ||||
-rw-r--r-- | tests/src/com/vaadin/tests/TestIFrames.java | 2 | ||||
-rw-r--r-- | tests/src/com/vaadin/tests/components/combobox/ComboBoxItemIcon.java | 12 | ||||
-rw-r--r-- | tests/src/com/vaadin/tests/components/tree/TreeHorizontalResize.java | 54 |
8 files changed, 61 insertions, 11 deletions
diff --git a/WebContent/VAADIN/themes/tests-tickets/icons/au.gif b/WebContent/VAADIN/themes/tests-tickets/icons/au.gif Binary files differnew file mode 100755 index 0000000000..5269c6a0e0 --- /dev/null +++ b/WebContent/VAADIN/themes/tests-tickets/icons/au.gif diff --git a/WebContent/VAADIN/themes/tests-tickets/icons/fi.gif b/WebContent/VAADIN/themes/tests-tickets/icons/fi.gif Binary files differnew file mode 100755 index 0000000000..8d3a191828 --- /dev/null +++ b/WebContent/VAADIN/themes/tests-tickets/icons/fi.gif diff --git a/WebContent/VAADIN/themes/tests-tickets/icons/hu.gif b/WebContent/VAADIN/themes/tests-tickets/icons/hu.gif Binary files differnew file mode 100755 index 0000000000..6142d86817 --- /dev/null +++ b/WebContent/VAADIN/themes/tests-tickets/icons/hu.gif diff --git a/WebContent/VAADIN/themes/tests-tickets/icons/se.gif b/WebContent/VAADIN/themes/tests-tickets/icons/se.gif Binary files differnew file mode 100755 index 0000000000..80f6285228 --- /dev/null +++ b/WebContent/VAADIN/themes/tests-tickets/icons/se.gif diff --git a/build/package/WebContent/WEB-INF/web.xml b/build/package/WebContent/WEB-INF/web.xml index e508df1d28..4657968591 100644 --- a/build/package/WebContent/WEB-INF/web.xml +++ b/build/package/WebContent/WEB-INF/web.xml @@ -74,7 +74,7 @@ </init-param> <!-- As an example, we will use an optimized widget set. See - SamplerWidgetSet.gwt.xml + OptimizedWidgetSet.gwt.xml --> <init-param> <param-name>widgetset</param-name> @@ -93,7 +93,7 @@ <init-param> <!-- As an example, we will use an optimized widget set. See - SamplerWidgetSet.gwt.xml + OptimizedWidgetSet.gwt.xml --> <param-name>widgetset</param-name> <param-value>com.vaadin.demo.gwt.OptimizedWidgetSet</param-value> diff --git a/tests/src/com/vaadin/tests/TestIFrames.java b/tests/src/com/vaadin/tests/TestIFrames.java index dea306b1bf..ea93398206 100644 --- a/tests/src/com/vaadin/tests/TestIFrames.java +++ b/tests/src/com/vaadin/tests/TestIFrames.java @@ -19,7 +19,7 @@ public class TestIFrames extends CustomComponent { public void createNewView() { main.removeAllComponents(); - main.addComponent(createEmbedded("../sampler/")); + main.addComponent(createEmbedded("http://demo.vaadin.com/sampler/")); main.addComponent(createEmbedded("../colorpicker")); // main.addComponent(createEmbedded("../TestForNativeWindowing")); main.addComponent(createEmbedded("http://demo.vaadin.com/timeline")); diff --git a/tests/src/com/vaadin/tests/components/combobox/ComboBoxItemIcon.java b/tests/src/com/vaadin/tests/components/combobox/ComboBoxItemIcon.java index 69c19946a2..0dc0d092ed 100644 --- a/tests/src/com/vaadin/tests/components/combobox/ComboBoxItemIcon.java +++ b/tests/src/com/vaadin/tests/components/combobox/ComboBoxItemIcon.java @@ -20,6 +20,8 @@ public class ComboBoxItemIcon extends TestBase { @Override protected void setup() { + setTheme("tests-tickets"); + { ComboBox cb = new ComboBox(); cb.addContainerProperty("icon", Resource.class, null); @@ -27,10 +29,10 @@ public class ComboBoxItemIcon extends TestBase { Item item = cb.addItem("FI"); item.getItemProperty("icon").setValue( - new ThemeResource("../sampler/flags/fi.gif")); + new ThemeResource("icons/fi.gif")); item = cb.addItem("SE"); item.getItemProperty("icon").setValue( - new ThemeResource("../sampler/flags/se.gif")); + new ThemeResource("icons/se.gif")); addComponent(cb); } @@ -41,13 +43,13 @@ public class ComboBoxItemIcon extends TestBase { Item item = cb.addItem("Finland"); item.getItemProperty("icon").setValue( - new ThemeResource("../sampler/flags/fi.gif")); + new ThemeResource("icons/fi.gif")); item = cb.addItem("Australia"); item.getItemProperty("icon").setValue( - new ThemeResource("../sampler/flags/au.gif")); + new ThemeResource("icons/au.gif")); item = cb.addItem("Hungary"); item.getItemProperty("icon").setValue( - new ThemeResource("../sampler/flags/hu.gif")); + new ThemeResource("icons/hu.gif")); cb.setValue("Hungary"); addComponent(cb); diff --git a/tests/src/com/vaadin/tests/components/tree/TreeHorizontalResize.java b/tests/src/com/vaadin/tests/components/tree/TreeHorizontalResize.java index d12d6947f3..e25b2d6760 100644 --- a/tests/src/com/vaadin/tests/components/tree/TreeHorizontalResize.java +++ b/tests/src/com/vaadin/tests/components/tree/TreeHorizontalResize.java @@ -2,13 +2,25 @@ package com.vaadin.tests.components.tree; import java.util.Iterator; -import com.vaadin.demo.sampler.ExampleUtil; +import com.vaadin.data.Item; +import com.vaadin.data.util.HierarchicalContainer; +import com.vaadin.terminal.ThemeResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Panel; import com.vaadin.ui.Tree; public class TreeHorizontalResize extends TestBase { + // copied from Sampler to eliminate dependency + public static final Object hw_PROPERTY_NAME = "name"; + public static final Object hw_PROPERTY_ICON = "icon"; + private static final String[][] hardware = { // + { "Desktops", "Dell OptiPlex GX240", "Dell OptiPlex GX260", + "Dell OptiPlex GX280" }, + { "Monitors", "Benq T190HD", "Benq T220HD", "Benq T240HD" }, + { "Laptops", "IBM ThinkPad T40", "IBM ThinkPad T43", + "IBM ThinkPad T60" } }; + @Override protected void setup() { Panel treePanel = new Panel(); @@ -18,8 +30,8 @@ public class TreeHorizontalResize extends TestBase { addComponent(treePanel); Tree tree = new Tree(); - tree.setContainerDataSource(ExampleUtil.getHardwareContainer()); - tree.setItemCaptionPropertyId(ExampleUtil.hw_PROPERTY_NAME); + tree.setContainerDataSource(getHardwareContainer()); + tree.setItemCaptionPropertyId(hw_PROPERTY_NAME); for (Iterator<?> it = tree.rootItemIds().iterator(); it.hasNext();) { tree.expandItemsRecursively(it.next()); } @@ -36,4 +48,40 @@ public class TreeHorizontalResize extends TestBase { return 6230; } + public static HierarchicalContainer getHardwareContainer() { + Item item = null; + int itemId = 0; // Increasing numbering for itemId:s + + // Create new container + HierarchicalContainer hwContainer = new HierarchicalContainer(); + // Create containerproperty for name + hwContainer.addContainerProperty(hw_PROPERTY_NAME, String.class, null); + // Create containerproperty for icon + hwContainer.addContainerProperty(hw_PROPERTY_ICON, ThemeResource.class, + new ThemeResource("../runo/icons/16/document.png")); + for (int i = 0; i < hardware.length; i++) { + // Add new item + item = hwContainer.addItem(itemId); + // Add name property for item + item.getItemProperty(hw_PROPERTY_NAME).setValue(hardware[i][0]); + // Allow children + hwContainer.setChildrenAllowed(itemId, true); + itemId++; + for (int j = 1; j < hardware[i].length; j++) { + if (j == 1) { + item.getItemProperty(hw_PROPERTY_ICON).setValue( + new ThemeResource("../runo/icons/16/folder.png")); + } + // Add child items + item = hwContainer.addItem(itemId); + item.getItemProperty(hw_PROPERTY_NAME).setValue(hardware[i][j]); + hwContainer.setParent(itemId, itemId - j); + hwContainer.setChildrenAllowed(itemId, false); + + itemId++; + } + } + return hwContainer; + } + } |