Example usage for com.vaadin.ui HorizontalLayout addComponentsAndExpand

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

Introduction

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

Prototype

public void addComponentsAndExpand(Component... components) 

Source Link

Document

Adds the given components to this layout and sets them as expanded.

Usage

From source file:org.jpos.qi.minigl.AccountsView.java

License:Open Source License

private Panel createEntriesPanel() {
    Panel entriesPanel = new Panel(getCaptionFromId("entries"));
    entriesPanel.setIcon(VaadinIcons.EXCHANGE);
    entriesPanel.addStyleName("color1");
    entriesPanel.addStyleName("margin-top-panel");

    VerticalLayout layout = new VerticalLayout();
    layout.setMargin(true);//from  ww w  . j  a  v a 2  s . com
    layout.setSpacing(true);
    Panel filterPanel = new Panel();
    filterPanel.addStyleName("v-panel-well");

    journals = new JournalsCombo(true);

    rangeLabelTitle = new Label();
    rangeLabelTitle.addStyleName(ValoTheme.LABEL_BOLD);
    dateRangeComponent = new DateRangeComponent(DateRange.ALL_TIME, true) {
        @Override
        protected Button.ClickListener createRefreshListener() {
            return event -> {
                refreshDetails();
            };
        }
    };
    VerticalLayout detailsLayout = new VerticalLayout();

    entryGrid = new EntryGrid(null, false);
    formatEntriesGrid();
    detailsLayout.addComponent(entryGrid);
    detailsLayout.setMargin(false);

    HorizontalLayout layersLayout = new HorizontalLayout();
    layersLayout.setSizeFull();
    layersLayout.setSpacing(true);

    layersCheckBox = new CheckBoxGroup<>(getCaptionFromId("layers").toUpperCase());
    layersCheckBox.setItemCaptionGenerator(item -> item.getId() + " - " + item.getName());
    layersCheckBox.addValueChangeListener(listener -> refreshDetails());

    layersLayout.addComponentsAndExpand(layersCheckBox);
    VerticalLayout vbar = new VerticalLayout(journals, dateRangeComponent, layersLayout);
    vbar.setSpacing(true);
    vbar.setMargin(true);
    filterPanel.setContent(vbar);
    layout.addComponents(rangeLabelTitle, detailsLayout, filterPanel);
    entriesPanel.setContent(layout);
    refreshDetails();
    return entriesPanel;

}