Java Code Examples for com.vaadin.ui.Panel#setStyleName()

The following examples show how to use com.vaadin.ui.Panel#setStyleName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TenantConfigurationDashboardView.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Init method adds all Configuration Views to the list of Views.
 */
@PostConstruct
public void init() {
    if (defaultDistributionSetTypeLayout.getComponentCount() > 0) {
        configurationViews.add(defaultDistributionSetTypeLayout);
    }
    configurationViews.add(repositoryConfigurationView);
    configurationViews.add(rolloutConfigurationView);
    configurationViews.add(authenticationConfigurationView);
    configurationViews.add(pollingConfigurationView);
    if (customConfigurationViews != null) {
        configurationViews.addAll(
                customConfigurationViews.stream().filter(ConfigurationGroup::show).collect(Collectors.toList()));
    }

    final Panel rootPanel = new Panel();
    rootPanel.setStyleName("tenantconfig-root");

    final VerticalLayout rootLayout = new VerticalLayout();
    rootLayout.setSizeFull();
    rootLayout.setMargin(true);
    rootLayout.setSpacing(true);

    configurationViews.forEach(rootLayout::addComponent);

    final HorizontalLayout buttonContent = saveConfigurationButtonsLayout();
    rootLayout.addComponent(buttonContent);
    rootLayout.setComponentAlignment(buttonContent, Alignment.BOTTOM_LEFT);
    rootPanel.setContent(rootLayout);
    setCompositionRoot(rootPanel);

    configurationViews.forEach(view -> view.addChangeListener(this));
}
 
Example 2
Source File: AbstractTableLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private void buildLayout() {
    setSizeFull();
    setSpacing(true);
    setMargin(false);
    setStyleName("group");
    final VerticalLayout tableHeaderLayout = new VerticalLayout();
    tableHeaderLayout.setSizeFull();
    tableHeaderLayout.setSpacing(false);
    tableHeaderLayout.setMargin(false);

    tableHeaderLayout.setStyleName("table-layout");
    tableHeaderLayout.addComponent(tableHeader);

    tableHeaderLayout.setComponentAlignment(tableHeader, Alignment.TOP_CENTER);
    if (isShortCutKeysRequired()) {
        final Panel tablePanel = new Panel();
        tablePanel.setStyleName("table-panel");
        tablePanel.setHeight(100.0F, Unit.PERCENTAGE);
        tablePanel.setContent(table);
        tablePanel.addActionHandler(getShortCutKeysHandler(i18n));
        tablePanel.addStyleName(ValoTheme.PANEL_BORDERLESS);
        tableHeaderLayout.addComponent(tablePanel);
        tableHeaderLayout.setComponentAlignment(tablePanel, Alignment.TOP_CENTER);
        tableHeaderLayout.setExpandRatio(tablePanel, 1.0F);
    } else {
        tableHeaderLayout.addComponent(table);
        tableHeaderLayout.setComponentAlignment(table, Alignment.TOP_CENTER);
        tableHeaderLayout.setExpandRatio(table, 1.0F);
    }

    addComponent(tableHeaderLayout);
    addComponent(detailsLayout);
    setComponentAlignment(tableHeaderLayout, Alignment.TOP_CENTER);
    setComponentAlignment(detailsLayout, Alignment.TOP_CENTER);
    setExpandRatio(tableHeaderLayout, 1.0F);
}
 
Example 3
Source File: AbstractHawkbitUI.java    From hawkbit with Eclipse Public License 1.0 4 votes vote down vote up
private Panel buildContent() {
    final Panel content = new Panel();
    content.setSizeFull();
    content.setStyleName("view-content");
    return content;
}