diff options
author | Henri Sara <henri.sara@itmill.com> | 2009-05-11 09:19:03 +0000 |
---|---|---|
committer | Henri Sara <henri.sara@itmill.com> | 2009-05-11 09:19:03 +0000 |
commit | adc8c0ad3573272c236040c3a76005b9e73a5737 (patch) | |
tree | a3860704dbd5b82dc6af38684b80f8ef79a32722 /src/com/vaadin/tests/tickets/Ticket1581.java | |
parent | 5abc870dda584d0c2fc47fd5eec4ae3de3fa240e (diff) | |
download | vaadin-framework-adc8c0ad3573272c236040c3a76005b9e73a5737.tar.gz vaadin-framework-adc8c0ad3573272c236040c3a76005b9e73a5737.zip |
#2904: initial bulk rename "com.itmill.toolkit" -> "com.vaadin"
- com.itmill.toolkit.external not yet fully renamed
svn changeset:7715/svn branch:6.0
Diffstat (limited to 'src/com/vaadin/tests/tickets/Ticket1581.java')
-rw-r--r-- | src/com/vaadin/tests/tickets/Ticket1581.java | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/src/com/vaadin/tests/tickets/Ticket1581.java b/src/com/vaadin/tests/tickets/Ticket1581.java new file mode 100644 index 0000000000..0b170260d9 --- /dev/null +++ b/src/com/vaadin/tests/tickets/Ticket1581.java @@ -0,0 +1,71 @@ +package com.vaadin.tests.tickets;
+
+import java.util.Date;
+
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.ProgressIndicator;
+import com.vaadin.ui.Window;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+
+public class Ticket1581 extends com.vaadin.Application {
+
+ private Label time;
+ private ProgressIndicator poller;
+ private Thread thread;
+
+ @Override
+ public void init() {
+ final Window main = new Window(getClass().getName().substring(
+ getClass().getName().lastIndexOf(".") + 1));
+ setMainWindow(main);
+
+ main.addComponent(new Label("Test the second issue in ticket #1581"));
+
+ time = new Label();
+ poller = new ProgressIndicator();
+ poller.setPollingInterval(200);
+ main.addComponent(time);
+ main.addComponent(poller);
+
+ thread = new Thread() {
+
+ @Override
+ public void run() {
+ super.run();
+ while (true) {
+ time.setValue(new Date());
+ try {
+ sleep(200);
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ }
+
+ };
+
+ thread.start();
+
+ final Button stop = new Button("Stop updating", new ClickListener() {
+ boolean active = true;
+
+ public void buttonClick(ClickEvent event) {
+
+ if (active) {
+ main.removeComponent(poller);
+ event.getButton().setCaption("Resume");
+ } else {
+ main.addComponent(poller);
+ event.getButton().setCaption("Stop updating");
+ }
+ active = !active;
+ }
+ });
+
+ main.addComponent(stop);
+ }
+
+}
|