Example usage for com.vaadin.ui AbsoluteLayout AbsoluteLayout

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

Introduction

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

Prototype

public AbsoluteLayout() 

Source Link

Document

Creates an AbsoluteLayout with full size.

Usage

From source file:songstock.web.SongStockUI.java

License:Open Source License

/**
 * Initializes the SongStock UI elements.
 * @param request //w  w  w  .  ja  v  a 2  s .  c  o  m
 */
@Override
protected void init(VaadinRequest request) {

    // Set the browser window title
    getPage().setTitle("SongStock");

    final AbsoluteLayout layout = new AbsoluteLayout();
    layout.setSizeFull();

    // Menu Panel
    MenuPanel menuPanel = new MenuPanel();
    menuPanel.setImmediate(true);
    layout.addComponent(menuPanel, "top:0.0px;left:0.0px;");
    Registry.register(MENU_PANEL, menuPanel);

    // Content Panel
    ContentPanel contentPanel = new ContentPanel();
    contentPanel.setImmediate(true);
    layout.addComponent(contentPanel, "top:23.0px;left:0.0px;");
    Registry.register(CONTENT_PANEL, contentPanel);

    setContent(layout);

    Registry.register(UI, this);

    // Set the application menus

    // USERS SUBSYSTEM:

    // Login Module
    menuPanel.addMenu("Login", BasicLoginFormController.getInstance().getLoginCommand(), true);
    BasicLoginFormController.getInstance().showLoginForm();

    // Register Module
    menuPanel.addMenu("Register", RegisterFormController.getInstance().getRegisterCommand(), true);

    // Multiple Addresses (UI contribution to RegisterForm)
    RegisterFormController.getInstance().addContributor(AddressesController.getInstance());

    // CATALOG SUBSYSTEM:

    // Browsing Module
    menuPanel.addMenu("Browse Catalog", BrowsingController.getInstance().getBrowsingCommand(), true);

    // Basic Search Module
    menuPanel.addMenu("Basic Search", SearchController.getInstance().getBasicSearchCommand(), true);

    // PAYMENTS SUBSYSTEM:

    // Payments Core Module (Process contribution)
    ShoppingCartController.getInstance().addContributor(PAYMENT_STAGE, PaymentViewController.getInstance());

    // Payment Methods (UI contributions)
    PaymentViewController.getInstance().addContributor(CreditCardFormController.getInstance());

    // Additional Charges (Content contributions)
    PaymentViewController.getInstance().addContributor(TaxController.getInstance());

    // SALES SUBSYSTEM:

    // Shopping Cart Module
    menuPanel.addMenu("Shopping Cart", ShoppingCartController.getInstance().getShoppingCartCommand(), false);
    // UI contributions
    BrowsingController.getInstance().addContributor(ShoppingCartController.getInstance());
    SearchController.getInstance().addContributor(ShoppingCartController.getInstance());

    // Download Module (Process contribution)
    ShoppingCartController.getInstance().addContributor(DOWNLOAD_STAGE, DownloadController.getInstance());

    // Purchase History Module
    menuPanel.addMenu("Purchase History", PurchaseHistoryController.getInstance().getPurchaseHistoryCommand(),
            false);
    // Process contributions

    ShoppingCartController.getInstance().addContributor(PURCHASE_STAGE,
            PurchaseHistoryController.getInstance());
}