diff options
author | Matti Tahvonen <matti.tahvonen@itmill.com> | 2008-01-07 12:48:26 +0000 |
---|---|---|
committer | Matti Tahvonen <matti.tahvonen@itmill.com> | 2008-01-07 12:48:26 +0000 |
commit | cf3b3594e1d02fa2f5ab591a94c65a0611ba1ff3 (patch) | |
tree | 2c0a7d171b281ddbdd17ff9313c4dfcb7fdc4540 /src/com/itmill/toolkit/demo/featurebrowser/ComboBoxExample.java | |
parent | 4a0b5b2ea8a437bcf27689c5024266aefd2ceb09 (diff) | |
download | vaadin-framework-cf3b3594e1d02fa2f5ab591a94c65a0611ba1ff3.tar.gz vaadin-framework-cf3b3594e1d02fa2f5ab591a94c65a0611ba1ff3.zip |
Some changes to help testing tools testing with FeatureBrowser
svn changeset:3387/svn branch:trunk
Diffstat (limited to 'src/com/itmill/toolkit/demo/featurebrowser/ComboBoxExample.java')
-rw-r--r-- | src/com/itmill/toolkit/demo/featurebrowser/ComboBoxExample.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/com/itmill/toolkit/demo/featurebrowser/ComboBoxExample.java b/src/com/itmill/toolkit/demo/featurebrowser/ComboBoxExample.java index b7a02f3161..df8fa688d7 100644 --- a/src/com/itmill/toolkit/demo/featurebrowser/ComboBoxExample.java +++ b/src/com/itmill/toolkit/demo/featurebrowser/ComboBoxExample.java @@ -4,6 +4,8 @@ package com.itmill.toolkit.demo.featurebrowser; +import java.util.Random; + import com.itmill.toolkit.ui.ComboBox; import com.itmill.toolkit.ui.CustomComponent; import com.itmill.toolkit.ui.OrderedLayout; @@ -33,11 +35,12 @@ public class ComboBoxExample extends CustomComponent { final ComboBox s1 = new ComboBox("Select with starts-with filter"); s1.setFilteringMode(Filtering.FILTERINGMODE_STARTSWITH); s1.setColumns(20); + Random r = new Random(5); for (int i = 0; i < 105; i++) { s1 - .addItem(firstnames[(int) (Math.random() * (firstnames.length - 1))] + .addItem(firstnames[(int) (r.nextDouble() * (firstnames.length - 1))] + " " - + lastnames[(int) (Math.random() * (lastnames.length - 1))]); + + lastnames[(int) (r.nextDouble() * (lastnames.length - 1))]); } s1.setImmediate(true); main.addComponent(s1); @@ -48,9 +51,9 @@ public class ComboBoxExample extends CustomComponent { s2.setColumns(20); for (int i = 0; i < 500; i++) { s2 - .addItem(firstnames[(int) (Math.random() * (firstnames.length - 1))] + .addItem(firstnames[(int) (r.nextDouble() * (firstnames.length - 1))] + " " - + lastnames[(int) (Math.random() * (lastnames.length - 1))]); + + lastnames[(int) (r.nextDouble() * (lastnames.length - 1))]); } s2.setImmediate(true); main.addComponent(s2); |