aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/itmill/toolkit/tests/TestForGridLayoutChildComponentRendering.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/itmill/toolkit/tests/TestForGridLayoutChildComponentRendering.java')
-rw-r--r--src/com/itmill/toolkit/tests/TestForGridLayoutChildComponentRendering.java28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/com/itmill/toolkit/tests/TestForGridLayoutChildComponentRendering.java b/src/com/itmill/toolkit/tests/TestForGridLayoutChildComponentRendering.java
index 2f0c70889c..06889476f5 100644
--- a/src/com/itmill/toolkit/tests/TestForGridLayoutChildComponentRendering.java
+++ b/src/com/itmill/toolkit/tests/TestForGridLayoutChildComponentRendering.java
@@ -1,3 +1,7 @@
+/*
+@ITMillApache2LicenseForJavaFiles@
+ */
+
package com.itmill.toolkit.tests;
import java.util.ArrayList;
@@ -21,7 +25,7 @@ import com.itmill.toolkit.ui.Select;
*/
public class TestForGridLayoutChildComponentRendering extends CustomComponent {
- private GridLayout main = new GridLayout(2, 3);
+ private final GridLayout main = new GridLayout(2, 3);
public TestForGridLayoutChildComponentRendering() {
@@ -33,7 +37,7 @@ public class TestForGridLayoutChildComponentRendering extends CustomComponent {
main.removeAllComponents();
main.addComponent(new Label("SDFGFHFHGJGFDSDSSSGFDD"));
- Link l = new Link();
+ final Link l = new Link();
l.setCaption("Siirry ITMILLIIN");
l.setResource(new ExternalResource("http://www.itmill.com/"));
l.setTargetHeight(200);
@@ -41,7 +45,7 @@ public class TestForGridLayoutChildComponentRendering extends CustomComponent {
l.setTargetBorder(Link.TARGET_BORDER_MINIMAL);
main.addComponent(l);
- Select se = new Select("Tästä valitaan");
+ final Select se = new Select("Tästä valitaan");
se.setCaption("Whattaa select");
se.addItem("valinta1");
se.addItem("Valinta 2");
@@ -61,19 +65,19 @@ public class TestForGridLayoutChildComponentRendering extends CustomComponent {
}
public void randomReorder() {
- Iterator it = main.getComponentIterator();
- ArrayList components = new ArrayList();
+ final Iterator it = main.getComponentIterator();
+ final ArrayList components = new ArrayList();
while (it.hasNext()) {
components.add(it.next());
}
main.removeAllComponents();
- int size = components.size();
- int colspanIndex = ((int) (Math.random() * size) / 2) * 2 + 2;
+ final int size = components.size();
+ final int colspanIndex = ((int) (Math.random() * size) / 2) * 2 + 2;
for (int i = components.size(); i > 0; i--) {
- int index = (int) (Math.random() * i);
+ final int index = (int) (Math.random() * i);
if (i == colspanIndex) {
main.addComponent((Component) components.get(index), 0,
(size - i) / 2, 1, (size - i) / 2);
@@ -85,13 +89,13 @@ public class TestForGridLayoutChildComponentRendering extends CustomComponent {
}
public void removeRandomComponent() {
- Iterator it = main.getComponentIterator();
- ArrayList components = new ArrayList();
+ final Iterator it = main.getComponentIterator();
+ final ArrayList components = new ArrayList();
while (it.hasNext()) {
components.add(it.next());
}
- int size = components.size();
- int index = (int) (Math.random() * size);
+ final int size = components.size();
+ final int index = (int) (Math.random() * size);
main.removeComponent((Component) components.get(index));
}