Example usage for com.vaadin.ui VerticalLayout addStyleName

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

Introduction

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

Prototype

@Override
    public void addStyleName(String style) 

Source Link

Usage

From source file:fr.amapj.view.views.common.gapviewer.WeekViewer.java

License:Open Source License

/**
 * @return // w  w  w .  j av  a2s. c  o  m
 * 
 */
public VerticalLayout getComponent() {
    VerticalLayout vl = new VerticalLayout();
    vl.setMargin(false);
    vl.setSpacing(false);
    vl.addStyleName("semaine-viewer");

    // Bandeau avec les boutons droit / gauche 
    HorizontalLayout hl1 = new HorizontalLayout();
    hl1.setWidth("100%");

    addButton(false, hl1, e -> reculer());

    Label empty = new Label();
    hl1.addComponent(empty);
    hl1.setExpandRatio(empty, 1.0f);

    addButton(true, hl1, e -> avancer());

    vl.addComponent(hl1);

    // Bandeau avec la date de la semaine visualise
    titre = new Label();
    hl1.addStyleName("titre");
    titre.setSizeUndefined();
    vl.addComponent(titre);
    vl.setComponentAlignment(titre, Alignment.MIDDLE_CENTER);

    updateTitreValue();

    return vl;

}

From source file:fr.amapj.view.views.common.semaineviewer.SemaineViewer.java

License:Open Source License

/**
 * @return /*from   w w  w .  j  a v  a 2 s. c  o  m*/
 * 
 */
public VerticalLayout getComponent() {
    VerticalLayout vl = new VerticalLayout();
    vl.setMargin(false);
    vl.setSpacing(false);
    vl.addStyleName("semaine-viewer");

    // Bandeau avec les boutons droit / gauche 
    HorizontalLayout hl1 = new HorizontalLayout();
    hl1.setWidth("100%");

    addButton(false, hl1, e -> reculer());

    Label empty = new Label();
    hl1.addComponent(empty);
    hl1.setExpandRatio(empty, 1.0f);

    addButton(true, hl1, e -> avancer());

    vl.addComponent(hl1);

    // Bandeau avec la date de la semaine visualise
    titre = new Label();
    hl1.addStyleName("titre");
    titre.setSizeUndefined();
    vl.addComponent(titre);
    vl.setComponentAlignment(titre, Alignment.MIDDLE_CENTER);

    return vl;

}

From source file:fr.amapj.view.views.permanence.grille.AbstractPeriodePermanenceGrillePart.java

License:Open Source License

protected void createContent(VerticalLayout contentLayout) {
    this.contentLayout = contentLayout;

    int widthRatio = BaseUiTools.isWidthBelow(1600) ? 100 : 80;
    String height = BaseUiTools.isWidthBelow(1600) ? "100%" : "90%";

    nbCol = computeNbCol(widthRatio);/*  ww w  . j av a  2  s  . c o m*/

    setHeight(height);
    setWidth(widthRatio);

    contentLayout.addStyleName("grille-permanence");

    drawContent();

}

From source file:fr.amapj.view.views.permanence.mespermanences.grille.InscriptionPopupRoleDifferent.java

License:Open Source License

protected void createContent(VerticalLayout contentLayout) {
    this.contentLayout = contentLayout;
    contentLayout.addStyleName("grille-permanence");

    refresh();/*from  w  ww .j av  a  2  s.  co m*/
}

From source file:info.magnolia.ui.mediaeditor.field.image.ImageMediaField.java

License:Open Source License

@Override
protected Component initContent() {
    addStyleName("image-media-field");
    setSizeFull();/*ww  w  .  j ava 2s  .c  o m*/
    VerticalLayout mediaContentWrapper = new VerticalLayout();
    mediaContentWrapper.addStyleName("media-wrapper");
    mediaContentWrapper.setSizeFull();
    fieldComponent = createImage();
    mediaContentWrapper.addComponent(fieldComponent);
    mediaContentWrapper.setComponentAlignment(fieldComponent, Alignment.MIDDLE_CENTER);
    return mediaContentWrapper;
}

From source file:infodoc.ui.module.help.AboutWindow.java

License:Open Source License

public AboutWindow() {
    super(InfodocConstants.uiAbout);
    addStyleName(InfodocTheme.WINDOW_OPAQUE);
    setIcon(new ThemeResource(InfodocTheme.iconAbout));
    setSizeUndefined();/* w  ww .  ja  va2s .  c  o  m*/
    setWidth("580px");
    setResizable(false);

    String installedModules = InfodocConstants.infodocModules.replace(" ", "");
    String installedModulesHtml = "";

    for (String module : installedModules.split(",")) {
        installedModulesHtml += "<span style='margin-left: 20px;'>" + module + "</span><br/>";
    }

    String top = "<h2><i>InfoDoc " + InfodocConstants.infodocVersion + "</i></h2>" + "Modules:" + "<pre><small>"
            + installedModulesHtml + "</small></pre>" + "<br/>License granted to:"
            + "<pre><small><span style='margin-left: 20px;'>" + InfodocConstants.infodocCompanyName + "</span>"
            + (InfodocConstants.infodocCompanyId == null ? ""
                    : "<br/><span style='margin-left: 20px;'> " + InfodocConstants.infodocCompanyId + "</span>")
            + (InfodocConstants.infodocCompanyAddress == null ? ""
                    : "<br/><span style='margin-left: 20px;'>" + InfodocConstants.infodocCompanyAddress
                            + "</span></pre></small>")
            + "<br/><br/>";

    String lower = "<br/>Contact the developer: <a href='" + InfodocConstants.infodocDeveloperUrl + "'>"
            + InfodocConstants.infodocDeveloperUrl + "</a>," + "<br/><b>All rights reserved</b>.";

    Label topLabel = new Label(top, Label.CONTENT_XHTML);
    Label lowerLabel = new Label(lower, Label.CONTENT_XHTML);
    lowerLabel.addStyleName(InfodocTheme.LABEL_TINY);

    VerticalLayout rightLayout = new VerticalLayout();
    rightLayout.setMargin(true);
    rightLayout.setStyleName(InfodocTheme.PANEL_LIGHT);
    rightLayout.addStyleName(InfodocTheme.PANEL_BORDERLESS);
    rightLayout.addStyleName(InfodocTheme.COOL_FONT);
    rightLayout.addComponent(topLabel);
    rightLayout.addComponent(lowerLabel);

    VerticalLayout leftLayout = new VerticalLayout();
    leftLayout.setWidth("130px");
    leftLayout.addComponent(new Label("<h2></h2>", Label.CONTENT_XHTML));
    leftLayout.addComponent(new Embedded(null, new ThemeResource(InfodocTheme.infodocBoxImage)));

    HorizontalLayout layout = new HorizontalLayout();
    layout.setSizeFull();
    layout.addComponent(leftLayout);
    layout.addComponent(rightLayout);
    layout.setExpandRatio(rightLayout, 1);

    Panel panel = new Panel();
    panel.addComponent(layout);

    setContent(panel);
}

From source file:it.vige.greenarea.bpm.custom.ui.form.dettagliopolicy.DettaglioPolicyField.java

License:Apache License

public DettaglioPolicyField(FormProperty formProperty,
        GreenareaAbstractFormPropertyRenderer<T> greenareaAbstractFormPropertyRenderer,
        FasciaOraria fasciaOraria) {//from ww  w  .  j  a v  a2  s .c  o m
    I18nManager i18nManager = get().getI18nManager();
    String caption = i18nManager.getMessage(DETTAGLIO_POLICY_TITLE);
    setSpacing(true);
    setCaption(caption);
    setHeight(Sizeable.SIZE_UNDEFINED, 0);
    validityLabel = new Label();
    validityLabel.setValue(i18nManager.getMessage(DETTAGLIO_POLICY_PERIODO_VALIDITA) + " "
            + (fasciaOraria != null ? fasciaOraria.getValidita() : ""));
    fasciaOrariaLabel = new Label();
    fasciaOrariaLabel.setValue(i18nManager.getMessage(DETTAGLIO_POLICY_FASCIA_ORARIA) + " "
            + (fasciaOraria != null ? fasciaOraria.getNome() : ""));
    VerticalLayout vLayout = new VerticalLayout();
    vLayout.addComponent(validityLabel);
    vLayout.addComponent(fasciaOrariaLabel);
    vLayout.setStyleName("dettaglio-policy-label");

    policyDetailsButton = new Button();
    final String dettaglioPolicy = i18nManager.getMessage(DETTAGLIO_POLICY_DETTAGLIO_POLICY);
    policyDetailsButton.setCaption(i18nManager.getMessage(DETTAGLIO_POLICY_BUTTON));
    final ParametriTable parametriTable = new ParametriTable(formProperty,
            greenareaAbstractFormPropertyRenderer.getGreenareaFormPropertiesForm());
    final PrezziTable prezziTable = new PrezziTable(formProperty,
            greenareaAbstractFormPropertyRenderer.getGreenareaFormPropertiesForm());
    policyDetailsButton.addListener(new ClickListener() {
        private static final long serialVersionUID = 1L;

        public void buttonClick(ClickEvent event) {
            PopupWindow window = new PopupWindow(dettaglioPolicy);
            VerticalLayout verticalLayout = new VerticalLayout();
            window.setContent(verticalLayout);
            verticalLayout.addComponent(parametriTable);
            verticalLayout.addComponent(parametriTable.createControls());
            verticalLayout.addComponent(prezziTable);
            verticalLayout.addComponent(prezziTable.createControls());
            verticalLayout.addStyleName("main-table");
            window.addListener(new SubmitEventListener() {
                private static final long serialVersionUID = 1L;

                @Override
                protected void submitted(SubmitEvent event) {

                }

                @Override
                protected void cancelled(SubmitEvent event) {
                }
            });
            window.setWidth(900, Sizeable.UNITS_PIXELS);
            window.setHeight(500, Sizeable.UNITS_PIXELS);
            window.setModal(true);
            window.center();
            get().getViewManager().showPopupWindow(window);
        }
    });

    addComponent(vLayout);

    addComponent(policyDetailsButton);

    // Invisible textfield, only used as wrapped field
    wrappedField = new TextField();
    wrappedField.setVisible(false);
    addComponent(wrappedField);
}

From source file:it.vige.greenarea.bpm.custom.ui.operatorelogistico.PerformanceMissioni.java

License:Apache License

private ChartComponent createChartComponent(String type) {
    ReportData report = new ReportData();
    // report.setTitle("Crediti di mobilit residui");
    List<Dataset> datasets = new ArrayList<Dataset>();
    report.setDatasets(datasets);//from  w w w  . ja  v a2  s  . c om
    Dataset dataset = new Dataset();
    dataset.setDescription("Crediti di mobilit residui");
    dataset.setType(type);

    @SuppressWarnings("unchecked")
    Map<String, Number> elencoAccessi = (Map<String, Number>) historicVariableInstance.getValue();
    @SuppressWarnings("unchecked")
    final Map<String, List<Missione>> elencoMissioni = (Map<String, List<Missione>>) historicVariableInstancePerMissioni
            .getValue();
    filtraPerOperatoreLogistico(elencoAccessi, elencoMissioni);

    dataset.setData(elencoAccessi);
    datasets.add(dataset);

    byte[] reportData = null;
    try {
        reportData = report.toString().getBytes("UTF-8");
    } catch (UnsupportedEncodingException e) {
        logger.error("errore conversione json", e);
    }
    final Map<String, Number> finalElencoAccessi = elencoAccessi;
    ChartComponent chart = ChartGenerator.generateChart(reportData);
    chart.setWidth(100, UNITS_PERCENTAGE);
    chart.setHeight(100, UNITS_PERCENTAGE);
    chart.addListener(new LayoutClickListener() {

        private static final long serialVersionUID = 5416440288386886066L;

        @Override
        public void layoutClick(LayoutClickEvent event) {
            String data = individuaData(event, finalElencoAccessi);
            List<Missione> missioni = elencoMissioni.get(data);
            I18nManager i18nManager = get().getI18nManager();
            PopupWindow window = new PopupWindow(
                    i18nManager.getMessage(PERFORMANCE_MISSIONI_POPUP) + " " + data);
            VerticalLayout verticalLayout = new VerticalLayout();
            window.setContent(verticalLayout);
            Panel numeroTotaleMissioni = new Panel();
            numeroTotaleMissioni
                    .addComponent(new Label(i18nManager.getMessage(PERFORMANCE_MISSIONI_NUMERO_TOTALE_MISSIONI)
                            + " " + missioni.size()));
            verticalLayout.addComponent(numeroTotaleMissioni);
            Map<Color, Integer> totaleRanking = calcoloTotaleRanking(elencoMissioni, data);
            Panel numeroRossi = new Panel();
            int totaleRossi = totaleRanking.get(ROSSO);
            numeroRossi.addComponent(new Label(i18nManager.getMessage(PERFORMANCE_MISSIONI_NUMERO_ROSSI) + " "
                    + totaleRossi + " - " + (double) totaleRossi / missioni.size() * 100 + "%"));
            verticalLayout.addComponent(numeroRossi);
            Panel numeroVerdi = new Panel();
            int totaleVerdi = totaleRanking.get(VERDE);
            numeroVerdi.addComponent(new Label(i18nManager.getMessage(PERFORMANCE_MISSIONI_NUMERO_VERDI) + " "
                    + totaleVerdi + " - " + (double) totaleVerdi / missioni.size() * 100 + "%"));
            verticalLayout.addComponent(numeroVerdi);
            Panel numeroGialli = new Panel();
            int totaleGialli = totaleRanking.get(GIALLO);
            numeroGialli.addComponent(new Label(i18nManager.getMessage(PERFORMANCE_MISSIONI_NUMERO_GIALLI) + " "
                    + totaleGialli + " - " + (double) totaleGialli / missioni.size() * 100 + "%"));
            verticalLayout.addComponent(numeroGialli);
            Panel totaleCreditiConsumati = new Panel();
            totaleCreditiConsumati.addComponent(
                    new Label(i18nManager.getMessage(PERFORMANCE_MISSIONI_TOTALE_CREDITI_CONSUMATI) + " "
                            + calcoloTotaleCreditiConsumati(finalElencoAccessi, data)));
            verticalLayout.addComponent(totaleCreditiConsumati);
            Panel bonus = new Panel();
            bonus.addComponent(new Label(i18nManager.getMessage(PERFORMANCE_MISSIONI_BONUS) + " " + 0));
            verticalLayout.addComponent(bonus);
            verticalLayout.addStyleName("main-table");
            window.addListener(new SubmitEventListener() {
                private static final long serialVersionUID = 1L;

                @Override
                protected void submitted(SubmitEvent event) {

                }

                @Override
                protected void cancelled(SubmitEvent event) {
                }
            });
            window.setWidth(450, Sizeable.UNITS_PIXELS);
            window.setHeight(450, Sizeable.UNITS_PIXELS);
            window.setModal(true);
            window.center();
            get().getViewManager().showPopupWindow(window);
        }
    });
    return chart;
}

From source file:jp.primecloud.auto.ui.LoadBalancerPanel.java

License:Open Source License

@Override
public void attach() {
    setSizeFull();/*  ww w  .  j a v  a  2  s  .c om*/
    addStyleName(Reindeer.PANEL_LIGHT);

    VerticalLayout layout = (VerticalLayout) getContent();
    layout.setSizeFull();
    layout.addStyleName("loadbalancer-tab");
    layout.setSpacing(false);
    layout.setMargin(false);

    // ?
    SplitPanel splitPanel = new SplitPanel();
    splitPanel.setOrientation(SplitPanel.ORIENTATION_VERTICAL);
    splitPanel.setSplitPosition(40);
    splitPanel.setSizeFull();
    layout.addComponent(splitPanel);

    // ?
    VerticalLayout upperLayout = new VerticalLayout();
    upperLayout.setSizeFull();
    upperLayout.setSpacing(false);
    upperLayout.setMargin(false);

    CssLayout upperTopLayout = new CssLayout();
    Label label = new Label(ViewProperties.getCaption("label.loadbalancer"));
    upperTopLayout.setWidth("100%");
    upperTopLayout.setMargin(true);
    upperTopLayout.addStyleName("loadbalancer-table-label");
    upperTopLayout.addComponent(label);
    upperTopLayout.setHeight("28px");
    upperLayout.addComponent(upperTopLayout);

    loadBalancerTable = new LoadBalancerTable(sender);
    loadBalancerTable.setContainerDataSource(new LoadBalancerDtoContainer());
    upperLayout.addComponent(loadBalancerTable);
    loadBalancerTable.addListener(new ValueChangeListener() {
        @Override
        public void valueChange(ValueChangeEvent event) {
            tableRowSelected(event);
        }
    });

    loadBalancerButtonsBottom = new LoadBalancerButtonsBottom(sender);
    upperLayout.addComponent(loadBalancerButtonsBottom);
    upperLayout.setExpandRatio(loadBalancerTable, 10);
    splitPanel.addComponent(upperLayout);

    // ?
    loadBalancerDesc = new LoadBalancerDesc(sender);
    splitPanel.addComponent(loadBalancerDesc);
}

From source file:jp.primecloud.auto.ui.MyCloudTabs.java

License:Open Source License

MyCloudTabs() {

    // ??///ww w. j  a va  2s  .  co  m
    String enableLoadBalancer = Config.getProperty("ui.enableLoadBalancer");
    this.enableLoadBalancer = (enableLoadBalancer == null) || (BooleanUtils.toBoolean(enableLoadBalancer));

    setSizeFull();

    // ??disable??????
    tabDesc.setSizeFull();
    tabDesc.setEnabled(false);
    tabDesc.addStyleName(Reindeer.TABSHEET_BORDERLESS);

    addStyleName(Reindeer.PANEL_LIGHT);

    VerticalLayout layout = (VerticalLayout) getContent();
    layout.setSizeFull();
    layout.setSpacing(false);
    layout.setMargin(false);

    //
    pnService.setSizeFull();
    pnService.addStyleName(Reindeer.PANEL_LIGHT);
    VerticalLayout vlService = (VerticalLayout) pnService.getContent();
    vlService.setSizeFull();
    vlService.addStyleName("service-tab");
    vlService.setSpacing(false);
    vlService.setMargin(false);

    //?
    SplitPanel splService = new SplitPanel();
    splService.setOrientation(SplitPanel.ORIENTATION_VERTICAL);
    splService.setSplitPosition(40);
    splService.setSizeFull();
    vlService.addComponent(splService);
    vlService.setExpandRatio(splService, 10);
    //?
    VerticalLayout layServiceUpper = new VerticalLayout();
    layServiceUpper.setSizeFull();
    layServiceUpper.setSpacing(false);
    layServiceUpper.setMargin(false);
    layServiceUpper.addComponent(serviceButtonsTop);
    layServiceUpper.addComponent(serviceTable);
    layServiceUpper.addComponent(serviceButtonsBottom);
    layServiceUpper.setExpandRatio(serviceTable, 10);
    splService.addComponent(layServiceUpper);
    //?
    splService.addComponent(serviceDesc);

    tabDesc.addTab(pnService, ViewProperties.getCaption("tab.service"), Icons.SERVICETAB.resource());

    //?
    pnServer.setSizeFull();
    pnServer.addStyleName(Reindeer.PANEL_LIGHT);
    VerticalLayout vlServer = (VerticalLayout) pnServer.getContent();
    vlServer.setSizeFull();
    vlServer.addStyleName("server-tab");
    vlServer.setSpacing(false);
    vlServer.setMargin(false);

    //?
    SplitPanel splServer = new SplitPanel();
    splServer.setOrientation(SplitPanel.ORIENTATION_VERTICAL);
    splServer.setSplitPosition(40);
    splServer.setSizeFull();
    vlServer.addComponent(splServer);
    //?
    VerticalLayout layServerUpper = new VerticalLayout();
    layServerUpper.setSizeFull();
    layServerUpper.setSpacing(false);
    layServerUpper.setMargin(false);
    layServerUpper.addComponent(serverButtonsTop);
    layServerUpper.addComponent(serverTable);
    layServerUpper.addComponent(serverButtonsBottom);
    layServerUpper.setExpandRatio(serverTable, 10);
    splServer.addComponent(layServerUpper);
    //?
    splServer.addComponent(serverDesc);

    tabDesc.addTab(pnServer, ViewProperties.getCaption("tab.server"), Icons.SERVERTAB.resource());

    //?
    pnLoadBalancer.setSizeFull();
    pnLoadBalancer.addStyleName(Reindeer.PANEL_LIGHT);
    VerticalLayout vlLBalancer = (VerticalLayout) pnLoadBalancer.getContent();
    vlLBalancer.setSizeFull();
    vlLBalancer.addStyleName("loadbalancer-tab");
    vlLBalancer.setSpacing(false);
    vlLBalancer.setMargin(false);

    CssLayout hLBalancer = new CssLayout();
    Label lLBalancer = new Label(ViewProperties.getCaption("label.loadbalancer"));
    hLBalancer.setWidth("100%");
    hLBalancer.setMargin(true);
    hLBalancer.addStyleName("loadbalancer-table-label");
    hLBalancer.addComponent(lLBalancer);
    hLBalancer.setHeight("28px");

    //?
    SplitPanel splLBalancer = new SplitPanel();
    splLBalancer.setOrientation(SplitPanel.ORIENTATION_VERTICAL);
    splLBalancer.setSplitPosition(40);
    splLBalancer.setSizeFull();
    vlLBalancer.addComponent(splLBalancer);
    //?
    VerticalLayout layLBUpper = new VerticalLayout();
    layLBUpper.setSizeFull();
    layLBUpper.setSpacing(false);
    layLBUpper.setMargin(false);
    layLBUpper.addComponent(hLBalancer);
    layLBUpper.addComponent(loadBalancerTable);
    layLBUpper.addComponent(loadBalancerTableOpe);
    layLBUpper.setExpandRatio(loadBalancerTable, 10);
    splLBalancer.addComponent(layLBUpper);
    //?
    splLBalancer.addComponent(loadBalancerDesc);

    if (this.enableLoadBalancer) {
        tabDesc.addTab(pnLoadBalancer, ViewProperties.getCaption("tab.loadbalancer"),
                Icons.LOADBALANCER_TAB.resource());
    }

    //
    tabDesc.addListener(TabSheet.SelectedTabChangeEvent.class, this, "selectedTabChange");
    layout.addComponent(tabDesc);

    Refresher timer = new Refresher();
    timer.setRefreshInterval(15 * 1000); //(msec)
    timer.addListener(new Refresher.RefreshListener() {
        @Override
        public void refresh(Refresher source) {
            if (needsRefresh()) {
                refreshTableOnly();
            }
        }
    });
    layout.addComponent(timer);
    layout.setExpandRatio(tabDesc, 100);

}