From f3a172f0a7e54a41248dfadbc3b126426460117e Mon Sep 17 00:00:00 2001 From: Marc Englund Date: Wed, 7 Nov 2007 11:55:01 +0000 Subject: [PATCH] margins added to content svn changeset:2734/svn branch:trunk --- src/com/itmill/toolkit/demo/CachingDemo.java | 25 +++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/src/com/itmill/toolkit/demo/CachingDemo.java b/src/com/itmill/toolkit/demo/CachingDemo.java index afec85424f..6b91a76174 100644 --- a/src/com/itmill/toolkit/demo/CachingDemo.java +++ b/src/com/itmill/toolkit/demo/CachingDemo.java @@ -3,6 +3,8 @@ package com.itmill.toolkit.demo; import com.itmill.toolkit.terminal.PaintException; import com.itmill.toolkit.terminal.PaintTarget; import com.itmill.toolkit.ui.Label; +import com.itmill.toolkit.ui.Layout; +import com.itmill.toolkit.ui.OrderedLayout; import com.itmill.toolkit.ui.TabSheet; import com.itmill.toolkit.ui.Window; @@ -25,14 +27,22 @@ public class CachingDemo extends com.itmill.toolkit.Application { setTheme("example"); TabSheet ts = new TabSheet(); - ts.setCaption("setHeigth(300)"); main.addComponent(ts); - ts.setHeight(300); + + Layout layout = new OrderedLayout(); + layout.setMargin(true); Label l = new Label( - "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."); - ts.addTab(l, "Normal", null); + "This is 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."); + l.setCaption("A normal label"); + l.setContentMode(Label.CONTENT_XHTML); + layout.addComponent(l); + + ts.addTab(layout, "Normal", null); + + layout = new OrderedLayout(); + layout.setMargin(true); l = new Label( - "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.") { + "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.") { public void paintContent(PaintTarget target) throws PaintException { try { Thread.sleep(3000); @@ -43,7 +53,10 @@ public class CachingDemo extends com.itmill.toolkit.Application { } }; - ts.addTab(l, "Slow", null); + l.setCaption("A slow label"); + l.setContentMode(Label.CONTENT_XHTML); + layout.addComponent(l); + ts.addTab(layout, "Slow", null); } -- 2.39.5