diff options
author | Matti Tahvonen <matti.tahvonen@itmill.com> | 2009-04-09 12:08:37 +0000 |
---|---|---|
committer | Matti Tahvonen <matti.tahvonen@itmill.com> | 2009-04-09 12:08:37 +0000 |
commit | 800582d3c3a6b194f293b814f9f04e33a3f39a99 (patch) | |
tree | 6eb4914d7ef093dcb47a8f0be0ff8f38162489c1 | |
parent | 4bb8706b53c3842971246920f380984ab0f1271d (diff) | |
download | vaadin-framework-800582d3c3a6b194f293b814f9f04e33a3f39a99.tar.gz vaadin-framework-800582d3c3a6b194f293b814f9f04e33a3f39a99.zip |
enhancing test case
svn changeset:7378/svn branch:6.0
-rw-r--r-- | src/com/itmill/toolkit/tests/layouts/TestAbsoluteLayout.java | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/src/com/itmill/toolkit/tests/layouts/TestAbsoluteLayout.java b/src/com/itmill/toolkit/tests/layouts/TestAbsoluteLayout.java index 0550652c93..cf78880dac 100644 --- a/src/com/itmill/toolkit/tests/layouts/TestAbsoluteLayout.java +++ b/src/com/itmill/toolkit/tests/layouts/TestAbsoluteLayout.java @@ -3,7 +3,6 @@ package com.itmill.toolkit.tests.layouts; import java.util.Arrays;
import java.util.Iterator;
-import com.itmill.toolkit.data.Container;
import com.itmill.toolkit.data.Item;
import com.itmill.toolkit.data.Property;
import com.itmill.toolkit.data.Property.ValueChangeEvent;
@@ -20,6 +19,7 @@ import com.itmill.toolkit.ui.Field; import com.itmill.toolkit.ui.FieldFactory;
import com.itmill.toolkit.ui.Form;
import com.itmill.toolkit.ui.Label;
+import com.itmill.toolkit.ui.Layout;
import com.itmill.toolkit.ui.NativeSelect;
import com.itmill.toolkit.ui.TextField;
import com.itmill.toolkit.ui.Window;
@@ -28,12 +28,6 @@ import com.itmill.toolkit.ui.Button.ClickEvent; public class TestAbsoluteLayout extends TestBase {
private static class MFieldFactory extends BaseFieldFactory {
- @Override
- public Field createField(Container container, Object itemId,
- Object propertyId, Component uiContext) {
- // TODO Auto-generated method stub
- return super.createField(container, itemId, propertyId, uiContext);
- }
@Override
public Field createField(Item item, Object propertyId,
@@ -44,7 +38,20 @@ public class TestAbsoluteLayout extends TestBase { f.setHeight("8em");
f.setCaption("CSS string");
return f;
+ } else if (((String) propertyId).contains("Units")) {
+ NativeSelect s = new NativeSelect() {
+ };
+ s.addContainerProperty("caption", String.class, "");
+ s.setItemCaptionPropertyId("caption");
+ s.setNullSelectionAllowed(false);
+ for (int i = 0; i < Layout.UNIT_SYMBOLS.length; i++) {
+ Item unitItem = s.addItem(i);
+ unitItem.getItemProperty("caption").setValue(
+ Layout.UNIT_SYMBOLS[i]);
+ }
+ return s;
}
+
return super.createField(item, propertyId, uiContext);
}
@@ -202,6 +209,12 @@ public class TestAbsoluteLayout extends TestBase { "heightUnits", "caption", "styleName" }));
beanItem = new BeanItem(l.getPosition(value));
+ String c = "Component properties for "
+ + value.getClass().getSimpleName();
+ if (value instanceof Label) {
+ c += "(" + ((Label) value).getValue() + ")";
+ }
+ componentEditor.setCaption(c);
positionEditor.setItemDataSource(beanItem);
|