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:probe.com.view.body.welcomelayout.PublicationsInformationWindow.java

private VerticalLayout initPublicationLayout(Object[] publicationData) {

    VerticalLayout publicationlayout = new VerticalLayout();
    publicationlayout.setWidth("500px");
    publicationlayout.setHeightUndefined();
    publicationlayout.setSpacing(true);// w w w  . java2 s  . c  om
    publicationlayout.setMargin(new MarginInfo(false, false, false, false));
    publicationlayout.setStyleName("publicationstyle");

    Label pubmedIdLabel = new Label(
            "<h5>Pubmed Id: <a href='http://www.ncbi.nlm.nih.gov/pubmed/" + publicationData[0].toString()
                    + "' target='_blank'  ><font style:'text-decoration:underline !important;'>"
                    + publicationData[0].toString() + "</font></a></h5>");
    pubmedIdLabel.setContentMode(ContentMode.HTML);
    publicationlayout.addComponent(pubmedIdLabel);
    pubmedIdLabel.setHeight("40px");

    Label proteinsNumLabel = new Label("<h5>#Proteins: " + publicationData[5].toString() + "</h5>");
    proteinsNumLabel.setDescription("Number of publication proteins " + publicationData[4].toString());
    proteinsNumLabel.setContentMode(ContentMode.HTML);
    publicationlayout.addComponent(proteinsNumLabel);
    proteinsNumLabel.setHeight("40px");

    Label uproteinsNumLabel = new Label(
            "<h5>#Publication Specific Proteins: " + publicationData[4].toString() + "</h5>");
    uproteinsNumLabel
            .setDescription("Number of publication specific proteins " + publicationData[4].toString());
    uproteinsNumLabel.setContentMode(ContentMode.HTML);
    publicationlayout.addComponent(uproteinsNumLabel);
    uproteinsNumLabel.setHeight("40px");

    Label PeptidesNumLabel = new Label("<h5>#Peptides: " + publicationData[7].toString() + "</h5>");
    PeptidesNumLabel.setContentMode(ContentMode.HTML);
    publicationlayout.addComponent(PeptidesNumLabel);
    PeptidesNumLabel.setDescription("Number of publication peptides " + publicationData[7].toString());
    PeptidesNumLabel.setHeight("40px");

    Label uPeptidesNumLabel = new Label(
            "<h5>#Publication Specific Peptides: " + publicationData[6].toString() + "</h5>");
    uPeptidesNumLabel.setContentMode(ContentMode.HTML);
    publicationlayout.addComponent(uPeptidesNumLabel);
    uPeptidesNumLabel
            .setDescription("Number of publication specific  peptides " + publicationData[6].toString());
    uPeptidesNumLabel.setHeight("40px");

    Label titleLabel = new Label(
            "<textarea rows='5' cols='52' readonly >" + publicationData[3].toString() + "</textarea>");
    titleLabel.setContentMode(ContentMode.HTML);
    publicationlayout.addComponent(titleLabel);
    titleLabel.setHeight("100px");

    return publicationlayout;

}

From source file:probe.com.view.body.welcomelayout.StudiesInformationWindow.java

public StudiesInformationWindow(Set<QuantDatasetObject> dsObjects, Map<String, String> diseaseHashedColorMap) {

    int height = Page.getCurrent().getBrowserWindowHeight() - 100;
    int width = Page.getCurrent().getBrowserWindowWidth() - 100;
    VerticalLayout popupBody = new VerticalLayout();
    popupBody.setWidth((width - 20) + "px");
    popupBody.setHeightUndefined();/*from w  w w . j a v a  2s  .c o  m*/
    popupBody.setStyleName(Reindeer.LAYOUT_WHITE);
    popupBody.setMargin(true);
    popupBody.setSpacing(true);

    popupWindow = new Window() {

        @Override
        public void close() {
            popupWindow.setVisible(false);

        }

    };

    popupWindow.setContent(popupBody);
    popupWindow.setWindowMode(WindowMode.NORMAL);
    popupWindow.setWidth((width) + "px");
    popupWindow.setHeight((height) + "px");
    popupWindow.setVisible(false);
    popupWindow.setResizable(false);
    popupWindow.setClosable(false);
    popupWindow.setStyleName(Reindeer.WINDOW_LIGHT);
    popupWindow.setModal(true);
    popupWindow.setDraggable(false);
    popupWindow.center();

    popupWindow.setCaption(
            "<font color='gray' style='font-weight: bold;!important'>&nbsp;&nbsp;Datasets Information</font>");

    UI.getCurrent().addWindow(popupWindow);
    popupWindow.center();

    popupWindow.setCaptionAsHtml(true);
    popupWindow.setClosable(true);
    this.addLayoutClickListener(StudiesInformationWindow.this);

    Map<Integer, DatasetInformationOverviewLayout> datasetInfoLayoutDSIndexMap = new HashMap<Integer, DatasetInformationOverviewLayout>();
    for (QuantDatasetObject quantDs : dsObjects) {
        DatasetInformationOverviewLayout datasetInfoLayout = new DatasetInformationOverviewLayout(width - 40,
                diseaseHashedColorMap);
        datasetInfoLayout.updateDatasetForm(quantDs);
        //                datasetInfoLayout.setWidth(width-40+"px");
        datasetInfoLayoutDSIndexMap.put(quantDs.getDsKey(), datasetInfoLayout);

    }

    StudyPopupLayout studiesPopupLayout = new StudyPopupLayout(datasetInfoLayoutDSIndexMap);

    popupBody.addComponent(studiesPopupLayout);
    popupBody.setComponentAlignment(studiesPopupLayout, Alignment.TOP_CENTER);
    studiesPopupLayout.setInformationData(dsObjects);

}

From source file:probe.com.view.core.InfoPopupBtn.java

public InfoPopupBtn(String infoText) {
    HorizontalLayout topLayout = new HorizontalLayout();
    VerticalLayout mainBody = new VerticalLayout();
    mainBody.setWidth("450px");
    mainBody.addComponent(topLayout);/*from   www.  j  a v  a2  s .c  o m*/
    Label infoHeaderLabel = new Label(
            "<h3 style='font-family:verdana;color:black;font-weight:bold;margin-left:20px;margin-right:20px;'>Information</h3>");
    infoHeaderLabel.setContentMode(ContentMode.HTML);
    topLayout.addComponent(infoHeaderLabel);
    topLayout.setWidth("100%");
    Label infoLable = new Label(
            "<div style='text-align:justify;text-justify:inter-word;'><p  style='line-height:60px; font-family:verdana;color:black;margin-left:20px;margin-right:20px;'>"
                    + infoText + "</p></div>");
    infoLable.setContentMode(ContentMode.HTML);
    infoLable.setWidth("450px");
    mainBody.addComponent(infoLable);
    popupBodyLayout.addComponent(mainBody);
    mainBody.setStyleName("popupmainbody");
    VerticalLayout closeBtn = new VerticalLayout();
    closeBtn.setWidth("16px");
    closeBtn.setHeight("16px");
    closeBtn.setStyleName("defaultclosebtn");
    topLayout.addComponent(closeBtn);
    topLayout.setComponentAlignment(closeBtn, Alignment.TOP_RIGHT);
    popupLayout = new PopupView("", popupBodyLayout);
    this.setStyleName("infoicon");
    this.setWidth("16px");
    this.setHeight("16px");
    this.setDescription("Information");
    this.addLayoutClickListener(InfoPopupBtn.this);
    this.addComponent(popupLayout);
    this.popupLayout.setHideOnMouseOut(false);

    closeBtn.addLayoutClickListener(new LayoutEvents.LayoutClickListener() {

        @Override
        public void layoutClick(LayoutEvents.LayoutClickEvent event) {
            popupLayout.setPopupVisible(false);
        }
    });

}

From source file:probe.com.view.core.NotificationComponent.java

public NotificationComponent(String text, String uniqueID) {

    this.uniqueID = uniqueID;
    popupBody = new VerticalLayout();
    popupBody.setWidthUndefined();//setWidth((200) + "px");
    popupBody.setHeightUndefined();//setHeight((200) + "px");
    popupBody.setStyleName("notificationbody");
    popupBody.addLayoutClickListener(NotificationComponent.this);
    popup = new PopupView(null, popupBody) {

        @Override/*from   ww  w.  j ava 2  s  . c om*/
        public void setPopupVisible(boolean visible) {
            super.setPopupVisible(visible); //To change body of generated methods, choose Tools | Templates.
        }

        @Override
        public boolean isPopupVisible() {
            return super.isPopupVisible(); //To change body of generated methods, choose Tools | Templates.
        }

    };
    this.addComponent(popup);

    //        popupWindow = new Window() {
    //
    //            @Override
    //            public void close() {
    //                popupWindow.setVisible(false);
    //            }
    //
    //        };
    //
    //        popupWindow.setStyleName("notificationwindow");
    //        popupWindow.setCaption(null);
    //        popupWindow.setContent(popupBody);
    //        popupWindow.setWindowMode(WindowMode.NORMAL);
    //        popupWindow.setWidthUndefined();//.setWidth((200) + "px");
    //        popupWindow.setHeightUndefined();//setHeight((200) + "px");
    //        popupWindow.setVisible(false);
    //        popupWindow.setResizable(false);
    //        popupWindow.setClosable(false);
    //        popupWindow.setModal(false);
    //        popupWindow.setDraggable(false);
    //        popupWindow.setModal(false);
    //
    //        UI.getCurrent().addWindow(popupWindow);
    //        popupWindow.setPositionX(x);
    //        popupWindow.setPositionY(y);
    //
    //        popupWindow.setCaptionAsHtml(true);
    //        popupWindow.setClosable(false);
    popupBody.setMargin(true);
    popupBody.setSpacing(true);

    Label content = new Label("<center>" + text + "</center>");
    content.setStyleName("notificationtext");
    content.setContentMode(ContentMode.HTML);
    popupBody.addComponent(content);

    VerticalLayout footer = new VerticalLayout();
    footer.setStyleName("bubbletalkfooter");
    footer.setWidth("30px");
    footer.setHeight("20px");
    popupBody.addComponent(footer);
    popup.setHideOnMouseOut(false);
    popup.setStyleName("popupnotification");
    popupBody.addStyleName("slowinvisible");

}

From source file:probe.com.view.core.NotificationComponent1.java

public NotificationComponent1(int x, int y, String text, String uniqueID) {
    this.uniqueID = uniqueID;
    popupBody = new VerticalLayout();
    popupBody.setWidthUndefined();/*www.  j  a  v a 2s.  c  o  m*/
    ;//setWidth((200) + "px");
    popupBody.setHeightUndefined();
    ;//setHeight((200) + "px");
    popupBody.setStyleName("notificationbody");
    popupBody.addLayoutClickListener(NotificationComponent1.this);

    popupWindow = new Window() {

        @Override
        public void close() {
            popupWindow.setVisible(false);
        }

    };

    popupWindow.setStyleName("notificationwindow");
    popupWindow.setCaption(null);
    popupWindow.setContent(popupBody);
    popupWindow.setWindowMode(WindowMode.NORMAL);
    popupWindow.setWidthUndefined();//.setWidth((200) + "px");
    popupWindow.setHeightUndefined();//setHeight((200) + "px");
    popupWindow.setVisible(false);
    popupWindow.setResizable(false);
    popupWindow.setClosable(false);
    popupWindow.setModal(false);
    popupWindow.setDraggable(false);
    popupWindow.setModal(false);

    UI.getCurrent().addWindow(popupWindow);
    popupWindow.setPositionX(x);
    popupWindow.setPositionY(y);

    popupWindow.setCaptionAsHtml(true);
    popupWindow.setClosable(false);

    popupBody.setMargin(true);
    popupBody.setSpacing(true);

    Label content = new Label("<center>" + text + "</center>");
    content.setStyleName("notificationtext");
    content.setContentMode(ContentMode.HTML);
    popupBody.addComponent(content);

    VerticalLayout footer = new VerticalLayout();
    footer.setStyleName("bubbletalkfooter");
    footer.setWidth("30px");
    footer.setHeight("20px");
    popupBody.addComponent(footer);

}

From source file:probe.com.view.core.PopupInfoBtn.java

private VerticalLayout initPopupLayout(VerticalLayout popupLayout, String header) {
    VerticalLayout popupBodyWrapper = new VerticalLayout();
    popupBodyWrapper.setWidth("100%");
    popupBodyWrapper.setHeight("100%");
    VerticalLayout popupBodyLayout = new VerticalLayout();
    popupBodyLayout.setWidth((popupLayout.getWidth() + 2) + "px");
    popupBodyLayout.setHeightUndefined();
    popupBodyLayout.setStyleName("pupupbody");
    popupBodyLayout.setSpacing(true);//  w w  w.  j  av a2 s.  c  o  m
    HorizontalLayout titleLayout = new HorizontalLayout();
    titleLayout.setWidthUndefined();
    titleLayout.setHeight("40px");

    popupBodyLayout.addComponent(titleLayout);
    popupBodyLayout.addLayoutClickListener(this);

    Label label = new Label("<b>" + header + "</b>");
    label.setStyleName("comparisonHeaders");
    label.setContentMode(ContentMode.HTML);
    label.setWidth((popupLayout.getWidth() - 17) + "px");
    titleLayout.addComponent(label);

    VerticalLayout closeBtn = new VerticalLayout();
    closeBtn.setWidth("16px");
    closeBtn.setHeight("16px");
    closeBtn.setStyleName("closepanelbtn");
    closeBtn.addLayoutClickListener(this);
    titleLayout.addComponent(closeBtn);
    titleLayout.setComponentAlignment(closeBtn, Alignment.TOP_RIGHT);

    popupLayout.setMargin(true);
    popupLayout.setSpacing(true);
    popupBodyLayout.addComponent(popupLayout);
    popupBodyWrapper.addComponent(popupBodyLayout);
    popupBodyWrapper.setComponentAlignment(popupBodyLayout, Alignment.MIDDLE_CENTER);

    return popupBodyWrapper;

}

From source file:probe.com.view.core.SubTreeHideOnClick.java

/**
 *
 * @param title/*  www .  j a  v a 2  s .c o  m*/
 * @param fullBodyLayout
 * @param miniBodyLayout
 * @param view
 */
public SubTreeHideOnClick(String title, Layout fullBodyLayout, VerticalLayout miniBodyLayout, boolean view) {
    //       title= title.toLowerCase();
    this.setMargin(new MarginInfo(false, false, false, false));
    this.setWidth("100%");
    this.fullBodyLayout = fullBodyLayout;
    this.fullBodyLayout.setVisible(false);
    this.miniBodyLayout = miniBodyLayout;

    titleLayout = new HorizontalLayout();
    titleLayout.setHeight("20px");
    titleLayout.setSpacing(true);
    show = new ShowMiniLabel();
    show.setHeight("20px");
    titleLayout.addComponent(show);
    titleLayout.setComponentAlignment(show, Alignment.BOTTOM_LEFT);
    titleLayout.setMargin(true);

    filterstLabel = new Label(title);//"<h4  style='font-family:verdana;font-weight:bold;'><strong aligen='center' style='font-family:verdana;color:#00000;'>Searching Filters</strong></h4>");
    filterstLabel.setContentMode(ContentMode.HTML);

    filterstLabel.setStyleName("treeNodeLabel");
    filterstLabel.setHeight("20px");
    titleLayout.addComponent(filterstLabel);
    titleLayout.setComponentAlignment(filterstLabel, Alignment.TOP_RIGHT);
    titleLayout.addLayoutClickListener(SubTreeHideOnClick.this);
    this.addComponent(titleLayout);
    this.addComponent(this.fullBodyLayout);
    if (miniBodyLayout != null) {
        titleLayout.addComponent(this.miniBodyLayout);
        miniBodyLayout.setStyleName("treeValue");
        miniBodyLayout.addLayoutClickListener(SubTreeHideOnClick.this);
    }
    if (view) {
        this.showLayout();
    }
}

From source file:probe.com.view.core.TipGenerator.java

public VerticalLayout generateTipsBtn() {
    VerticalLayout tipsIcon = new VerticalLayout();
    tipsIcon.setWidth("16px");
    tipsIcon.setHeight("16px");
    tipsIcon.setDescription("Show tips");
    tipsIcon.setStyleName("tipbtn");
    tipsIcon.addLayoutClickListener(this);
    return tipsIcon;

}

From source file:probe.com.view.core.ToggleBtn.java

public ToggleBtn(String strBtn1Label, String strBtn2Label, String btn1Comment, String btn2Comment, int width) {

    final Label btn1CommentLabel = new Label(btn1Comment);
    btn1CommentLabel.setStyleName(Reindeer.LABEL_SMALL);
    btn1CommentLabel.setWidth("120px");
    final Label btn2CommentLabel = new Label(btn2Comment);
    btn2CommentLabel.setStyleName(Reindeer.LABEL_SMALL);
    btn2CommentLabel.setVisible(false);// w  ww . j a va  2  s.  c o m
    btn2CommentLabel.setWidth("120px");

    this.setSpacing(true);
    Label btn1Label = new Label(strBtn1Label);
    btn1Label.setStyleName(Reindeer.LABEL_SMALL);
    Label btn2Label = new Label(strBtn2Label);
    btn2Label.setStyleName(Reindeer.LABEL_SMALL);
    toggleSwichButton = new HorizontalLayout();
    toggleSwichButton.setStyleName("toggleleft");
    toggleSwichButton.setWidth("50px");
    toggleSwichButton.setHeight("15px");
    toggleSwichButton.addLayoutClickListener(new LayoutEvents.LayoutClickListener() {

        @Override
        public void layoutClick(LayoutEvents.LayoutClickEvent event) {
            if (toggleSwichButton.getStyleName().equalsIgnoreCase("toggleleft")) {
                toggleSwichButton.setStyleName("toggleright");
                btn1CommentLabel.setVisible(false);
                btn2CommentLabel.setVisible(true);
            } else {
                toggleSwichButton.setStyleName("toggleleft");
                btn1CommentLabel.setVisible(true);
                btn2CommentLabel.setVisible(false);
            }
        }
    });

    this.addComponent(btn1CommentLabel);//commentLabel
    this.setComponentAlignment(btn1CommentLabel, Alignment.TOP_LEFT);//commentLabel
    this.addComponent(btn2CommentLabel);//commentLabel
    this.setComponentAlignment(btn2CommentLabel, Alignment.TOP_LEFT);//commentLabel
    VerticalLayout spacer = new VerticalLayout();
    width = Math.max((width - 120 - 75 - 75 - 55), 1);
    spacer.setHeight("15px");
    spacer.setWidth(width + "px");
    spacer.setStyleName(Reindeer.LAYOUT_WHITE);
    this.addComponent(spacer);
    this.addComponent(btn1Label);
    this.addComponent(toggleSwichButton);
    this.addComponent(btn2Label);

}

From source file:se.natusoft.osgi.aps.apsadminweb.app.gui.vaadin.TabPanel.java

License:Open Source License

public TabPanel() {

    this.setSizeFull();
    this.setStyleName("asp-tabsheet");

    VerticalLayout aboutTabLayout = new VerticalLayout();
    aboutTabLayout.setStyleName("aps-tabsheet-tab");
    aboutTabLayout.setMargin(true);//from  ww w.j  a v a2s .  c  o m
    aboutTabLayout.setSizeFull();
    Label aboutText = new HTMLFileLabel("/html/about-admin-web.html", APSTheme.THEME,
            getClass().getClassLoader());
    aboutTabLayout.addComponent(aboutText);
    addTab(aboutTabLayout, "About", null).setDescription("Information about APS Admin Web tool.");
    // Create tab for each registered admin web.
    //refreshTabs();
}