]> source.dussan.org Git - vaadin-framework.git/commitdiff
Avoid sharing containers to prevent problems (#14200)
authorArtur Signell <artur@vaadin.com>
Mon, 4 Aug 2014 12:18:43 +0000 (15:18 +0300)
committerVaadin Code Review <review@vaadin.com>
Tue, 5 Aug 2014 07:15:02 +0000 (07:15 +0000)
Change-Id: Ifc3286fce10dd4e64fd1001b786599fe66c89077

uitest/src/com/vaadin/tests/themes/valo/ComboBoxes.java

index 5c1d18893723e205f58fb39549478ae18fc29202..1b8b290d91aede5974e6c14cdfac06e640fcbe49 100644 (file)
@@ -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");