Example usage for com.vaadin.ui HorizontalLayout setStyleName

List of usage examples for com.vaadin.ui HorizontalLayout setStyleName

Introduction

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

Prototype

@Override
    public void setStyleName(String style) 

Source Link

Usage

From source file:your.company.MyVaadinApplication.java

License:Apache License

public HorizontalLayout createToolbar() {
    share.setIcon(new ThemeResource("icons/32/users.png"));
    help.setIcon(new ThemeResource("icons/32/help.png"));
    newContact.setIcon(new ThemeResource("icons/32/document-add.png"));
    search.setIcon(new ThemeResource("icons/32/folder-add.png"));
    HorizontalLayout lo = new HorizontalLayout();
    lo.addComponent(newContact);/*ww w . ja  va2s .c  o m*/
    lo.addComponent(search);
    lo.addComponent(share);
    lo.addComponent(help);
    lo.setMargin(true);
    lo.setSpacing(true);
    lo.setStyleName("toolbar");
    search.addListener((Button.ClickListener) this);
    newContact.addListener((Button.ClickListener) this);
    share.addListener((Button.ClickListener) this);
    help.addListener((Button.ClickListener) this);
    return lo;

}