From cfef40132aa87daef50f9b479bd02f1579352d6d Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Mon, 4 Aug 2014 15:18:43 +0300 Subject: [PATCH] Avoid sharing containers to prevent problems (#14200) Change-Id: Ifc3286fce10dd4e64fd1001b786599fe66c89077 --- .../vaadin/tests/themes/valo/ComboBoxes.java | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/uitest/src/com/vaadin/tests/themes/valo/ComboBoxes.java b/uitest/src/com/vaadin/tests/themes/valo/ComboBoxes.java index 5c1d188937..1b8b290d91 100644 --- a/uitest/src/com/vaadin/tests/themes/valo/ComboBoxes.java +++ b/uitest/src/com/vaadin/tests/themes/valo/ComboBoxes.java @@ -15,7 +15,6 @@ */ package com.vaadin.tests.themes.valo; -import com.vaadin.data.Container; import com.vaadin.navigator.View; import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent; import com.vaadin.server.ThemeResource; @@ -40,13 +39,11 @@ public class ComboBoxes extends VerticalLayout implements View { row.setSpacing(true); addComponent(row); - Container generatedContainer = ValoThemeUI - .generateContainer(200, false); ComboBox combo = new ComboBox("Normal"); combo.setInputPrompt("You can type here"); - combo.setContainerDataSource(generatedContainer); + combo.setContainerDataSource(ValoThemeUI.generateContainer(200, false)); combo.setNullSelectionAllowed(false); - combo.select(generatedContainer.getItemIds().iterator().next()); + combo.select(combo.getItemIds().iterator().next()); combo.setItemCaptionPropertyId(ValoThemeUI.CAPTION_PROPERTY); combo.setItemIconPropertyId(ValoThemeUI.ICON_PROPERTY); combo.setItemIcon(combo.getItemIds().iterator().next(), @@ -60,9 +57,9 @@ public class ComboBoxes extends VerticalLayout implements View { combo = new ComboBox(); combo.setInputPrompt("You can type here"); - combo.setContainerDataSource(generatedContainer); + combo.setContainerDataSource(ValoThemeUI.generateContainer(200, false)); combo.setNullSelectionAllowed(false); - combo.select(generatedContainer.getItemIds().iterator().next()); + combo.select(combo.getItemIds().iterator().next()); combo.setItemCaptionPropertyId(ValoThemeUI.CAPTION_PROPERTY); combo.setItemIconPropertyId(ValoThemeUI.ICON_PROPERTY); combo.setWidth("240px"); @@ -120,7 +117,7 @@ public class ComboBoxes extends VerticalLayout implements View { combo = new ComboBox("Custom color"); combo.setInputPrompt("You can type here"); - combo.setContainerDataSource(generatedContainer); + combo.setContainerDataSource(ValoThemeUI.generateContainer(200, false)); combo.setItemCaptionPropertyId(ValoThemeUI.CAPTION_PROPERTY); combo.setItemIconPropertyId(ValoThemeUI.ICON_PROPERTY); combo.addStyleName("color1"); @@ -128,7 +125,7 @@ public class ComboBoxes extends VerticalLayout implements View { combo = new ComboBox("Custom color"); combo.setInputPrompt("You can type here"); - combo.setContainerDataSource(generatedContainer); + combo.setContainerDataSource(ValoThemeUI.generateContainer(200, false)); combo.setItemCaptionPropertyId(ValoThemeUI.CAPTION_PROPERTY); combo.setItemIconPropertyId(ValoThemeUI.ICON_PROPERTY); combo.addStyleName("color2"); @@ -136,7 +133,7 @@ public class ComboBoxes extends VerticalLayout implements View { combo = new ComboBox("Custom color"); combo.setInputPrompt("You can type here"); - combo.setContainerDataSource(generatedContainer); + combo.setContainerDataSource(ValoThemeUI.generateContainer(200, false)); combo.setItemCaptionPropertyId(ValoThemeUI.CAPTION_PROPERTY); combo.setItemIconPropertyId(ValoThemeUI.ICON_PROPERTY); combo.addStyleName("color3"); @@ -144,7 +141,7 @@ public class ComboBoxes extends VerticalLayout implements View { combo = new ComboBox("Small"); combo.setInputPrompt("You can type here"); - combo.setContainerDataSource(generatedContainer); + combo.setContainerDataSource(ValoThemeUI.generateContainer(200, false)); combo.setItemCaptionPropertyId(ValoThemeUI.CAPTION_PROPERTY); combo.setItemIconPropertyId(ValoThemeUI.ICON_PROPERTY); combo.addStyleName("small"); @@ -152,7 +149,7 @@ public class ComboBoxes extends VerticalLayout implements View { combo = new ComboBox("Large"); combo.setInputPrompt("You can type here"); - combo.setContainerDataSource(generatedContainer); + combo.setContainerDataSource(ValoThemeUI.generateContainer(200, false)); combo.setItemCaptionPropertyId(ValoThemeUI.CAPTION_PROPERTY); combo.setItemIconPropertyId(ValoThemeUI.ICON_PROPERTY); combo.addStyleName("large"); -- 2.39.5