aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/vaadin/demo/featurebrowser/ClientCachingExample.java
diff options
context:
space:
mode:
authorArtur Signell <artur.signell@itmill.com>2009-10-27 07:57:12 +0000
committerArtur Signell <artur.signell@itmill.com>2009-10-27 07:57:12 +0000
commit6a3c715dae922edd723c9423b4308d5d7948b74e (patch)
tree46a007274681a9803afccf135ace5554f3e01e3a /src/com/vaadin/demo/featurebrowser/ClientCachingExample.java
parent931d75fef69deb9b738fad97001cf5621de9f43e (diff)
downloadvaadin-framework-6a3c715dae922edd723c9423b4308d5d7948b74e.tar.gz
vaadin-framework-6a3c715dae922edd723c9423b4308d5d7948b74e.zip
Split demo and tests files to own source folders, for #3298
svn changeset:9390/svn branch:6.2
Diffstat (limited to 'src/com/vaadin/demo/featurebrowser/ClientCachingExample.java')
-rw-r--r--src/com/vaadin/demo/featurebrowser/ClientCachingExample.java72
1 files changed, 0 insertions, 72 deletions
diff --git a/src/com/vaadin/demo/featurebrowser/ClientCachingExample.java b/src/com/vaadin/demo/featurebrowser/ClientCachingExample.java
deleted file mode 100644
index ad840c84c3..0000000000
--- a/src/com/vaadin/demo/featurebrowser/ClientCachingExample.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
-@ITMillApache2LicenseForJavaFiles@
- */
-
-package com.vaadin.demo.featurebrowser;
-
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.PaintTarget;
-import com.vaadin.ui.CustomComponent;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.Layout;
-import com.vaadin.ui.TabSheet;
-import com.vaadin.ui.VerticalLayout;
-
-/**
- * This example is a (simple) demonstration of client-side caching. The content
- * in one tab is intentionally made very slow to produce server-side. When the
- * user changes to this tab for the first time, there will be a 3 second wait
- * before the content shows up, but the second time it shows up immediately
- * since the content has not changed and is cached client-side.
- *
- * @author IT Mill Ltd.
- */
-@SuppressWarnings("serial")
-public class ClientCachingExample extends CustomComponent {
-
- private static final String msg = "This example is a (simple) demonstration of client-side caching."
- + " The content in one tab is intentionally made very slow to"
- + " 'produce' server-side. When you changes to this tab for the"
- + " first time, there will be a 3 second wait before the content"
- + " shows up, but the second time it shows up immediately since the"
- + " content has not changed and is cached client-side.";
-
- public ClientCachingExample() {
-
- final VerticalLayout main = new VerticalLayout();
- main.setMargin(true);
- setCompositionRoot(main);
-
- main.addComponent(new Label(msg));
-
- final TabSheet ts = new TabSheet();
- main.addComponent(ts);
-
- Layout layout = new VerticalLayout();
- layout.setMargin(true);
- Label l = new Label("This is a normal label, quick to render.");
- l.setCaption("A normal label");
- layout.addComponent(l);
-
- ts.addTab(layout, "Normal", null);
-
- layout = new VerticalLayout();
- layout.setMargin(true);
- l = new Label("Slow label - until cached client side.") {
- @Override
- public void paintContent(PaintTarget target) throws PaintException {
- try {
- Thread.sleep(3000);
- } catch (final Exception e) {
- // IGNORED
- }
- super.paintContent(target);
- }
-
- };
- l.setCaption("A slow label");
- layout.addComponent(l);
- ts.addTab(layout, "Slow", null);
-
- }
-}