Example usage for com.vaadin.ui Window Window

List of usage examples for com.vaadin.ui Window Window

Introduction

In this page you can find the example usage for com.vaadin.ui Window Window.

Prototype

public Window(String caption) 

Source Link

Document

Creates a new, empty window with a given title.

Usage

From source file:se.natusoft.osgi.aps.tools.web.vaadin.VaadinLoginDialogHandler.java

License:Open Source License

/**
 * Creates a new VaadinLoginDialogHandler.
 *
 * @param appWindow The Vaadin application window to add the popup login dialog to.
 * @param loginHandler A handler for doing the login from the login dialog input.
 *///from   ww  w.  j a  v a 2  s.c  o m
public VaadinLoginDialogHandler(Window appWindow, LoginHandler loginHandler) {
    this.appWindow = appWindow;
    this.loginHandler = loginHandler;

    // Create Login window dialog
    this.loginWindow = new Window("Login");
    this.loginWindow.setModal(true);
    this.loginWindow.setWidth("300px");

    VerticalLayout dialogLayout = new VerticalLayout();
    dialogLayout.setSpacing(true);
    dialogLayout.setMargin(true);
    this.userName = new TextField("User:");
    this.userName.setColumns(20);
    dialogLayout.addComponent(this.userName);
    this.password = new PasswordField("Password");
    this.password.setColumns(20);
    this.password.setImmediate(true);
    this.password.addListener(new Property.ValueChangeListener() {
        @Override
        public void valueChange(Property.ValueChangeEvent event) {
            login();
        }
    });
    dialogLayout.addComponent(password);
    Button loginButton = new Button("Login");
    loginButton.addListener(new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent event) {
            login();
        }
    });
    dialogLayout.addComponent(loginButton);
    this.loginWindow.setContent(dialogLayout);
}

From source file:songstock.web.SongStockUI.java

License:Open Source License

/**
 * Shows a modal popup window with the given title and content.
 * @param title of the popup window/*w w  w  . ja  v a 2s . c o  m*/
 * @param content of the popup window
 */
public void showPopupWindow(String title, Component content) {
    // Create a new popup window
    popupWindow = new Window(title);
    popupWindow.setModal(true);
    // Add content to the popup window
    popupWindow.setContent(content);
    // Set the height of the popup window
    popupWindow.setHeight(content.getHeight() + 50, content.getHeightUnits());
    // Set the width of the popup window
    popupWindow.setWidth(content.getWidth(), content.getWidthUnits());

    // Add popup window to the app's main window
    addWindow(popupWindow);
}

From source file:taxi.com.MyVaadinApplication.java

License:Apache License

@Override
public void init() {
    window = new Window("My Vaadin Application");
    setMainWindow(window);/*from w  w  w .  j av  a  2s.c o m*/
    Button button = new Button("Click Me");
    button.addListener(new Button.ClickListener() {
        public void buttonClick(ClickEvent event) {
            window.addComponent(new ApplicationMainLayout());
        }
    });
    window.addComponent(button);
}