Example usage for com.vaadin.ui Component setPrimaryStyleName

List of usage examples for com.vaadin.ui Component setPrimaryStyleName

Introduction

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

Prototype

public void setPrimaryStyleName(String style);

Source Link

Document

Changes the primary style name of the component.

Usage

From source file:de.symeda.sormas.ui.utils.CssStyles.java

License:Open Source License

public static void stylePrimary(Component component, String primaryStyle, String... styles) {
    component.setPrimaryStyleName(primaryStyle);
    for (String style : styles)
        component.addStyleName(style);/* w  ww  . jav  a2  s .  c o  m*/
}

From source file:org.opennms.features.topology.app.internal.ui.ToolbarPanel.java

License:Open Source License

private CssLayout createGroup(Component... components) {
    CssLayout group = new CssLayout();
    group.addStyleName("toolbar-component-group");
    group.setSizeFull();// w ww  . j  a  va 2  s .c  o m
    for (Component eachComponent : components) {
        eachComponent.setPrimaryStyleName("toolbar-group-item");
        group.addComponent(eachComponent);
    }
    return group;
}

From source file:org.vaadin.spring.sidebar.components.ValoSideBar.java

License:Apache License

/**
 * Adds a logo to the very top of the side bar, above the header. The logo's primary style is automatically
 * set to {@link ValoTheme#MENU_LOGO} ands its size to undefined.
 *
 * @param logo a {@link com.vaadin.ui.Label} or {@link com.vaadin.ui.Button} to use as the logo, or {@code null} to remove the logo completely.
 *///ww  w .  j a va 2  s .  com
public void setLogo(Component logo) {
    if (getCompositionRoot() != null && this.logo != null) {
        getCompositionRoot().removeComponent(this.logo);
    }
    this.logo = logo;
    if (logo != null) {
        logo.setPrimaryStyleName(ValoTheme.MENU_LOGO);
        logo.setSizeUndefined();
        if (getCompositionRoot() != null) {
            getCompositionRoot().addComponentAsFirst(logo);
        }
    }
}