Example usage for com.vaadin.ui Panel Panel

List of usage examples for com.vaadin.ui Panel Panel

Introduction

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

Prototype

public Panel() 

Source Link

Document

Creates a new empty panel.

Usage

From source file:org.eclipse.hawkbit.ui.tenantconfiguration.PollingConfigurationView.java

License:Open Source License

PollingConfigurationView(final VaadinMessageSource i18n,
        final ControllerPollProperties controllerPollProperties,
        final TenantConfigurationManagement tenantConfigurationManagement) {
    this.tenantConfigurationManagement = tenantConfigurationManagement;

    final Duration minDuration = DurationHelper
            .formattedStringToDuration(controllerPollProperties.getMinPollingTime());
    final Duration maxDuration = DurationHelper
            .formattedStringToDuration(controllerPollProperties.getMaxPollingTime());
    final Duration globalPollTime = DurationHelper.formattedStringToDuration(tenantConfigurationManagement
            .getGlobalConfigurationValue(TenantConfigurationKey.POLLING_TIME_INTERVAL, String.class));
    final Duration globalOverdueTime = DurationHelper.formattedStringToDuration(tenantConfigurationManagement
            .getGlobalConfigurationValue(TenantConfigurationKey.POLLING_OVERDUE_TIME_INTERVAL, String.class));

    final TenantConfigurationValue<String> pollTimeConfValue = tenantConfigurationManagement
            .getConfigurationValue(TenantConfigurationKey.POLLING_TIME_INTERVAL, String.class);
    if (!pollTimeConfValue.isGlobal()) {
        tenantPollTime = DurationHelper.formattedStringToDuration(pollTimeConfValue.getValue());
    }/*w ww  . j av a  2s  .  com*/

    final TenantConfigurationValue<String> overdueTimeConfValue = tenantConfigurationManagement
            .getConfigurationValue(TenantConfigurationKey.POLLING_OVERDUE_TIME_INTERVAL, String.class);
    if (!overdueTimeConfValue.isGlobal()) {
        tenantOverdueTime = DurationHelper.formattedStringToDuration(overdueTimeConfValue.getValue());
    }

    final Panel rootPanel = new Panel();
    rootPanel.setSizeFull();
    rootPanel.addStyleName("config-panel");

    final VerticalLayout vLayout = new VerticalLayout();
    vLayout.setMargin(true);

    final Label headerDisSetType = new Label(i18n.getMessage("configuration.polling.title"));
    headerDisSetType.addStyleName("config-panel-header");
    vLayout.addComponent(headerDisSetType);

    fieldPollTime = DurationConfigField.builder(UIComponentIdProvider.SYSTEM_CONFIGURATION_POLLING)
            .caption(i18n.getMessage("configuration.polling.time"))
            .checkBoxTooltip(i18n.getMessage("configuration.polling.custom.value"))
            .range(minDuration, maxDuration).globalDuration(globalPollTime).tenantDuration(tenantPollTime)
            .build();
    fieldPollTime.addChangeListener(this);
    vLayout.addComponent(fieldPollTime);

    fieldPollingOverdueTime = DurationConfigField.builder(UIComponentIdProvider.SYSTEM_CONFIGURATION_OVERDUE)
            .caption(i18n.getMessage("configuration.polling.overduetime"))
            .checkBoxTooltip(i18n.getMessage("configuration.polling.custom.value"))
            .range(minDuration, maxDuration).globalDuration(globalOverdueTime).tenantDuration(tenantOverdueTime)
            .build();
    fieldPollingOverdueTime.addChangeListener(this);
    vLayout.addComponent(fieldPollingOverdueTime);

    rootPanel.setContent(vLayout);
    setCompositionRoot(rootPanel);
}

From source file:org.eclipse.hawkbit.ui.tenantconfiguration.RepositoryConfigurationView.java

License:Open Source License

private void init() {

    final Panel rootPanel = new Panel();
    rootPanel.setSizeFull();/*w w w.j a v  a 2s .c om*/

    rootPanel.addStyleName("config-panel");

    final VerticalLayout vLayout = new VerticalLayout();
    vLayout.setMargin(true);
    vLayout.setSizeFull();

    final Label header = new Label(i18n.getMessage("configuration.repository.title"));
    header.addStyleName("config-panel-header");
    vLayout.addComponent(header);

    final GridLayout gridLayout = new GridLayout(2, 2);
    gridLayout.setSpacing(true);
    gridLayout.setImmediate(true);
    gridLayout.setColumnExpandRatio(1, 1.0F);
    gridLayout.setSizeFull();

    actionAutocloseCheckBox = SPUIComponentProvider.getCheckBox("", DIST_CHECKBOX_STYLE, null, false, "");
    actionAutocloseCheckBox.setId(UIComponentIdProvider.REPOSITORY_ACTIONS_AUTOCLOSE_CHECKBOX);
    actionAutocloseCheckBox.setValue(actionAutocloseConfigurationItem.isConfigEnabled());
    actionAutocloseCheckBox.addValueChangeListener(this);
    actionAutocloseConfigurationItem.addChangeListener(this);
    gridLayout.addComponent(actionAutocloseCheckBox, 0, 0);
    gridLayout.addComponent(actionAutocloseConfigurationItem, 1, 0);

    actionAutocleanupCheckBox = SPUIComponentProvider.getCheckBox("", DIST_CHECKBOX_STYLE, null, false, "");
    actionAutocleanupCheckBox.setId(UIComponentIdProvider.REPOSITORY_ACTIONS_AUTOCLEANUP_CHECKBOX);
    actionAutocleanupCheckBox.setValue(actionAutocleanupConfigurationItem.isConfigEnabled());
    actionAutocleanupCheckBox.addValueChangeListener(this);
    actionAutocleanupConfigurationItem.addChangeListener(this);
    gridLayout.addComponent(actionAutocleanupCheckBox, 0, 1);
    gridLayout.addComponent(actionAutocleanupConfigurationItem, 1, 1);

    vLayout.addComponent(gridLayout);
    rootPanel.setContent(vLayout);
    setCompositionRoot(rootPanel);
}

From source file:org.eclipse.hawkbit.ui.tenantconfiguration.RolloutConfigurationView.java

License:Open Source License

private void init() {

    final Panel rootPanel = new Panel();
    rootPanel.setSizeFull();//  www .ja v  a2 s . com

    rootPanel.addStyleName("config-panel");

    final VerticalLayout vLayout = new VerticalLayout();
    vLayout.setMargin(true);
    vLayout.setSizeFull();

    final Label header = new Label(i18n.getMessage("configuration.rollout.title"));
    header.addStyleName("config-panel-header");
    vLayout.addComponent(header);

    final HorizontalLayout hLayout = new HorizontalLayout();
    hLayout.setSpacing(true);
    hLayout.setImmediate(true);

    approvalCheckbox = SPUIComponentProvider.getCheckBox("", "", null, false, "");
    approvalCheckbox.setId(UIComponentIdProvider.ROLLOUT_APPROVAL_ENABLED_CHECKBOX);
    approvalCheckbox.setValue(approvalConfigurationItem.isConfigEnabled());
    approvalCheckbox.addValueChangeListener(this);
    approvalConfigurationItem.addChangeListener(this);
    hLayout.addComponent(approvalCheckbox);
    hLayout.addComponent(approvalConfigurationItem);

    final Link linkToApprovalHelp = SPUIComponentProvider.getHelpLink(i18n,
            uiProperties.getLinks().getDocumentation().getRollout());
    hLayout.addComponent(linkToApprovalHelp);
    hLayout.setComponentAlignment(linkToApprovalHelp, Alignment.BOTTOM_RIGHT);

    vLayout.addComponent(hLayout);
    rootPanel.setContent(vLayout);
    setCompositionRoot(rootPanel);
}

From source file:org.eclipse.hawkbit.ui.tenantconfiguration.TenantConfigurationDashboardView.java

License:Open Source License

/**
 * Init method adds all Configuration Views to the list of Views.
 *///from   www .  j  a  v  a 2 s .  c  om
@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));
}

From source file:org.escidoc.browser.controller.ContentModelView.java

License:Open Source License

private Panel buildMetaViewsPanel() {
    // common part: create layout
    Panel metaViewsPanel = new Panel();
    metaViewsPanel.setImmediate(false);//from   w  w  w.  jav a  2s .co  m
    metaViewsPanel.setWidth("100.0%");
    metaViewsPanel.setHeight("100.0%");
    metaViewsPanel.setStyleName(Runo.PANEL_LIGHT);

    // hlMetaViews
    HorizontalLayout hlMetaViews = buildHlMetaViews();
    metaViewsPanel.setContent(hlMetaViews);

    return metaViewsPanel;
}

From source file:org.escidoc.browser.controller.ContentModelView.java

License:Open Source License

private Panel buildLeftPanel() {
    // common part: create layout
    Panel leftPanel = new Panel();
    leftPanel.setImmediate(false);/*  www  .  j  av a2  s  .  co  m*/
    leftPanel.setWidth("100.0%");
    leftPanel.setHeight("100.0%");

    // vlLeftPanel
    VerticalLayout vlLeftPanel = buildVlLeftPanel();
    leftPanel.setContent(vlLeftPanel);

    return leftPanel;
}

From source file:org.escidoc.browser.controller.ContentModelView.java

License:Open Source License

private Panel buildDirectMembersPanel() {
    // common part: create layout
    Panel directMembersPanel = new Panel();
    directMembersPanel.setImmediate(false);
    directMembersPanel.setWidth("100.0%");
    directMembersPanel.setHeight("100.0%");
    directMembersPanel.setStyleName(Runo.PANEL_LIGHT);

    // vlDirectMember
    VerticalLayout vlDirectMember = new VerticalLayout();
    vlDirectMember.setImmediate(false);//from   ww w  .  ja va2  s .c  om
    vlDirectMember.setWidth("100.0%");
    vlDirectMember.setHeight("100.0%");
    vlDirectMember.setMargin(false);
    directMembersPanel.setContent(vlDirectMember);

    return directMembersPanel;
}

From source file:org.escidoc.browser.controller.ContentModelView.java

License:Open Source License

private Panel buildRightPanel() {
    // common part: create layout
    Panel rightPanel = new Panel();
    rightPanel.setImmediate(false);/*from w w w.j  a va 2 s. c  o m*/
    rightPanel.setWidth("100.0%");
    rightPanel.setHeight("100.0%");

    // vlRightPanel
    VerticalLayout vlRightPanel = buildVlRightPanel();
    rightPanel.setContent(vlRightPanel);

    return rightPanel;
}

From source file:org.escidoc.browser.controller.ContentModelView.java

License:Open Source License

private Panel buildResourcePropertiesPanel() {
    // common part: create layout
    Panel resourcePropertiesPanel = new Panel();
    resourcePropertiesPanel.setImmediate(false);
    resourcePropertiesPanel.setWidth("100.0%");
    resourcePropertiesPanel.setHeight("100%");
    resourcePropertiesPanel.setStyleName(Runo.PANEL_LIGHT);

    // vlResourceProperties
    resourcePropertiesPanel.setContent(buildVlResourceProperties());

    return resourcePropertiesPanel;
}

From source file:org.escidoc.browser.controller.ContentModelView.java

License:Open Source License

private Panel buildBreadCrumpPanel() {
    // common part: create layout
    Panel breadCrumpPanel = new Panel();
    breadCrumpPanel.setImmediate(false);
    breadCrumpPanel.setWidth("100.0%");
    breadCrumpPanel.setHeight("30px");
    breadCrumpPanel.setStyleName(Runo.PANEL_LIGHT);

    // vlBreadCrump
    VerticalLayout vlBreadCrump = new VerticalLayout();
    vlBreadCrump.setImmediate(false);//ww  w  .  java2s.  c  o m
    vlBreadCrump.setWidth("100.0%");
    vlBreadCrump.setHeight("100.0%");
    vlBreadCrump.setMargin(false);
    breadCrumpPanel.setContent(vlBreadCrump);

    // BreadCreumb
    new BreadCrumbMenu(breadCrumpPanel, resourceProxy.getName().toString());

    return breadCrumpPanel;
}