diff options
author | Jouni Koivuviita <jouni.koivuviita@itmill.com> | 2007-11-02 12:08:15 +0000 |
---|---|---|
committer | Jouni Koivuviita <jouni.koivuviita@itmill.com> | 2007-11-02 12:08:15 +0000 |
commit | 7186ae9647b6ff59beb93bbc54c7d382642ceeb4 (patch) | |
tree | 400e585147d51a76f18e596d6e103ba2e0067cb5 /src/com/itmill/toolkit/demo/HelloWorld.java | |
parent | 2649557cfc9c6709e6a4f67379889395671391aa (diff) | |
download | vaadin-framework-7186ae9647b6ff59beb93bbc54c7d382642ceeb4.tar.gz vaadin-framework-7186ae9647b6ff59beb93bbc54c7d382642ceeb4.zip |
IOrderedLayout vertical now also with TABLE implementation! :)
Paddings removed from IPanel and ITabsheet CSS.
StyleConstants class added to client-side.
svn changeset:2683/svn branch:trunk
Diffstat (limited to 'src/com/itmill/toolkit/demo/HelloWorld.java')
-rw-r--r-- | src/com/itmill/toolkit/demo/HelloWorld.java | 53 |
1 files changed, 43 insertions, 10 deletions
diff --git a/src/com/itmill/toolkit/demo/HelloWorld.java b/src/com/itmill/toolkit/demo/HelloWorld.java index 0118a68d6d..b6b40fcc11 100644 --- a/src/com/itmill/toolkit/demo/HelloWorld.java +++ b/src/com/itmill/toolkit/demo/HelloWorld.java @@ -1,6 +1,12 @@ package com.itmill.toolkit.demo; -import com.itmill.toolkit.ui.*; +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; /** * The classic "hello, world!" example for IT Mill Toolkit. The class simply @@ -14,6 +20,7 @@ import com.itmill.toolkit.ui.*; */ 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 @@ -27,17 +34,43 @@ 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"); - /* - * - Create a label with the classic text - Add the label to the main - * window - */ - main.addComponent(new Label("Hello World!")); + + 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() { - /* - * And that's it! The framework will display the main window and its - * contents when the application is accessed with the terminal. - */ + 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); } } |