diff options
author | Marc Englund <marc.englund@itmill.com> | 2007-11-19 14:03:05 +0000 |
---|---|---|
committer | Marc Englund <marc.englund@itmill.com> | 2007-11-19 14:03:05 +0000 |
commit | f2e3722df9676436680afc0f1991e91e1696fb99 (patch) | |
tree | 6f255ff78abaf96f1e71a1f2c9ecd3b66647f4a2 /src/com/itmill/toolkit/demo/NotificationDemo.java | |
parent | 93291f532db9d545cf2a8dd98e2671f27cd197b0 (diff) | |
download | vaadin-framework-f2e3722df9676436680afc0f1991e91e1696fb99.tar.gz vaadin-framework-f2e3722df9676436680afc0f1991e91e1696fb99.zip |
MASS REFORMAT.
According to http://toolkit.intra.itmill.com/trac/itmilltoolkit/wiki/CodingConventions
svn changeset:2864/svn branch:trunk
Diffstat (limited to 'src/com/itmill/toolkit/demo/NotificationDemo.java')
-rw-r--r-- | src/com/itmill/toolkit/demo/NotificationDemo.java | 122 |
1 files changed, 61 insertions, 61 deletions
diff --git a/src/com/itmill/toolkit/demo/NotificationDemo.java b/src/com/itmill/toolkit/demo/NotificationDemo.java index 5820b09da0..e7a0dcb7e4 100644 --- a/src/com/itmill/toolkit/demo/NotificationDemo.java +++ b/src/com/itmill/toolkit/demo/NotificationDemo.java @@ -1,10 +1,10 @@ package com.itmill.toolkit.demo; import com.itmill.toolkit.data.Item; +import com.itmill.toolkit.ui.AbstractSelect; import com.itmill.toolkit.ui.Button; import com.itmill.toolkit.ui.NativeSelect; import com.itmill.toolkit.ui.RichTextArea; -import com.itmill.toolkit.ui.Select; import com.itmill.toolkit.ui.TextField; import com.itmill.toolkit.ui.Window; import com.itmill.toolkit.ui.Button.ClickEvent; @@ -18,70 +18,70 @@ import com.itmill.toolkit.ui.Button.ClickListener; */ public class NotificationDemo extends com.itmill.toolkit.Application { - // Dropdown select for notification type, using the native dropdown - NativeSelect type; - // Textfield for the notification caption - TextField caption; - // Textfield for the notification content - TextField message; + // Dropdown select for notification type, using the native dropdown + NativeSelect type; + // Textfield for the notification caption + TextField caption; + // Textfield for the notification content + TextField message; - /** - * The initialization method that is the only requirement for inheriting the - * com.itmill.toolkit.service.Application class. It will be automatically - * called by the framework when a user accesses the application. - */ - public void init() { + /** + * The initialization method that is the only requirement for inheriting the + * com.itmill.toolkit.service.Application class. It will be automatically + * called by the framework when a user accesses the application. + */ + public void init() { - // Create new window for the application and give the window a visible. - Window main = new Window("Notification demo"); - // set as main window - setMainWindow(main); + // Create new window for the application and give the window a visible. + Window main = new Window("Notification demo"); + // set as main window + setMainWindow(main); - // Create the 'type' dropdown select. - type = new NativeSelect("Notification type"); - // no empty selection allowed - type.setNullSelectionAllowed(false); - // we want a different caption than the value - type.addContainerProperty("caption", String.class, null); - type.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY); - type.setItemCaptionPropertyId("caption"); - // add some content (items) using the Container API - Item i = type.addItem(new Integer( - Window.Notification.TYPE_HUMANIZED_MESSAGE)); - i.getItemProperty("caption").setValue("Humanized message"); - i = type.addItem(new Integer(Window.Notification.TYPE_WARNING_MESSAGE)); - i.getItemProperty("caption").setValue("Warning message"); - i = type.addItem(new Integer(Window.Notification.TYPE_ERROR_MESSAGE)); - i.getItemProperty("caption").setValue("Error message"); - i = type - .addItem(new Integer(Window.Notification.TYPE_TRAY_NOTIFICATION)); - i.getItemProperty("caption").setValue("Tray notification"); - // set the initially selected item - type.setValue(new Integer(Window.Notification.TYPE_HUMANIZED_MESSAGE)); - main.addComponent(type); // add to layout + // Create the 'type' dropdown select. + type = new NativeSelect("Notification type"); + // no empty selection allowed + type.setNullSelectionAllowed(false); + // we want a different caption than the value + type.addContainerProperty("caption", String.class, null); + type.setItemCaptionMode(AbstractSelect.ITEM_CAPTION_MODE_PROPERTY); + type.setItemCaptionPropertyId("caption"); + // add some content (items) using the Container API + Item i = type.addItem(new Integer( + Window.Notification.TYPE_HUMANIZED_MESSAGE)); + i.getItemProperty("caption").setValue("Humanized message"); + i = type.addItem(new Integer(Window.Notification.TYPE_WARNING_MESSAGE)); + i.getItemProperty("caption").setValue("Warning message"); + i = type.addItem(new Integer(Window.Notification.TYPE_ERROR_MESSAGE)); + i.getItemProperty("caption").setValue("Error message"); + i = type + .addItem(new Integer(Window.Notification.TYPE_TRAY_NOTIFICATION)); + i.getItemProperty("caption").setValue("Tray notification"); + // set the initially selected item + type.setValue(new Integer(Window.Notification.TYPE_HUMANIZED_MESSAGE)); + main.addComponent(type); // add to layout - // Notification caption - caption = new TextField("Caption"); - caption.setColumns(20); - caption.setValue("Brown Fox!"); - main.addComponent(caption); + // Notification caption + caption = new TextField("Caption"); + caption.setColumns(20); + caption.setValue("Brown Fox!"); + main.addComponent(caption); - // Notification message - message = new RichTextArea(); - message.setCaption("Message"); - message.setValue("A quick one jumped over the lazy dog."); - main.addComponent(message); // add to layout + // Notification message + message = new RichTextArea(); + message.setCaption("Message"); + message.setValue("A quick one jumped over the lazy dog."); + main.addComponent(message); // add to layout - // Button to show the notification - Button b = new Button("Show notification", new ClickListener() { - // this is an inline ClickListener - public void buttonClick(ClickEvent event) { - // show the notification - getMainWindow().showNotification((String) caption.getValue(), - (String) message.getValue(), - ((Integer) type.getValue()).intValue()); - } - }); - main.addComponent(b); // add button to layout - } + // Button to show the notification + Button b = new Button("Show notification", new ClickListener() { + // this is an inline ClickListener + public void buttonClick(ClickEvent event) { + // show the notification + getMainWindow().showNotification((String) caption.getValue(), + (String) message.getValue(), + ((Integer) type.getValue()).intValue()); + } + }); + main.addComponent(b); // add button to layout + } } |