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.eclipse.hawkbit.ui.HawkbitUI.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());/*from  w  ww  .j av  a  2 s  .c  o  m*/
    }
    addDetachListener(this);
    SpringContextHelper.setContext(context);

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

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

    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());
    // set locale is required for I18N class also, to get the locale from
    // cookie
    final String locale = getLocaleId(SPUIDefinitions.getAvailableLocales());
    setLocale(new Locale(locale));

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

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

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

License:Open Source License

private VerticalLayout buildContent() {
    final VerticalLayout rootLayout = new VerticalLayout();
    rootLayout.setSizeFull();/*from  w  w w. j a  v a2s  .  c o  m*/
    rootLayout.setStyleName("main-content");

    rootLayout.addComponent(buildHeader());

    addLoginForm(rootLayout);

    addFooter(rootLayout);

    return rootLayout;
}

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

License:Open Source License

@Override
protected void init(final VaadinRequest request) {
    SpringContextHelper.setContext(context);

    final VerticalLayout rootLayout = new VerticalLayout();
    final Component header = buildHeader();

    rootLayout.addComponent(header);/*from  w ww .  j a  v a 2s.  c om*/
    rootLayout.setSizeFull();

    final HorizontalLayout content = new HorizontalLayout();
    rootLayout.addComponent(content);
    content.setStyleName("view-content");
    content.setSizeFull();
    rootLayout.setStyleName("main-content");

    rootLayout.setExpandRatio(header, 1.0F);
    rootLayout.setExpandRatio(content, 2.0F);
    final Resource resource = context
            .getResource("classpath:/VAADIN/themes/" + UI.getCurrent().getTheme() + "/layouts/footer.html");

    try (InputStream resourceStream = resource.getInputStream()) {
        final CustomLayout customLayout = new CustomLayout(resourceStream);
        customLayout.setSizeUndefined();
        rootLayout.addComponent(customLayout);
    } catch (final IOException ex) {
        LOG.error("Footer file cannot be loaded", ex);
    }
    setContent(rootLayout);

    final Navigator navigator = new Navigator(this, content);
    navigator.addProvider(viewProvider);
    setNavigator(navigator);
}

From source file:org.eclipse.skalli.view.internal.window.ProjectEditPanel.java

License:Open Source License

void renderContent(VerticalLayout content) {
    content.setStyleName(STYLE_EDIT_PROJECT_LAYOUT);
    headerCheckButton = renderButtons(content, true);
    renderProgessIndicator(content);/*from   w  w  w.  j  a  v  a2s  .  c  om*/
    headerLabel = renderMessageArea(content);
    renderPanels(content);
    footerLabel = renderMessageArea(content);
    footerCheckButton = renderButtons(content, false);
    renderPersistedIssues();
}

From source file:org.escidoc.browser.ui.maincontent.ItemView2.java

License:Open Source License

private VerticalLayout buildSidebar() {
    VerticalLayout sidebar = new VerticalLayout();
    sidebar.setStyleName(Reindeer.LAYOUT_BLUE);
    Panel properties = new Panel("Properties");
    final Label descMetadata1 = new Label("ID: " + resourceProxy.getId());

    status = resourceProxy.getType().getLabel() + " is ";
    lockStatus = status;/*from w  w  w  .  jav a 2s  .c  o m*/
    lblStatus = new Label(status + resourceProxy.getStatus(), Label.CONTENT_RAW);
    lblStatus.setDescription(ViewConstants.DESC_STATUS);

    lblLockstatus = new Label(status + resourceProxy.getLockStatus(), Label.CONTENT_RAW);
    lblLockstatus.setDescription(ViewConstants.DESC_LOCKSTATUS);
    if (controller.canUpdateItem()) {
        lblLockstatus.setStyleName("inset");
    }
    final Label descMetadata2 = new Label(ViewConstants.CREATED_BY + " " + resourceProxy.getCreator() + " on "
            + resourceProxy.getCreatedOn() + "<br/>" + ViewConstants.LAST_MODIFIED_BY + " "
            + resourceProxy.getModifier() + " on " + resourceProxy.getModifiedOn() + "<br/>" + "Released by "
            + resourceProxy.getReleasedBy() + " on " + resourceProxy.getLatestVersionModifiedOn(),
            Label.CONTENT_XHTML);

    properties.addComponent(descMetadata1);
    if (controller.canUpdateItem()) {
        status = "Latest status is ";
        lblCurrentVersionStatus = new Label(status + resourceProxy.getVersionStatus());
        lblCurrentVersionStatus.setDescription(ViewConstants.DESC_STATUS);
        lblCurrentVersionStatus.setStyleName("inset");
        properties.addComponent(lblCurrentVersionStatus);

    } else {
        properties.addComponent(lblStatus);
    }

    properties.addComponent(lblLockstatus);
    properties.addComponent(descMetadata2);

    sidebar.addComponent(properties);
    return sidebar;
}

From source file:org.escidoc.browser.ui.view.helpers.DirectMember.java

License:Open Source License

protected void createButtons() throws EscidocClientException {
    CssLayout cssLayout = headerButton();

    panel.addComponent(cssLayout);//from ww w .j av  a2 s  .co  m
    panel.setStyleName("directmembers");
    panel.setScrollable(true);

    final VerticalLayout panelLayout = (VerticalLayout) panel.getContent();
    panelLayout.setSizeUndefined();
    panelLayout.setWidth("100%");
    panelLayout.setStyleName(Runo.PANEL_LIGHT);
}

From source file:org.escidoc.browser.ui.view.helpers.DirectMember.java

License:Open Source License

protected void bindDirectMembersInTheContainer(final Component comptoBind) {
    final VerticalLayout panelLayout = (VerticalLayout) panel.getContent();
    panelLayout.addComponent(comptoBind);
    panelLayout.setExpandRatio(comptoBind, 1.0f);
    panelLayout.setStyleName(Runo.PANEL_LIGHT);
}

From source file:org.gpstouch.account.AccountGridView.java

public AccountGridView() {
    setSizeFull();/*w  w  w.  j a  v a2 s .co m*/
    addStyleName("crud-view");
    HorizontalLayout topLayout = createTopBar();

    grid = new AccountGrid();
    grid.addSelectionListener(new SelectionListener() {

        @Override
        public void select(SelectionEvent event) {
            viewLogic.rowSelected(grid.getSelectedRow());
        }
    });

    VerticalLayout barAndGridLayout = new VerticalLayout();
    barAndGridLayout.addComponent(topLayout);
    barAndGridLayout.addComponent(grid);
    barAndGridLayout.setMargin(true);
    barAndGridLayout.setSpacing(true);
    barAndGridLayout.setSizeFull();
    barAndGridLayout.setExpandRatio(grid, 1);
    barAndGridLayout.setStyleName("crud-main-layout");

    addComponent(barAndGridLayout);

    viewLogic.init();
}

From source file:org.hip.vif.admin.admin.ui.AbstractAdminView.java

License:Open Source License

protected VerticalLayout initLayout(final IMessages inMessages) {
    final VerticalLayout outLayout = new VerticalLayout();
    setCompositionRoot(outLayout);/*from  ww w  . j a v a 2  s  .  co m*/
    outLayout.setStyleName("vif-view"); //$NON-NLS-1$
    return outLayout;
}

From source file:org.hip.vif.admin.groupadmin.ui.AbstractContributionsProcessView.java

License:Open Source License

/** @param inTitle String
 * @return {@link VerticalLayout} */
protected VerticalLayout initComponent(final String inTitle) {
    final VerticalLayout outLayout = new VerticalLayout();
    setCompositionRoot(outLayout);/*from   w w  w.j a va2s . c om*/

    outLayout.setStyleName("vif-view"); //$NON-NLS-1$

    outLayout.addComponent(
            new Label(String.format(VIFViewHelper.TMPL_TITLE, "vif-pagetitle", inTitle), ContentMode.HTML)); //$NON-NLS-1$
    return outLayout;
}