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
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
}\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