]> source.dussan.org Git - vaadin-framework.git/commitdiff
Rollbacked back to original Hello World.. Please do not commit your tests over Hello...
authorJoonas Lehtinen <joonas.lehtinen@itmill.com>
Fri, 2 Nov 2007 14:08:34 +0000 (14:08 +0000)
committerJoonas Lehtinen <joonas.lehtinen@itmill.com>
Fri, 2 Nov 2007 14:08:34 +0000 (14:08 +0000)
svn changeset:2693/svn branch:trunk

src/com/itmill/toolkit/demo/HelloWorld.java

index b6b40fcc11ad705dc6749d3832ac3eebbd38e887..d4ab04e48602afce1485053b9188e10d397c8360 100644 (file)
@@ -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.
+                */
        }
 }