]> source.dussan.org Git - vaadin-framework.git/commitdiff
margins added to content
authorMarc Englund <marc.englund@itmill.com>
Wed, 7 Nov 2007 11:55:01 +0000 (11:55 +0000)
committerMarc Englund <marc.englund@itmill.com>
Wed, 7 Nov 2007 11:55:01 +0000 (11:55 +0000)
svn changeset:2734/svn branch:trunk

src/com/itmill/toolkit/demo/CachingDemo.java

index afec85424f1469bf4d03d046d5883b8bf6c3e65d..6b91a76174d8c181436155a88d9eb560fe412087 100644 (file)
@@ -3,6 +3,8 @@ package com.itmill.toolkit.demo;
 import com.itmill.toolkit.terminal.PaintException;\r
 import com.itmill.toolkit.terminal.PaintTarget;\r
 import com.itmill.toolkit.ui.Label;\r
+import com.itmill.toolkit.ui.Layout;\r
+import com.itmill.toolkit.ui.OrderedLayout;\r
 import com.itmill.toolkit.ui.TabSheet;\r
 import com.itmill.toolkit.ui.Window;\r
 \r
@@ -25,14 +27,22 @@ public class CachingDemo extends com.itmill.toolkit.Application {
                setTheme("example");\r
 \r
                TabSheet ts = new TabSheet();\r
-               ts.setCaption("setHeigth(300)");\r
                main.addComponent(ts);\r
-               ts.setHeight(300);\r
+\r
+               Layout layout = new OrderedLayout();\r
+               layout.setMargin(true);\r
                Label l = new Label(\r
-                               "A normal label, quick to render. The second tab will be slow to render the first time, after that it will be as quick as this one.");\r
-               ts.addTab(l, "Normal", null);\r
+                               "This is a normal label, quick to render.<br/>The second tab will be slow to render the first time, after that it will be as quick as this one.");\r
+               l.setCaption("A normal label");\r
+               l.setContentMode(Label.CONTENT_XHTML);\r
+               layout.addComponent(l);\r
+\r
+               ts.addTab(layout, "Normal", null);\r
+\r
+               layout = new OrderedLayout();\r
+               layout.setMargin(true);\r
                l = new Label(\r
-                               "The first time you change to this tab, this label is very slow to produce (server-side). However, it will seem fast the second time you change to this tab, because it has not changed and is cached client-side.") {\r
+                               "The first time you change to this tab, this label is very slow to produce (server-side).<br/> However, it will seem fast the second time you change to this tab, because it has not changed and is cached client-side.") {\r
                        public void paintContent(PaintTarget target) throws PaintException {\r
                                try {\r
                                        Thread.sleep(3000);\r
@@ -43,7 +53,10 @@ public class CachingDemo extends com.itmill.toolkit.Application {
                        }\r
 \r
                };\r
-               ts.addTab(l, "Slow", null);\r
+               l.setCaption("A slow label");\r
+               l.setContentMode(Label.CONTENT_XHTML);\r
+               layout.addComponent(l);\r
+               ts.addTab(layout, "Slow", null);\r
 \r
        }\r
 \r