Example usage for com.vaadin.ui.themes ValoTheme MENU_BADGE

List of usage examples for com.vaadin.ui.themes ValoTheme MENU_BADGE

Introduction

In this page you can find the example usage for com.vaadin.ui.themes ValoTheme MENU_BADGE.

Prototype

String MENU_BADGE

To view the source code for com.vaadin.ui.themes ValoTheme MENU_BADGE.

Click Source Link

Document

Add a SPAN element with this style name inside a #MENU_SUBTITLE or #MENU_ITEM to add an additional badge indicator to the subtitle/item.

Usage

From source file:com.hybridbpm.ui.MainMenu.java

License:Apache License

protected void addMenuItemComponent(final ViewDefinition viewDefinition, String parameters) {
    CssLayout dashboardWrapper = new CssLayout();
    dashboardWrapper.addStyleName("badgewrapper");
    dashboardWrapper.addStyleName(ValoTheme.MENU_ITEM);
    dashboardWrapper.setWidth(100.0f, Sizeable.Unit.PERCENTAGE);

    Label notificationsBadge = new Label();
    notificationsBadge.addStyleName(ValoTheme.MENU_BADGE);
    notificationsBadge.setWidthUndefined();
    notificationsBadge.setVisible(false);

    if (viewDefinition != null) {
        dashboardWrapper.addComponents(new ValoMenuItemButton(viewDefinition, parameters), notificationsBadge);
        menuItemsLayout.addComponent(dashboardWrapper);
    } else if (HybridbpmUI.getDeveloperMode()) {
        dashboardWrapper.addComponents(new ValoMenuAddViewButton(), notificationsBadge);
        menuItemsLayout.addComponent(dashboardWrapper);
    }//w  ww  . ja  v  a2  s  .  c om
}

From source file:com.hybridbpm.ui.UsersMenu.java

License:Apache License

public void search(String text) {
    table.removeAllItems();//from  w w  w .ja v  a2 s . c o  m
    List<User> list = HybridbpmUI.getAccessAPI().findUsersByName(text);
    for (User u : list) {
        Item item = table.addItem(u);
        Label notificationsBadge = new Label("45");
        notificationsBadge.addStyleName(ValoTheme.MENU_BADGE);
        notificationsBadge.addStyleName(ValoTheme.LABEL_TINY);
        notificationsBadge.setWidthUndefined();
        notificationsBadge.setDescription("45 task todo");
        item.getItemProperty("tasks").setValue(notificationsBadge);
    }
    //        table.select(list.get(0));
}

From source file:com.wintindustries.pfserver.interfaces.view.dashboard.DashboardMenu.java

private Component buildBadgeWrapper(final Component menuItemButton, final Component badgeLabel) {
    CssLayout dashboardWrapper = new CssLayout(menuItemButton);
    dashboardWrapper.addStyleName("badgewrapper");
    dashboardWrapper.addStyleName(ValoTheme.MENU_ITEM);
    badgeLabel.addStyleName(ValoTheme.MENU_BADGE);
    badgeLabel.setWidthUndefined();/*  w  w  w  .j  ava2  s .c  o m*/
    badgeLabel.setVisible(false);
    dashboardWrapper.addComponent(badgeLabel);
    return dashboardWrapper;
}

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//from  w ww.j a  v a2 s . co  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;
}