Example usage for com.vaadin.ui VerticalLayout setWidth

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

Introduction

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

Prototype

@Override
    public void setWidth(String width) 

Source Link

Usage

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   w  ww .  ja v  a2s  .  c  om*/
    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/* w  w  w  .j a v a  2 s .  c o m*/
        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();//from w  w  w.  j  ava2s  .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);/*ww w. j  a  va 2s.  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.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);//from w  ww.java2  s.  c  om
    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:qbic.vaadincomponents.MaxQuantComponent.java

License:Open Source License

public MaxQuantComponent(final MaxQuantModel model, WorkflowViewController wfController) {
    // model//from www  . j  a  va 2  s  . co  m
    this.model = model;
    controller = wfController;

    // view
    VerticalLayout mainLayout = new VerticalLayout();
    // mainLayout.setSpacing(true);
    tabs = new TabSheet();

    // http://141.61.102.17/maxquant_doku/doku.php?id=maxquant:manual:beginner
    // Filter for raw Files

    rawFiles = new SelectFileComponent(RAW_FILES_CAPTION, RAW_FILES_INFO, AVAILABLE_FILES_CAPTION,
            SELECTED_FILES_CAPTION, model.getDatasetBeans(), model.getRawFilesBeans());

    rawFiles.getDestination().setEditorEnabled(true);
    rawFiles.getDestination().getColumn("experiment").setEditable(false);
    rawFiles.getDestination().getColumn("file").setEditable(false);
    rawFiles.getDestination().setImmediate(true);

    tabs.addTab(rawFiles);
    groupSpecificParameterComponent = new GroupSpecificParameterComponent();
    tabs.addTab(groupSpecificParameterComponent);
    tabs.addTab(globalParameters());

    mainLayout.addComponent(tabs);

    start = new Button(BUTTON_START_CAPTION);
    mainLayout.addComponent(start);
    mainLayout.setWidth("100%");
    this.setCompositionRoot(mainLayout);

    // controller
    setLogic();
    bindGlobalParameters();
}

From source file:qbic.vaadincomponents.SelectFileComponent.java

License:Open Source License

public SelectFileComponent(String mainCaption, String info, String sourceCaption, String destinationCaption,
        BeanItemContainer<?> source, BeanItemContainer<?> destination) {
    setCaption(mainCaption);/*from   ww w .  j  a  v  a2 s.c o m*/

    VerticalLayout files = new VerticalLayout();
    files.setSpacing(true);

    // info label
    Label rawFilesInfo = new Label(info);
    rawFilesInfo.addStyleName(ValoTheme.LABEL_COLORED);
    files.addComponent(rawFilesInfo);
    files.setWidth("100%");

    // available files in openbis
    available = new Grid(source);
    available.setCaption(sourceCaption);
    available.setSelectionMode(SelectionMode.MULTI);

    // selected files for anaylsis
    selected = new Grid(destination);

    if (mainCaption.equals("Raw files")) {
        available.removeColumn("fullPath");
        available.removeColumn("openbisCode");
    }

    else if (mainCaption.equals("")) {
        available.removeColumn("name");
        available.removeColumn("path");
        selected.removeColumn("name");
        selected.removeColumn("path");
    }

    selected.setCaption(destinationCaption);
    selected.setSelectionMode(SelectionMode.MULTI);

    for (Grid.Column col : available.getColumns()) {
        col.setWidthUndefined();
    }

    // selectedFiles.set
    // buttons to add or remove files
    VerticalLayout buttons = new VerticalLayout();
    toLeft = new Button();
    toLeft.setIcon(FontAwesome.ARROW_LEFT);

    toRight = new Button();
    toRight.setIcon(FontAwesome.ARROW_RIGHT);
    buttons.addComponent(toRight);
    buttons.addComponent(toLeft);

    GridLayout grids = new GridLayout(3, 1);
    grids.setWidth("100%");

    // grids.setSpacing(true);
    grids.addComponent(available, 0, 0);

    available.setWidth("100%");
    grids.addComponent(buttons, 1, 0);
    grids.addComponent(selected, 2, 0);
    grids.setColumnExpandRatio(0, 0.45f);
    grids.setColumnExpandRatio(1, 0.029f);
    grids.setColumnExpandRatio(2, 0.45f);
    grids.setSpacing(false);
    grids.setComponentAlignment(buttons, com.vaadin.ui.Alignment.MIDDLE_CENTER);

    selected.setWidth("100%");

    files.addComponent(grids);

    this.setCompositionRoot(files);
    files.setMargin(new MarginInfo(true, true, true, false));
    this.setWidth("100%");

}

From source file:rs.pupin.jpo.esta_ld.DSDRepoComponent.java

public DSDRepoComponent(Repository repository, String dataGraph, String repoGraph) {
    this.repository = repository;
    this.dataGraph = dataGraph;
    this.repoGraph = repoGraph;

    initializeRepoGraph();/*  ww w  . ja v a 2 s.co m*/

    dcRepo = new SparqlDCRepository(repository);
    graph = new SparqlDCGraph(repository, dataGraph);

    VerticalLayout rootLayout = new VerticalLayout();
    rootLayout.setWidth("100%");
    rootLayout.setSpacing(true);

    mainLayout = new VerticalLayout();
    mainLayout.setWidth("100%");
    mainLayout.setSpacing(true);

    HorizontalLayout menuLayout = new HorizontalLayout();
    menuLayout.setSpacing(true);
    menuLayout.setWidth("100%");
    rootLayout.addComponent(menuLayout);

    final MenuBar menu = new MenuBar();
    menu.addStyleName("dsd");
    cmdFindDSD = new MenuBar.Command() {
        public void menuSelected(MenuBar.MenuItem selectedItem) {
            for (MenuBar.MenuItem item : menu.getItems()) {
                if (item == selectedItem) {
                    if (!item.getStyleName().contains("selected")) {
                        if (ds != null)
                            item.setStyleName("selected");
                        findDSDs();
                    }
                } else
                    item.setStyleName("bleja");
            }
        }
    };
    menu.addItem("Find Suitable DSDs", cmdFindDSD).setStyleName("bleja");
    cmdCreateDSD = new MenuBar.Command() {
        public void menuSelected(MenuBar.MenuItem selectedItem) {
            for (MenuBar.MenuItem item : menu.getItems()) {
                if (item == selectedItem) {
                    if (!item.getStyleName().contains("selected")) {
                        if (ds != null)
                            item.setStyleName("selected");
                        createDSD();
                    }
                } else
                    item.setStyleName("bleja");
            }
        }
    };
    menu.addItem("Create DSD", cmdCreateDSD).setStyleName("bleja");
    cmdStoreDSD = new MenuBar.Command() {
        public void menuSelected(MenuBar.MenuItem selectedItem) {
            for (MenuBar.MenuItem item : menu.getItems()) {
                if (item == selectedItem) {
                    if (!item.getStyleName().contains("selected")) {
                        if (ds != null)
                            item.setStyleName("selected");
                        storeDSD();
                    }
                } else
                    item.setStyleName("bleja");
            }
        }
    };
    menu.addItem("Store DSD", cmdStoreDSD).setStyleName("bleja");

    menuLayout.addComponent(menu);
    Label spaceLbl = new Label("");
    menuLayout.addComponent(spaceLbl);
    menuLayout.setExpandRatio(spaceLbl, 2.0f);
    Label lbl = new Label("Choose dataset: ");
    lbl.setSizeUndefined();
    menuLayout.addComponent(lbl);

    selectDataSet = new ComboBox(null, graph.getDataSets());
    selectDataSet.setImmediate(true);
    selectDataSet.setNewItemsAllowed(false);
    selectDataSet.setNullSelectionAllowed(false);
    selectDataSet.setWidth("300px");
    selectDataSet.addListener(new Property.ValueChangeListener() {
        public void valueChange(Property.ValueChangeEvent event) {
            ds = (DataSet) event.getProperty().getValue();
        }
    });
    menuLayout.addComponent(selectDataSet);

    rootLayout.addComponent(new Label("<hr/>", Label.CONTENT_XHTML));
    rootLayout.addComponent(mainLayout);

    setCompositionRoot(rootLayout);
}

From source file:rs.pupin.jpo.esta_ld.InspectComponent.java

public InspectComponent(Repository repository, String dataGraph, String dataset) {
    this.repository = repository;
    this.dataGraph = dataGraph;

    this.logger = Logger.getLogger(InspectComponent.class.getName());

    dcRepo = new SparqlDCRepository(repository);
    graph = new SparqlDCGraph(repository, dataGraph);
    ds = new SparqlDataSet(repository, dataset, dataGraph);

    VerticalLayout rootLayout = new VerticalLayout();
    rootLayout.setWidth("100%");
    rootLayout.setSpacing(true);// ww  w  . j  a  v  a 2s. c o m
    rootLayout.setMargin(false);

    mainLayout = new VerticalLayout();
    mainLayout.setWidth("100%");
    mainLayout.setSpacing(true);
    mainLayout.setMargin(false);

    rootLayout.addComponent(mainLayout);

    storeDSD();

    setCompositionRoot(rootLayout);
}