diff options
author | Jani Laakso <jani.laakso@itmill.com> | 2007-10-21 13:11:48 +0000 |
---|---|---|
committer | Jani Laakso <jani.laakso@itmill.com> | 2007-10-21 13:11:48 +0000 |
commit | 4431425fcf72cb34048f35a9aa7ea012b986cd4b (patch) | |
tree | c153a90309dee87326f57adf5fafa4d555e3f2ef /src/com/itmill/toolkit/tests/TestCaptionWrapper.java | |
parent | 2f195c5989d6bbf428f18041dfbe7eb948191c34 (diff) | |
download | vaadin-framework-4431425fcf72cb34048f35a9aa7ea012b986cd4b.tar.gz vaadin-framework-4431425fcf72cb34048f35a9aa7ea012b986cd4b.zip |
Added few test classes.
svn changeset:2566/svn branch:trunk
Diffstat (limited to 'src/com/itmill/toolkit/tests/TestCaptionWrapper.java')
-rw-r--r-- | src/com/itmill/toolkit/tests/TestCaptionWrapper.java | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/com/itmill/toolkit/tests/TestCaptionWrapper.java b/src/com/itmill/toolkit/tests/TestCaptionWrapper.java new file mode 100644 index 0000000000..675ab7e534 --- /dev/null +++ b/src/com/itmill/toolkit/tests/TestCaptionWrapper.java @@ -0,0 +1,43 @@ +package com.itmill.toolkit.tests; + +import com.itmill.toolkit.terminal.ClassResource; +import com.itmill.toolkit.terminal.ErrorMessage; +import com.itmill.toolkit.terminal.UserError; +import com.itmill.toolkit.ui.CustomComponent; +import com.itmill.toolkit.ui.Label; +import com.itmill.toolkit.ui.OrderedLayout; + +public class TestCaptionWrapper extends CustomComponent { + + OrderedLayout main = new OrderedLayout(); + Label label = new Label("iconLabel"); + + public TestCaptionWrapper() { + setCompositionRoot(main); + } + + public void attach() { + super.attach(); + createNewView(); + } + + public void createNewView() { + main.removeAllComponents(); + + // Add resource for label (icon) + ClassResource res = new ClassResource("m.gif", this.getApplication()); + label.setIcon(res); + + // Add error message for label + ErrorMessage errorMsg = new UserError("User error"); + label.setComponentError(errorMsg); + + // Set other common properties for label + label.setDescription("iconLabel description"); + label.setCaption("iconLabel caption"); + label.setValue("iconLabel value"); + + main.addComponent(label); + } + +} |