]> source.dussan.org Git - vaadin-framework.git/commitdiff
reverted accidentally committed test
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 8 Sep 2009 06:00:57 +0000 (06:00 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 8 Sep 2009 06:00:57 +0000 (06:00 +0000)
svn changeset:8691/svn branch:6.1

src/com/vaadin/demo/HelloWorld.java

index 9aed77adefd5406cd13409e5723b26b68842e851..4a1042709d984328abe1bacc912649c6a61373fb 100644 (file)
@@ -1,47 +1,23 @@
 package com.vaadin.demo;
 
-import com.vaadin.ui.Button;
 import com.vaadin.ui.Label;
-import com.vaadin.ui.TabSheet;
-import com.vaadin.ui.VerticalLayout;
 import com.vaadin.ui.Window;
-import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Button.ClickListener;
-import com.vaadin.ui.TabSheet.Tab;
 
 @SuppressWarnings("serial")
-public class HelloWorld extends com.vaadin.Application implements ClickListener {
-    private static final int TABS_COUNT = 3;
-    private TabSheet tabSheet;
-    private Label[] label = new Label[TABS_COUNT];
-    private Tab[] tab = new Tab[TABS_COUNT];
+public class HelloWorld extends com.vaadin.Application {
 
+    /**
+     * Init is invoked on application load (when a user accesses the application
+     * for the first time).
+     */
     @Override
     public void init() {
-        setMainWindow(new Window("TabSheet Demo", createMainLayout()));
-    }
-
-    private VerticalLayout createMainLayout() {
-        VerticalLayout layout = new VerticalLayout();
 
-        tabSheet = new TabSheet();
-        for (int i = 1; i <= TABS_COUNT; i++) {
-            label[i - 1] = new Label("Tab " + i);
-            tab[i - 1] = tabSheet.addTab(label[i - 1], "Tab " + i, null);
-            tab[i - 1].setEnabled(false);
-        }
-
-        layout.addComponent(tabSheet);
-        Button btn = new Button("Enable and activate tab");
-        btn.addListener(this);
-        layout.addComponent(btn);
-        return layout;
-    }
+        // Main window is the primary browser window
+        final Window main = new Window("Hello window");
+        setMainWindow(main);
 
-    public void buttonClick(ClickEvent event) {
-        for (int i = 0; i < TABS_COUNT; i++) {
-            tab[i].setEnabled(true);
-        }
-        tabSheet.setSelectedTab(label[0]);
+        // "Hello world" text is added to window as a Label component
+        main.addComponent(new Label("Hello World!"));
     }
 }