From: Joonas Lehtinen Date: Fri, 2 Nov 2007 14:08:34 +0000 (+0000) Subject: Rollbacked back to original Hello World.. Please do not commit your tests over Hello... X-Git-Tag: 6.7.0.beta1~5686 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7bd32e78af369312078f63681ad6d7cbc1ec1dac;p=vaadin-framework.git Rollbacked back to original Hello World.. Please do not commit your tests over Hello World.. (In fact, you should use Janis Test Bench instead and save the tests for future use) svn changeset:2693/svn branch:trunk --- diff --git a/src/com/itmill/toolkit/demo/HelloWorld.java b/src/com/itmill/toolkit/demo/HelloWorld.java index b6b40fcc11..d4ab04e486 100644 --- a/src/com/itmill/toolkit/demo/HelloWorld.java +++ b/src/com/itmill/toolkit/demo/HelloWorld.java @@ -1,12 +1,6 @@ package com.itmill.toolkit.demo; -import com.itmill.toolkit.data.Property.ValueChangeEvent; -import com.itmill.toolkit.data.Property.ValueChangeListener; -import com.itmill.toolkit.ui.Label; -import com.itmill.toolkit.ui.OrderedLayout; -import com.itmill.toolkit.ui.Panel; -import com.itmill.toolkit.ui.Slider; -import com.itmill.toolkit.ui.Window; +import com.itmill.toolkit.ui.*; /** * The classic "hello, world!" example for IT Mill Toolkit. The class simply @@ -20,7 +14,6 @@ import com.itmill.toolkit.ui.Window; */ public class HelloWorld extends com.itmill.toolkit.Application { - private Label value = new Label(); /** * The initialization method that is the only requirement for inheriting the * com.itmill.toolkit.service.Application class. It will be automatically @@ -34,43 +27,16 @@ public class HelloWorld extends com.itmill.toolkit.Application { */ Window main = new Window("Hello window"); setMainWindow(main); - - OrderedLayout ol = new OrderedLayout(OrderedLayout.ORIENTATION_HORIZONTAL); - setTheme("example"); - - Slider s = new Slider(); - s.setCaption("Volume"); - s.setMax(20); - s.setMin(12); - //s.setResolution(2); - s.setImmediate(true); - s.setOrientation(Slider.ORIENTATION_VERTICAL); - //s.setArrows(true); - s.setSize(200); - //s.addStyleName(Slider.STYLE_SCROLLBAR); - - s.addListener(new ValueChangeListener() { + /* + * - Create a label with the classic text - Add the label to the main + * window + */ + main.addComponent(new Label("Hello World!")); - public void valueChange(ValueChangeEvent event) { - value.setValue(event.getProperty().getValue()); - } - - }); - - ol.addComponent(s); - - Panel p = new Panel("Volume level"); - p.setHeight(400); - p.setHeightUnits(Panel.UNITS_PIXELS); - ((OrderedLayout)p.getLayout()).setMargin(false,true,true,false); - - p.addComponent(value); - ol.addComponent(p); - value.setValue(s.getValue()); - - ol.setComponentAlignment(s, OrderedLayout.ALIGNMENT_LEFT, OrderedLayout.ALIGNMENT_BOTTOM); - - main.setLayout(ol); + /* + * And that's it! The framework will display the main window and its + * contents when the application is accessed with the terminal. + */ } }