Example usage for com.vaadin.ui VerticalLayout setStyleName

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

Introduction

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

Prototype

@Override
    public void setStyleName(String style) 

Source Link

Usage

From source file:org.agocontrol.site.viewlet.dashboard.EventPanel.java

License:Apache License

/**
 * Default constructor which constructs components.
 *//*from   w w  w. ja  v  a2s . c om*/
public EventPanel() {
    final VerticalLayout layout = new VerticalLayout();
    setCompositionRoot(layout);
    layout.setMargin(true);
    layout.setSpacing(true);
    layout.setSizeFull();
    layout.setStyleName(Reindeer.LAYOUT_WHITE);

    final Label title = new Label("Events");
    title.setIcon(getSite().getIcon("event"));
    title.setStyleName(Reindeer.LABEL_H2);
    layout.addComponent(title);
    layout.setExpandRatio(title, 0);

    final List<FieldDescriptor> fieldDescriptors = AgoControlSiteFields
            .getFieldDescriptors(org.agocontrol.model.Event.class);
    final List<FilterDescriptor> filterDefinitions = new ArrayList<FilterDescriptor>();

    final Site site = ((AgoControlSiteUI) UI.getCurrent()).getSite();
    final EntityManager entityManager = site.getSiteContext().getObject(EntityManager.class);
    container = new LazyEntityContainer<org.agocontrol.model.Event>(entityManager, true, false, false,
            org.agocontrol.model.Event.class, 50, new String[] { "created" }, new boolean[] { false },
            "eventId");

    ContainerUtil.addContainerProperties(container, fieldDescriptors);

    final Table table = new FormattingTable();
    grid = new Grid(table, container, false);
    layout.addComponent(grid);
    layout.setExpandRatio(grid, 1);

    grid.setFields(fieldDescriptors);
    grid.setFilters(filterDefinitions);
    //grid.setSizeUndefined();
    //grid.setSizeUndefined();

    table.setColumnCollapsed("eventId", true);
    table.setColumnCollapsed("modified", true);
    table.setColumnCollapsed("processed", true);
    table.setColumnCollapsed("processingError", true);

    final Company company = site.getSiteContext().getObject(Company.class);
    container.removeDefaultFilters();
    container.addDefaultFilter(new Compare.Equal("owner.companyId", company.getCompanyId()));
}

From source file:org.diretto.web.richwebclient.view.sections.ContactSection.java

License:Open Source License

@Override
public synchronized void addComponents() {
    if (!componentsAdded) {
        GridLayout mainLayout = new GridLayout(2, 1);
        addComponent(mainLayout);/*from   w ww  .j  ava2s  .  co m*/
        setExpandRatio(mainLayout, 1.0f);

        VerticalLayout contactDetailsLayout = new VerticalLayout();
        contactDetailsLayout.setStyleName(Reindeer.LAYOUT_BLACK);
        contactDetailsLayout.setWidth("280px");
        contactDetailsLayout.setMargin(true);
        contactDetailsLayout.setSpacing(true);

        contactDetailsLayout.addComponent(StyleUtils.getLabelH2("Contact Details"));
        contactDetailsLayout.addComponent(StyleUtils.getHorizontalLine());
        contactDetailsLayout.addComponent(StyleUtils.getLabelBold("Project Team"));
        contactDetailsLayout.addComponent(StyleUtils.getLabel("Benjamin Erb & Tobias Schlecht"));
        contactDetailsLayout.addComponent(StyleUtils.getHorizontalLine());
        contactDetailsLayout.addComponent(StyleUtils.getLabelBold("Address"));
        contactDetailsLayout
                .addComponent(StyleUtils.getLabel("Institute of Media Informatics, Ulm University"));
        contactDetailsLayout.addComponent(StyleUtils.getLabel("James-Franck-Ring, 89073 Ulm, Germany"));
        contactDetailsLayout.addComponent(StyleUtils.getHorizontalLine());
        contactDetailsLayout.addComponent(StyleUtils.getLabelBold("Project Website"));
        contactDetailsLayout
                .addComponent(new Link("www.diretto.org", new ExternalResource("http://www.diretto.org/")));
        contactDetailsLayout.addComponent(StyleUtils.getVerticalSpaceSmall());
        contactDetailsLayout.addComponent(StyleUtils.getLabelBold("GitHub Profile"));
        contactDetailsLayout.addComponent(
                new Link("github.com/diretto", new ExternalResource("https://github.com/diretto")));
        contactDetailsLayout.addComponent(StyleUtils.getVerticalSpaceSmall());
        contactDetailsLayout.addComponent(StyleUtils.getLabelBold("Twitter Account"));
        contactDetailsLayout.addComponent(new Link("twitter.com/diretto_project",
                new ExternalResource("http://twitter.com/diretto_project")));
        contactDetailsLayout.addComponent(StyleUtils.getHorizontalLine());
        contactDetailsLayout.addComponent(StyleUtils.getLabelBold("Email Address"));
        contactDetailsLayout.addComponent(
                new Link("diretto@googlegroups.com", new ExternalResource("mailto:diretto@googlegroups.com")));

        mainLayout.addComponent(contactDetailsLayout);

        VerticalLayout wrapperLayout = new VerticalLayout();
        wrapperLayout.setWidth("600px");
        wrapperLayout.setMargin(false, true, false, true);

        VerticalLayout termsOfUseLayout = new VerticalLayout();
        termsOfUseLayout.setWidth("520px");
        termsOfUseLayout.setMargin(true);
        termsOfUseLayout.setSpacing(true);

        termsOfUseLayout.addComponent(StyleUtils.getLabelH2("Terms of Use"));
        termsOfUseLayout.addComponent(StyleUtils.getHorizontalLine());
        termsOfUseLayout.addComponent(StyleUtils.getLabelBold("Terms"));
        termsOfUseLayout.addComponent(StyleUtils.getLabelHTML(
                "By accessing this website, you are agreeing to be bound by these website <i>Terms of Use</i>, all applicable laws and regulations, and agree that you are responsible for compliance with any applicable local laws. If you do not agree with any of these terms, you are prohibited from using or accessing this site. The materials contained in this web site are protected by applicable copyright and trade mark law."));
        termsOfUseLayout.addComponent(StyleUtils.getHorizontalLine());
        termsOfUseLayout.addComponent(StyleUtils.getLabelBold("Use License"));
        termsOfUseLayout.addComponent(StyleUtils.getLabelHTML(
                "Permission is granted to temporarily download one copy of the materials (information or software) on this website for personal, non-commercial transitory viewing only. This is the grant of a license, not a transfer of title, and under this license you may not:<br /><br />"
                        + "&bull;&nbsp;&nbsp;modify or copy the materials<br />"
                        + "&bull;&nbsp;&nbsp;use the materials for any commercial purpose, or for any public display<br />"
                        + "&bull;&nbsp;&nbsp;attempt to decompile or reverse engineer any software contained on this website<br />"
                        + "&bull;&nbsp;&nbsp;remove any copyright or other proprietary notations from the materials<br />"
                        + "&bull;&nbsp;&nbsp;transfer the materials to another person or any other server<br />"
                        + "<br />This license shall automatically terminate if you violate any of these restrictions and may be terminated by the <i>diretto</i> Project Team at any time. Upon terminating your viewing of these materials or upon the termination of this license, you must destroy any downloaded materials in your possession whether in electronic or printed format."));
        termsOfUseLayout.addComponent(StyleUtils.getHorizontalLine());
        termsOfUseLayout.addComponent(StyleUtils.getLabelBold("Disclaimer"));
        termsOfUseLayout.addComponent(StyleUtils.getLabelHTML(
                "The materials on this website are provided <i>as is</i>. The <i>diretto</i> Project Team makes no warranties, expressed or implied, and hereby disclaims and negates all other warranties, including without limitation, implied warranties or conditions of merchantability, fitness for a particular purpose, or non-infringement of intellectual property or other violation of rights. Further, the <i>diretto</i> Project Team does not warrant or make any representations concerning the accuracy, likely results, or reliability of the use of the materials on its Internet website or otherwise relating to such materials or on any sites linked to this site."));
        termsOfUseLayout.addComponent(StyleUtils.getHorizontalLine());
        termsOfUseLayout.addComponent(StyleUtils.getLabelBold("Limitations"));
        termsOfUseLayout.addComponent(StyleUtils.getLabelHTML(
                "In no event shall the <i>diretto</i> Project Team be liable for any damages (including, without limitation, damages for loss of data or profit, or due to business interruption) arising out of the use or inability to use the materials on this website, even if the <i>diretto</i> Project Team has been notified orally or in writing of the possibility of such damage. Because some jurisdictions do not allow limitations on implied warranties, or limitations of liability for consequential or incidental damages, these limitations may not apply to you. "));
        termsOfUseLayout.addComponent(StyleUtils.getHorizontalLine());
        termsOfUseLayout.addComponent(StyleUtils.getLabelBold("Revisions and Errata"));
        termsOfUseLayout.addComponent(StyleUtils.getLabelHTML(
                "The materials appearing on this website could include technical, typographical, or photographic errors. The <i>diretto</i> Project Team does not warrant that any of the materials on its website are accurate, complete, or current. The <i>diretto</i> Project Team may make changes to the materials contained on its website at any time without notice. The <i>diretto</i> Project Team does not, however, make any commitment to update the materials. "));
        termsOfUseLayout.addComponent(StyleUtils.getHorizontalLine());
        termsOfUseLayout.addComponent(StyleUtils.getLabelBold("Links"));
        termsOfUseLayout.addComponent(StyleUtils.getLabelHTML(
                "The <i>diretto</i> Project Team has not reviewed all of the sites linked to its Internet website and is not responsible for the contents of any such linked site. The inclusion of any link does not imply endorsement by the <i>diretto</i> Project Team of the site. Use of any such linked website is at the user's own risk. "));
        termsOfUseLayout.addComponent(StyleUtils.getHorizontalLine());
        termsOfUseLayout.addComponent(StyleUtils.getLabelBold("Site Terms of Use Modifications"));
        termsOfUseLayout.addComponent(StyleUtils.getLabelHTML(
                "The <i>diretto</i> Project Team may revise these terms of use for its website at any time without notice. By using this website you are agreeing to be bound by the then current version of these <i>Terms of Use</i>."));
        termsOfUseLayout.addComponent(StyleUtils.getHorizontalLine());
        termsOfUseLayout.addComponent(StyleUtils.getLabelBold("Governing Law"));
        termsOfUseLayout.addComponent(StyleUtils.getLabelHTML(
                "Any claim relating to this website shall be governed by the laws of <i>Germany</i> without regard to its conflict of law provisions. General terms and conditions are applicable to the use of this website."));

        wrapperLayout.addComponent(termsOfUseLayout);
        wrapperLayout.setComponentAlignment(termsOfUseLayout, Alignment.TOP_CENTER);
        mainLayout.addComponent(wrapperLayout);

        componentsAdded = true;
    }
}

From source file:org.eclipse.hawkbit.ui.AbstractHawkbitUI.java

License:Open Source License

@Override
protected void init(final VaadinRequest vaadinRequest) {
    LOG.info("ManagementUI init starts uiid - {}", getUI().getUIId());
    if (pushStrategy != null) {
        pushStrategy.init(getUI());/*w  ww.  java  2s.  co m*/
    }
    addDetachListener(this);
    SpringContextHelper.setContext(context);

    Responsive.makeResponsive(this);
    addStyleName(ValoTheme.UI_WITH_MENU);
    setResponsive(Boolean.TRUE);

    final HorizontalLayout rootLayout = new HorizontalLayout();
    rootLayout.setSizeFull();

    HawkbitCommonUtil.initLocalization(this, uiProperties.getLocalization(), i18n);

    dashboardMenu.init();
    dashboardMenu.setResponsive(true);

    final VerticalLayout contentVerticalLayout = new VerticalLayout();
    contentVerticalLayout.setSizeFull();
    contentVerticalLayout.setStyleName("main-content");
    contentVerticalLayout.addComponent(buildHeader());
    contentVerticalLayout.addComponent(buildViewTitle());

    final Panel content = buildContent();
    contentVerticalLayout.addComponent(content);
    contentVerticalLayout.setExpandRatio(content, 1);

    rootLayout.addComponent(dashboardMenu);
    rootLayout.addComponent(contentVerticalLayout);
    rootLayout.setExpandRatio(contentVerticalLayout, 1);
    setContent(rootLayout);

    final Navigator navigator = new Navigator(this, content);
    navigator.addViewChangeListener(new ViewChangeListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public boolean beforeViewChange(final ViewChangeEvent event) {
            return true;
        }

        @Override
        public void afterViewChange(final ViewChangeEvent event) {
            final DashboardMenuItem view = dashboardMenu.getByViewName(event.getViewName());
            dashboardMenu.postViewChange(new PostViewChangeEvent(view));
            if (view == null) {
                viewTitle.setCaption(null);
                return;
            }
            viewTitle.setCaption(view.getDashboardCaptionLong());
            notificationUnreadButton.setCurrentView(event.getNewView());
        }
    });

    navigator.setErrorView(errorview);
    navigator.addProvider(new ManagementViewProvider());
    setNavigator(navigator);
    navigator.addView(EMPTY_VIEW, new Navigator.EmptyView());

    if (UI.getCurrent().getErrorHandler() == null) {
        UI.getCurrent().setErrorHandler(new HawkbitUIErrorHandler());
    }

    LOG.info("Current locale of the application is : {}", getLocale());
}

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

License:Open Source License

private VerticalLayout createDropAreaLayout() {
    final VerticalLayout dropAreaLayout = new VerticalLayout();
    final Label dropHereLabel = new Label(i18n.getMessage(UIMessageIdProvider.LABEL_DROP_AREA_UPLOAD));
    dropHereLabel.setWidth(null);// w  ww  . ja  va2s.  c om

    final Label dropIcon = new Label(FontAwesome.ARROW_DOWN.getHtml(), ContentMode.HTML);
    dropIcon.addStyleName("drop-icon");
    dropIcon.setWidth(null);

    dropAreaLayout.addComponent(dropIcon);
    dropAreaLayout.setComponentAlignment(dropIcon, Alignment.TOP_CENTER);
    dropAreaLayout.addComponent(dropHereLabel);
    dropAreaLayout.setComponentAlignment(dropHereLabel, Alignment.TOP_CENTER);

    uploadButtonLayout.setWidth(null);
    uploadButtonLayout.addStyleName("upload-button");
    dropAreaLayout.addComponent(uploadButtonLayout);
    dropAreaLayout.setComponentAlignment(uploadButtonLayout, Alignment.BOTTOM_CENTER);

    dropAreaLayout.setSizeFull();
    dropAreaLayout.setStyleName("upload-drop-area-layout-info");
    dropAreaLayout.setSpacing(false);
    return dropAreaLayout;
}

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

License:Open Source License

private static VerticalLayout createDropAreaLayout() {
    final VerticalLayout dropAreaLayout = new VerticalLayout();
    final Label dropHereLabel = new Label("Drop files to upload");
    dropHereLabel.setWidth(null);// w w  w .j ava 2  s .  c om

    final Label dropIcon = new Label(FontAwesome.ARROW_DOWN.getHtml(), ContentMode.HTML);
    dropIcon.addStyleName("drop-icon");
    dropIcon.setWidth(null);

    dropAreaLayout.addComponent(dropIcon);
    dropAreaLayout.setComponentAlignment(dropIcon, Alignment.BOTTOM_CENTER);
    dropAreaLayout.addComponent(dropHereLabel);
    dropAreaLayout.setComponentAlignment(dropHereLabel, Alignment.TOP_CENTER);
    dropAreaLayout.setSizeFull();
    dropAreaLayout.setStyleName("upload-drop-area-layout-info");
    dropAreaLayout.setSpacing(false);
    return dropAreaLayout;
}

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

License:Open Source License

/**
 * Layouts header, grid and optional footer.
 *///from   w  ww. ja  v a 2  s.c  o m
protected void buildLayout() {
    setSizeFull();
    setSpacing(true);
    setMargin(false);
    setStyleName("group");
    final VerticalLayout gridHeaderLayout = new VerticalLayout();
    gridHeaderLayout.setSizeFull();
    gridHeaderLayout.setSpacing(false);
    gridHeaderLayout.setMargin(false);

    gridHeaderLayout.setStyleName("table-layout");
    gridHeaderLayout.addComponent(gridHeader);

    gridHeaderLayout.setComponentAlignment(gridHeader, Alignment.TOP_CENTER);
    gridHeaderLayout.addComponent(grid);
    gridHeaderLayout.setComponentAlignment(grid, Alignment.TOP_CENTER);
    gridHeaderLayout.setExpandRatio(grid, 1.0F);

    addComponent(gridHeaderLayout);
    setComponentAlignment(gridHeaderLayout, Alignment.TOP_CENTER);
    setExpandRatio(gridHeaderLayout, 1.0F);
    if (hasFooterSupport()) {
        final Layout footerLayout = getFooterSupport().createFooterMessageComponent();
        addComponent(footerLayout);
        setComponentAlignment(footerLayout, Alignment.BOTTOM_CENTER);
    }

}

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

License:Open Source License

private void buildLayout() {
    setSizeFull();//from www. j a  v a 2s  .  c o  m
    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);
    tableHeaderLayout.addComponent(grid);
    tableHeaderLayout.setComponentAlignment(grid, Alignment.TOP_CENTER);
    tableHeaderLayout.setExpandRatio(grid, 1.0f);

    addComponent(tableHeaderLayout);
    setComponentAlignment(tableHeaderLayout, Alignment.TOP_CENTER);
    setExpandRatio(tableHeaderLayout, 1.0f);
    if (hasCountMessage()) {
        final HorizontalLayout rolloutGroupTargetsCountLayout = createCountMessageComponent();
        addComponent(rolloutGroupTargetsCountLayout);
        setComponentAlignment(rolloutGroupTargetsCountLayout, Alignment.BOTTOM_CENTER);
    }

}

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

License:Open Source License

private void buildLayout() {
    setSizeFull();/*from w  ww  .ja va2s . c o m*/
    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);
}

From source file:org.eclipse.hawkbit.ui.filtermanagement.FilterManagementView.java

License:Open Source License

private void buildFilterDetailOrCreateView() {
    removeAllComponents();/*  ww w .  ja  va 2s  .  co  m*/
    final VerticalLayout tableHeaderLayout = new VerticalLayout();
    tableHeaderLayout.setSizeFull();
    tableHeaderLayout.setSpacing(false);
    tableHeaderLayout.setMargin(false);
    tableHeaderLayout.setStyleName("table-layout");
    tableHeaderLayout.addComponent(createNewFilterHeader);
    tableHeaderLayout.setComponentAlignment(createNewFilterHeader, Alignment.TOP_CENTER);
    tableHeaderLayout.addComponent(createNewFilterTable);
    tableHeaderLayout.setComponentAlignment(createNewFilterTable, Alignment.TOP_CENTER);
    tableHeaderLayout.setExpandRatio(createNewFilterTable, 1.0F);

    addComponent(tableHeaderLayout);
    setComponentAlignment(tableHeaderLayout, Alignment.TOP_CENTER);
    setExpandRatio(tableHeaderLayout, 1.0F);

    final HorizontalLayout targetsCountmessageLabelLayout = addTargetFilterMessageLabel();
    addComponent(targetsCountmessageLabelLayout);
    setComponentAlignment(targetsCountmessageLabelLayout, Alignment.BOTTOM_CENTER);

}

From source file:org.eclipse.hawkbit.ui.filtermanagement.FilterManagementView.java

License:Open Source License

private void viewListView() {
    removeAllComponents();//  ww  w .  ja va2 s  .c o  m
    final VerticalLayout tableListViewLayout = new VerticalLayout();
    tableListViewLayout.setSizeFull();
    tableListViewLayout.setSpacing(false);
    tableListViewLayout.setMargin(false);
    tableListViewLayout.setStyleName("table-layout");
    tableListViewLayout.addComponent(targetFilterHeader);
    tableListViewLayout.setComponentAlignment(targetFilterHeader, Alignment.TOP_CENTER);
    tableListViewLayout.addComponent(targetFilterTable);
    tableListViewLayout.setComponentAlignment(targetFilterTable, Alignment.TOP_CENTER);
    tableListViewLayout.setExpandRatio(targetFilterTable, 1.0F);
    addComponent(tableListViewLayout);
}