From: Matti Tahvonen Date: Tue, 8 Sep 2009 06:00:57 +0000 (+0000) Subject: reverted accidentally committed test X-Git-Tag: 6.7.0.beta1~2504 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c4fafbe881d8802257a9673f797965d64fc6b131;p=vaadin-framework.git reverted accidentally committed test svn changeset:8691/svn branch:6.1 --- diff --git a/src/com/vaadin/demo/HelloWorld.java b/src/com/vaadin/demo/HelloWorld.java index 9aed77adef..4a1042709d 100644 --- a/src/com/vaadin/demo/HelloWorld.java +++ b/src/com/vaadin/demo/HelloWorld.java @@ -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!")); } }