Example usage for com.vaadin.ui CssLayout CssLayout

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

Introduction

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

Prototype

public CssLayout(Component... children) 

Source Link

Document

Constructs a CssLayout with the given components in the given order.

Usage

From source file:org.eclipse.hawkbit.ui.menu.DashboardMenu.java

License:Open Source License

/**
 * Creates the wrapper which contains the menu item and the adjacent label
 * for displaying the occurred events/* ww  w .j  a  v  a 2 s .c o m*/
 * 
 * @param menuItemButton
 *            the menu item
 * @param notificationLabel
 *            the label for displaying the occurred events
 * @return Component of type CssLayout
 */
private static Component buildLabelWrapper(final ValoMenuItemButton menuItemButton,
        final Component notificationLabel) {
    final CssLayout dashboardWrapper = new CssLayout(menuItemButton);
    dashboardWrapper.addStyleName("labelwrapper");
    dashboardWrapper.addStyleName(ValoTheme.MENU_ITEM);
    notificationLabel.addStyleName(ValoTheme.MENU_BADGE);
    notificationLabel.setWidthUndefined();
    notificationLabel.setVisible(false);
    notificationLabel
            .setId(UIComponentIdProvider.NOTIFICATION_MENU_ID + menuItemButton.getCaption().toLowerCase());
    dashboardWrapper.addComponent(notificationLabel);
    return dashboardWrapper;
}