Example usage for com.vaadin.ui HorizontalLayout addStyleName

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

Introduction

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

Prototype

@Override
    public void addStyleName(String style) 

Source Link

Usage

From source file:org.eclipse.hawkbit.ui.artifacts.upload.UploadProgressInfoWindow.java

License:Open Source License

private HorizontalLayout getCaptionLayout() {
    final HorizontalLayout captionLayout = new HorizontalLayout();
    captionLayout.setSizeFull();//from  ww  w  .ja  v  a  2  s.  c o m
    captionLayout.setHeight("36px");
    captionLayout.addComponents(windowCaption, closeButton);
    captionLayout.setExpandRatio(windowCaption, 1.0F);
    captionLayout.addStyleName("v-window-header");
    return captionLayout;
}

From source file:org.eclipse.hawkbit.ui.artifacts.upload.UploadResultWindow.java

License:Open Source License

private void createLayout() {
    final HorizontalLayout footer = new HorizontalLayout();
    footer.setSizeUndefined();/* w  w w  .  j a  va 2s.  co  m*/
    footer.addStyleName("confirmation-window-footer");
    footer.setSpacing(true);
    footer.setMargin(false);
    footer.addComponents(closeBtn);
    footer.setComponentAlignment(closeBtn, Alignment.TOP_CENTER);

    final VerticalLayout uploadResultDetails = new VerticalLayout();
    uploadResultDetails.setWidth(SPUIDefinitions.MIN_UPLOAD_CONFIRMATION_POPUP_WIDTH + "px");
    uploadResultDetails.addStyleName("confirmation-popup");
    uploadResultDetails.addComponent(uploadResultTable);
    uploadResultDetails.setComponentAlignment(uploadResultTable, Alignment.MIDDLE_CENTER);
    uploadResultDetails.addComponent(footer);
    uploadResultDetails.setComponentAlignment(footer, Alignment.MIDDLE_CENTER);

    uploadResultsWindow = new Window();
    uploadResultsWindow.setContent(uploadResultDetails);
    uploadResultsWindow.setResizable(Boolean.FALSE);
    uploadResultsWindow.setClosable(Boolean.FALSE);
    uploadResultsWindow.setDraggable(Boolean.TRUE);
    uploadResultsWindow.setModal(true);
    uploadResultsWindow.setCaption(SPUILabelDefinitions.UPLOAD_RESULT);
    uploadResultsWindow.addStyleName(SPUIStyleDefinitions.CONFIRMATION_WINDOW_CAPTION);
}

From source file:org.eclipse.hawkbit.ui.artifacts.upload.UploadStatusInfoWindow.java

License:Open Source License

private HorizontalLayout getCaptionLayout() {
    final HorizontalLayout captionLayout = new HorizontalLayout();
    captionLayout.setSizeFull();/*w  ww .j ava  2 s.  com*/
    captionLayout.setHeight("36px");
    captionLayout.addComponents(windowCaption, minimizeButton, resizeButton, closeButton);
    captionLayout.setExpandRatio(windowCaption, 1.0F);
    captionLayout.addStyleName("v-window-header");
    return captionLayout;
}

From source file:org.eclipse.hawkbit.ui.common.AbstractMetadataPopupLayout.java

License:Open Source License

private void buildLayout() {
    final HorizontalLayout headerLayout = new HorizontalLayout();
    headerLayout.addStyleName(SPUIStyleDefinitions.WIDGET_TITLE);
    headerLayout.setSpacing(false);/*from   w w w.ja v  a 2 s .  c o  m*/
    headerLayout.setMargin(false);
    headerLayout.setSizeFull();
    headerLayout.addComponent(headerCaption);
    if (hasCreatePermission()) {
        headerLayout.addComponents(addIcon);
        headerLayout.setComponentAlignment(addIcon, Alignment.MIDDLE_RIGHT);
    }
    headerLayout.setExpandRatio(headerCaption, 1.0F);

    final HorizontalLayout headerWrapperLayout = new HorizontalLayout();
    headerWrapperLayout
            .addStyleName("bordered-layout" + " " + "no-border-bottom" + " " + "metadata-table-margin");
    headerWrapperLayout.addComponent(headerLayout);
    headerWrapperLayout.setWidth("100%");
    headerLayout.setHeight("30px");

    final VerticalLayout tableLayout = new VerticalLayout();
    tableLayout.setSizeFull();
    tableLayout.setHeight("100%");
    tableLayout.addComponent(headerWrapperLayout);
    tableLayout.addComponent(metaDataGrid);
    tableLayout.addStyleName("table-layout");
    tableLayout.setExpandRatio(metaDataGrid, 1.0F);

    final VerticalLayout metadataFieldsLayout = createMetadataFieldsLayout();

    mainLayout = new HorizontalLayout();
    mainLayout.addComponent(tableLayout);
    mainLayout.addComponent(metadataFieldsLayout);
    mainLayout.setExpandRatio(tableLayout, 0.5F);
    mainLayout.setExpandRatio(metadataFieldsLayout, 0.5F);
    mainLayout.setSizeFull();
    mainLayout.setSpacing(true);
    setCompositionRoot(mainLayout);
    setSizeFull();
}

From source file:org.eclipse.hawkbit.ui.common.ConfirmationDialog.java

License:Open Source License

/**
 * Constructor for configuring confirmation dialog.
 * //from  ww  w.  ja  v a2  s  .  c om
 * @param caption
 *            the dialog caption.
 * @param question
 *            the question.
 * @param okLabel
 *            the Ok button label.
 * @param cancelLabel
 *            the cancel button label.
 * @param callback
 *            the callback.
 * @param icon
 *            the icon of the dialog
 * @param id
 *            the id of the confirmation dialog
 * @param tab
 *            ConfirmationTab which contains more information about the
 *            action which has to be confirmed, e.g. maintenance window
 * @param mapCloseToCancel
 *            Flag indicating whether or not the close event on the
 *            enclosing window should be mapped to a cancel event.
 */
public ConfirmationDialog(final String caption, final String question, final String okLabel,
        final String cancelLabel, final ConfirmationDialogCallback callback, final Resource icon,
        final String id, final ConfirmationTab tab, final boolean mapCloseToCancel) {
    window = new Window(caption);
    if (!StringUtils.isEmpty(id)) {
        window.setId(id);
    }
    window.addStyleName(SPUIStyleDefinitions.CONFIRMATION_WINDOW_CAPTION);

    if (icon != null) {
        window.setIcon(icon);
    }

    okButton = createOkButton(okLabel);

    final Button cancelButton = createCancelButton(cancelLabel);
    if (mapCloseToCancel) {
        window.addCloseListener(e -> {
            if (!isImplicitClose) {
                cancelButton.click();
            }
        });
    }
    window.setModal(true);
    window.addStyleName(SPUIStyleDefinitions.CONFIRMBOX_WINDOW_STYLE);
    if (this.callback == null) {
        this.callback = callback;
    }
    final VerticalLayout vLayout = new VerticalLayout();
    if (question != null) {
        vLayout.addComponent(createConfirmationQuestion(question));
    }
    if (tab != null) {
        vLayout.addComponent(tab);
    }

    final HorizontalLayout hButtonLayout = createButtonLayout(cancelButton);
    hButtonLayout.addStyleName("marginTop");
    vLayout.addComponent(hButtonLayout);
    vLayout.setComponentAlignment(hButtonLayout, Alignment.BOTTOM_CENTER);

    window.setContent(vLayout);
    window.setResizable(false);
}

From source file:org.eclipse.hawkbit.ui.common.grid.AbstractGridHeader.java

License:Open Source License

private static HorizontalLayout createHeaderFilterIconLayout() {
    final HorizontalLayout titleFilterIconsLayout = new HorizontalLayout();
    titleFilterIconsLayout.addStyleName(SPUIStyleDefinitions.WIDGET_TITLE);
    titleFilterIconsLayout.setSpacing(false);
    titleFilterIconsLayout.setMargin(false);
    titleFilterIconsLayout.setSizeFull();
    return titleFilterIconsLayout;
}

From source file:org.eclipse.hawkbit.ui.common.table.AbstractTableHeader.java

License:Open Source License

private void buildLayout() {
    final HorizontalLayout titleFilterIconsLayout = createHeaderFilterIconLayout();

    titleFilterIconsLayout.addComponents(headerCaption, searchField, searchResetIcon, showFilterButtonLayout);
    titleFilterIconsLayout.setComponentAlignment(headerCaption, Alignment.TOP_LEFT);
    titleFilterIconsLayout.setComponentAlignment(searchField, Alignment.TOP_RIGHT);
    titleFilterIconsLayout.setComponentAlignment(searchResetIcon, Alignment.TOP_RIGHT);
    titleFilterIconsLayout.setComponentAlignment(showFilterButtonLayout, Alignment.TOP_RIGHT);
    if (hasCreatePermission() && isAddNewItemAllowed()) {
        titleFilterIconsLayout.addComponent(addIcon);
        titleFilterIconsLayout.setComponentAlignment(addIcon, Alignment.TOP_RIGHT);
    }/*  w w w.jav a  2  s.com*/
    if (hasCreatePermission() && isBulkUploadAllowed()) {
        titleFilterIconsLayout.addComponent(bulkUploadIcon);
        titleFilterIconsLayout.setComponentAlignment(bulkUploadIcon, Alignment.TOP_RIGHT);
    }
    titleFilterIconsLayout.addComponent(maxMinIcon);
    titleFilterIconsLayout.setComponentAlignment(maxMinIcon, Alignment.TOP_RIGHT);
    titleFilterIconsLayout.setExpandRatio(headerCaption, 0.4F);
    titleFilterIconsLayout.setExpandRatio(searchField, 0.6F);

    addComponent(titleFilterIconsLayout);

    final HorizontalLayout dropHintDropFilterLayout = new HorizontalLayout();
    dropHintDropFilterLayout.addStyleName("filter-drop-hint-layout");
    dropHintDropFilterLayout.setWidth(100, Unit.PERCENTAGE);
    if (isDropFilterRequired()) {
        filterDroppedInfo = new HorizontalLayout();
        filterDroppedInfo.setImmediate(true);
        filterDroppedInfo.setStyleName("target-dist-filter-info");
        filterDroppedInfo.setHeightUndefined();
        filterDroppedInfo.setSizeUndefined();
        displayFilterDropedInfoOnLoad();
        final DragAndDropWrapper dropFilterLayout = new DragAndDropWrapper(filterDroppedInfo);
        dropFilterLayout.setId(getDropFilterId());
        dropFilterLayout.setDropHandler(getDropFilterHandler());

        dropHintDropFilterLayout.addComponent(dropFilterLayout);
        dropHintDropFilterLayout.setComponentAlignment(dropFilterLayout, Alignment.TOP_CENTER);
        dropHintDropFilterLayout.setExpandRatio(dropFilterLayout, 1.0F);
    }
    addComponent(dropHintDropFilterLayout);
    setComponentAlignment(dropHintDropFilterLayout, Alignment.TOP_CENTER);
    addStyleName("bordered-layout");
    addStyleName("no-border-bottom");
}

From source file:org.eclipse.hawkbit.ui.login.AbstractHawkbitLoginUI.java

License:Open Source License

protected Component buildFields() {
    final HorizontalLayout fields = new HorizontalLayout();
    fields.setSpacing(true);/*from  w  w w.  j  a  v  a  2s . c o m*/
    fields.addStyleName("fields");
    buildTenantField();
    buildUserField();
    buildPasswordField();
    buildSignInButton();
    if (multiTenancyIndicator.isMultiTenancySupported()) {
        fields.addComponents(tenant, username, password, signIn);
    } else {
        fields.addComponents(username, password, signIn);
    }
    fields.setComponentAlignment(signIn, Alignment.BOTTOM_LEFT);
    signIn.addClickListener(event -> handleLogin());

    return fields;
}

From source file:org.eclipse.hawkbit.ui.login.AbstractHawkbitLoginUI.java

License:Open Source License

private Component buildDisclaimer() {
    final HorizontalLayout fields = new HorizontalLayout();
    fields.setSpacing(true);/*w w w . j  a  v  a2s .  c o  m*/
    fields.addStyleName("disclaimer");

    final Label disclaimer = new Label(uiProperties.getDemo().getDisclaimer(), ContentMode.HTML);
    disclaimer.setCaption(i18n.getMessage("label.login.disclaimer"));
    disclaimer.setIcon(FontAwesome.EXCLAMATION_CIRCLE);
    disclaimer.setId("login-disclaimer");
    disclaimer.setWidth("525px");

    fields.addComponent(disclaimer);

    return fields;
}

From source file:org.eclipse.hawkbit.ui.login.AbstractHawkbitLoginUI.java

License:Open Source License

protected Component buildLinks() {

    final HorizontalLayout links = new HorizontalLayout();
    links.setSpacing(true);/*from ww  w  .  j a v  a  2s  . co  m*/
    links.addStyleName("links");
    final String linkStyle = "v-link";

    if (!uiProperties.getLinks().getDocumentation().getRoot().isEmpty()) {
        final Link docuLink = SPUIComponentProvider.getLink(UIComponentIdProvider.LINK_DOCUMENTATION,
                i18n.getMessage("link.documentation.name"),
                uiProperties.getLinks().getDocumentation().getRoot(), FontAwesome.QUESTION_CIRCLE, "_blank",
                linkStyle);
        links.addComponent(docuLink);
        docuLink.addStyleName(ValoTheme.LINK_SMALL);
    }

    if (!uiProperties.getLinks().getRequestAccount().isEmpty()) {
        final Link requestAccountLink = SPUIComponentProvider.getLink(UIComponentIdProvider.LINK_REQUESTACCOUNT,
                i18n.getMessage("link.requestaccount.name"), uiProperties.getLinks().getRequestAccount(),
                FontAwesome.SHOPPING_CART, "", linkStyle);
        links.addComponent(requestAccountLink);
        requestAccountLink.addStyleName(ValoTheme.LINK_SMALL);
    }

    if (!uiProperties.getLinks().getUserManagement().isEmpty()) {
        final Link userManagementLink = SPUIComponentProvider.getLink(UIComponentIdProvider.LINK_USERMANAGEMENT,
                i18n.getMessage("link.usermanagement.name"), uiProperties.getLinks().getUserManagement(),
                FontAwesome.USERS, "_blank", linkStyle);
        links.addComponent(userManagementLink);
        userManagementLink.addStyleName(ValoTheme.LINK_SMALL);
    }

    return links;
}