Example usage for com.vaadin.ui VerticalLayout setSpacing

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

Introduction

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

Prototype

@Override
    public void setSpacing(boolean spacing) 

Source Link

Usage

From source file:de.unioninvestment.eai.portal.portlet.crud.export.ExportDialog.java

License:Apache License

@SuppressWarnings("serial")
private void init() {
    setCaption(Context.getMessage("portlet.crud.dialog.export.title"));
    setModal(true);// ww  w.ja  v a2s.c om
    setResizable(false);
    setWidth("400px");
    addCloseListener(new CloseListener() {
        @Override
        public void windowClose(CloseEvent e) {
            handleWindowCloseEvent();
        }
    });

    indicator = new ProgressBar(0.0f);
    indicator.setWidth("100%");
    UI.getCurrent().setPollInterval(1000);

    if (automaticDownload) {
        VerticalLayout layout = new VerticalLayout();
        layout.setMargin(true);
        layout.addComponent(indicator);

        setContent(layout);
    } else {
        HorizontalLayout layout = new HorizontalLayout();
        layout.setWidth("100%");
        layout.setMargin(true);
        layout.setSpacing(true);

        downloadLink = new Link();
        downloadLink.setStyleName(LiferayTheme.BUTTON_LINK);
        downloadLink.setCaption(Context.getMessage("portlet.crud.dialog.export.download"));
        downloadLink.setEnabled(false);

        layout.addComponents(indicator, downloadLink);
        layout.setComponentAlignment(indicator, Alignment.MIDDLE_CENTER);
        layout.setComponentAlignment(downloadLink, Alignment.MIDDLE_CENTER);
        layout.setExpandRatio(indicator, 1f);

        setContent(layout);
    }

}

From source file:de.unioninvestment.eai.portal.portlet.crud.mvp.views.configuration.DefaultPortletConfigurationView.java

License:Apache License

private VerticalLayout createStatusLayout() {

    status = new Label();
    status.setContentMode(ContentMode.HTML);

    upload = new Upload();
    upload.setImmediate(true);/*from   ww  w  .ja va2s  .co  m*/
    upload.setButtonCaption(getMessage("portlet.crud.page.upload.button"));

    uploadVcsUri = new TextField();
    uploadVcsUri.setWidth(400, Unit.PIXELS);
    uploadVcsButton = new Button();
    uploadVcsButton.setCaption(getMessage("portlet.crud.page.upload.vcs.button"));

    uploadVcsLayout.addComponent(uploadVcsButton);
    uploadVcsLayout.addComponent(uploadVcsUri);
    uploadVcsLayout.setSpacing(true);

    VerticalLayout statusLayout = new VerticalLayout();
    statusLayout.setCaption(getMessage("portlet.crud.page.edit.statusHeader"));
    statusLayout.setSpacing(true);
    statusLayout.setMargin(true);

    statusLayout.addComponent(status);
    statusLayout.addComponent(uploadVcsLayout);
    statusLayout.addComponent(upload);
    return statusLayout;
}

From source file:de.unioninvestment.eai.portal.portlet.crud.mvp.views.DefaultCollapsibleRegionView.java

License:Apache License

private AbstractOrderedLayout createContent() {
    VerticalLayout layout = new VerticalLayout();
    layout.setSizeFull();/*from ww w.  ja  va  2s.  c  o  m*/
    layout.setSpacing(true);

    return layout;
}

From source file:de.unioninvestment.eai.portal.portlet.crud.mvp.views.DefaultCompoundSearchView.java

License:Apache License

protected Component createSearchInfo() {
    Table table = createColumnInfoTable();

    Label syntaxReference = new Label(getMessage("portlet.crud.compoundsearch.syntaxReference"),
            ContentMode.HTML);/*from w  w w .  j ava2s.c o m*/

    VerticalLayout boxLayout = new VerticalLayout(table, syntaxReference);
    boxLayout.addStyleName("compsearchinfo");
    boxLayout.setWidth("350px");
    boxLayout.setSpacing(true);

    return boxLayout;
}

From source file:de.unioninvestment.eai.portal.portlet.crud.mvp.views.DefaultTextAreaView.java

License:Apache License

@Override
public void showEditor(String xhtml) {

    final RichTextArea richTextArea = new RichTextArea();
    richTextArea.setNullRepresentation("");
    richTextArea.setWidth("100%");
    richTextArea.setValue(xhtml);/*from   w  ww .j  a  v  a2 s .c  o m*/

    Button saveButton = new Button("Speichern", new Button.ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            String changedContent = (String) richTextArea.getValue();
            presenter.contentChanged(changedContent);
        }
    });

    Button cancelButton = new Button("Abbrechen", new Button.ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            presenter.cancelEditing();
        }
    });

    CssLayout buttons = new CssLayout(saveButton, cancelButton);
    buttons.setStyleName("actions");
    VerticalLayout layout = new VerticalLayout(richTextArea, buttons);
    layout.setSpacing(true);
    if (getHeight() >= 0f) {
        richTextArea.setHeight("100%");
        layout.setExpandRatio(richTextArea, 1f);
    }
    setCompositionRoot(layout);
}

From source file:de.unioninvestment.eai.portal.portlet.crud.mvp.views.ui.Popup.java

License:Apache License

private void init() {
    this.setModal(true);
    this.setHeight(325, Unit.PIXELS);
    this.setWidth(500, Unit.PIXELS);

    VerticalLayout layout = new VerticalLayout();
    layout.setSizeFull();// w  w w.  j  a va2  s .  c om
    layout.setSpacing(true);
    layout.setMargin(true);
    setContent(layout);

    Panel panel = new Panel();
    panel.setHeight(100, Unit.PERCENTAGE);
    panel.addStyleName(Runo.PANEL_LIGHT);
    layout.addComponent(panel);
    layout.setExpandRatio(panel, 1);

    messageLabel = new Label();
    panel.setContent(messageLabel);

    Button close = new Button("Beenden", new Button.ClickListener() {
        private static final long serialVersionUID = -8385641161488292715L;

        public void buttonClick(ClickEvent event) {
            UI.getCurrent().removeWindow(Popup.this);
        }
    });

    layout.addComponent(close);
    layout.setComponentAlignment(close, Alignment.BOTTOM_RIGHT);
}

From source file:de.uni_leipzig.informatik.pcai042.boa.gui.evaluation.EvaluationView.java

License:Open Source License

/**
 * Build content 'annotation process' of tab 2.
 * //  www .java  2s  .  c  o m
 * @return content of second tab
 */
private Layout buildTab2Content() {
    VerticalLayout tab2Content = new VerticalLayout();
    tab2Content.setSpacing(true);
    tab2Content.setMargin(true);
    tab2Content.setSizeFull();

    this.textAreaSentence = new TextArea("Sentence:");
    textAreaSentence.setImmediate(true);
    textAreaSentence.setRows(7);
    textAreaSentence.setWidth("100%");
    tab2Content.addComponent(textAreaSentence);

    HorizontalLayout hlay1 = new HorizontalLayout();
    this.buttonNew = new Button("New");
    buttonNew.setImmediate(true);
    buttonNew.setDescription("Type in new sentences");
    this.buttonAnnotate = new Button("Annotate");
    buttonAnnotate.setImmediate(true);
    buttonAnnotate.setDescription("Annotate the sentences above");
    hlay1.setSpacing(true);
    hlay1.setMargin(false);
    hlay1.addComponent(buttonNew);
    hlay1.addComponent(buttonAnnotate);
    tab2Content.addComponent(hlay1);

    this.listSelectAnnotation = new ListSelect("Annotations:");
    listSelectAnnotation.setImmediate(true);
    listSelectAnnotation.setHeight("150px");
    listSelectAnnotation.setWidth("100%");
    listSelectAnnotation.setNullSelectionAllowed(false);
    tab2Content.addComponent(listSelectAnnotation);

    this.textAreaAnnotation = new TextArea("Further annotations with other surface forms:");
    textAreaAnnotation.setImmediate(false);
    textAreaAnnotation.setRows(4);
    textAreaAnnotation.setReadOnly(true);
    textAreaAnnotation.setWidth("100%");
    tab2Content.addComponent(textAreaAnnotation);

    //this.buttonNext = new Button("Next");
    //buttonNext.setImmediate(true);
    //buttonNext.setDescription("Get next annotation");
    //tab2Content.addComponent(buttonNext);

    return tab2Content;
}

From source file:de.uni_leipzig.informatik.pcai042.boa.gui.evaluation.EvaluationView.java

License:Open Source License

/**
 * Build content 'evaluation process' of tab 3.
 * //from w w  w. j  a  va2 s .  c  o m
 * @return content of third tab
 */
private Layout buildTab3Content() {
    VerticalLayout tab3Content = new VerticalLayout();
    tab3Content.setSpacing(true);
    tab3Content.setMargin(true);
    tab3Content.setSizeFull();

    Label instructions = new Label(
            "<b>Instructions:</b> <i>Please select and click a sentence below in order to process the evaluation.</i>",
            Label.CONTENT_XHTML);
    tab3Content.addComponent(instructions);

    this.tableEvaluation = new Table("Evaluation process:");
    tableEvaluation.setHeight("150px");
    tableEvaluation.setWidth("100%");
    tableEvaluation.setImmediate(true);
    tableEvaluation.setSelectable(true);
    tableEvaluation.setMultiSelect(false);
    tableEvaluation.setSortDisabled(false);
    tableEvaluation.addContainerProperty("ID", Integer.class, null);
    tableEvaluation.addContainerProperty("Sentence", String.class, null);
    tableEvaluation.addContainerProperty("Precision", Double.class, null);
    tableEvaluation.addContainerProperty("Recall", Double.class, null);
    tableEvaluation.addContainerProperty("F-Score", Double.class, null);
    tab3Content.addComponent(tableEvaluation);

    this.buttonNext2 = new Button("Next");
    buttonNext2.setImmediate(true);
    buttonNext2.setDescription("Get the next sentence in table");
    tab3Content.addComponent(buttonNext2);

    this.textAreaEvalSentence = new TextArea("Sentence:");
    textAreaEvalSentence.setImmediate(false);
    textAreaEvalSentence.setReadOnly(true);
    textAreaEvalSentence.setRows(3);
    textAreaEvalSentence.setWidth("100%");
    tab3Content.addComponent(textAreaEvalSentence);

    HorizontalLayout hlay1 = new HorizontalLayout();
    this.listSelectGoldstandard = new ListSelect("Goldstandard:");
    listSelectGoldstandard.setImmediate(true);
    listSelectGoldstandard.setHeight("120px");
    listSelectGoldstandard.setWidth("100%");
    listSelectGoldstandard.setNullSelectionAllowed(false);
    this.listSelectFramework = new ListSelect("Framework:");
    listSelectFramework.setImmediate(true);
    listSelectFramework.setHeight("120px");
    listSelectFramework.setWidth("100%");
    listSelectFramework.setNullSelectionAllowed(false);
    hlay1.setSpacing(true);
    hlay1.setMargin(false);
    hlay1.setWidth("100%");
    hlay1.addComponent(listSelectGoldstandard);
    hlay1.addComponent(listSelectFramework);
    tab3Content.addComponent(hlay1);

    return tab3Content;
}

From source file:de.uni_tuebingen.qbic.qbicmainportlet.AddPatientView.java

License:Open Source License

/**
 * /*  w w  w.  jav a2  s . co m*/
 * @return
 */
void initOptionLayout() {
    optionLayout.removeAllComponents();
    optionLayout.setWidth("100%");
    optionLayout.setVisible(false);

    VerticalLayout optionLayoutContent = new VerticalLayout();

    Button addSample = new Button("Add Sample");
    addSample.addClickListener(new ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            sampleOptions.addBean(new NewIvacSampleBean("", 0, "", false, false, false, "", ""));
        }
    });

    optionLayoutContent.setMargin(new MarginInfo(true, false, false, false));
    optionLayoutContent.setHeight(null);
    optionLayoutContent.setWidth("100%");
    optionLayoutContent.setSpacing(true);

    final Grid optionGrid = new Grid();
    optionGrid.setWidth("80%");
    // optionGrid.setCaption("Which biological samples are available for the patient(s) and which
    // experiments will be performed?");

    gridInfo = new CustomVisibilityComponent(new Label(""));
    ((Label) gridInfo.getInnerComponent()).addStyleName(ValoTheme.LABEL_LARGE);

    Component gridInfoContent = Utils.questionize(gridInfo,
            "Which biological samples are available for the patient(s) and which experiments will be performed?",
            "Extracted Samples");

    // optionGrid.setSelectionMode(SelectionMode.MULTI);
    optionGrid.setEditorEnabled(true);

    optionGrid.setContainerDataSource(sampleOptions);
    optionGrid.setColumnOrder("type", "secondaryName", "tissue", "amount", "dnaSeq", "rnaSeq", "deepSeq");

    optionLayoutContent.addComponent(gridInfoContent);
    optionLayoutContent.addComponent(optionGrid);
    optionLayoutContent.addComponent(addSample);

    final GridEditForm form = new GridEditForm(
            datahandler.getOpenBisClient().getVocabCodesForVocab("Q_PRIMARY_TISSUES"),
            datahandler.getOpenBisClient().getVocabCodesForVocab("Q_SEQUENCER_DEVICES"));

    optionLayoutContent.addComponent(form);
    form.setVisible(false);

    optionGrid.addSelectionListener(new SelectionListener() {

        @Override
        public void select(SelectionEvent event) {
            BeanItem<NewIvacSampleBean> item = sampleOptions.getItem(optionGrid.getSelectedRow());
            form.fieldGroup.setItemDataSource(item);
            form.setVisible(true);
        }
    });

    optionLayout.addComponent(optionLayoutContent);
}

From source file:de.uni_tuebingen.qbic.qbicmainportlet.BiologicalSamplesComponent.java

License:Open Source License

/**
 * Precondition: {DatasetView#table} has to be initialized. e.g. with
 * {DatasetView#buildFilterTable} If it is not, strange behaviour has to be expected. builds the
 * Layout of this view./* w  w w  .  j  ava 2 s . c o  m*/
 */
private void buildLayout() {
    this.vert.removeAllComponents();
    this.vert.setSizeFull();
    vert.setResponsive(true);

    // Table (containing datasets) section
    VerticalLayout tableSection = new VerticalLayout();
    HorizontalLayout tableSectionContent = new HorizontalLayout();
    HorizontalLayout sampletableSectionContent = new HorizontalLayout();
    tableSection.setResponsive(true);
    tableSectionContent.setResponsive(true);
    sampletableSectionContent.setResponsive(true);

    tableSectionContent.setMargin(new MarginInfo(true, false, false, false));
    sampletableSectionContent.setMargin(new MarginInfo(true, false, false, false));

    // tableSectionContent.setCaption("Datasets");
    // tableSectionContent.setIcon(FontAwesome.FLASK);
    tableSection.addComponent(new Label(String.format(
            "This view shows the sample sources (e.g., human, mouse) to be studied and the corresponding extracted samples. With sample sources, information specific to the subject (e.g., age or BMI in the case of patient data) can be stored. The extracted sample is a sample which has been extracted from the corresponding sample source. This is the raw sample material that can be later prepared for specific analytical methods such as MS or NGS.<br> "
                    + "\n\n There are %s extracted  samples coming from %s distinct sample sources in this study.",
            numberOfBioSamples, numberOfEntitySamples), ContentMode.HTML));

    tableSectionContent.addComponent(sampleBioGrid);
    sampletableSectionContent.addComponent(sampleEntityGrid);

    sampleEntityGrid.setCaption("Sample Sources");
    sampleBioGrid.setCaption("Extracted Samples");

    tableSection.setMargin(new MarginInfo(true, false, true, true));
    tableSection.setSpacing(true);

    tableSection.addComponent(sampletableSectionContent);
    tableSection.addComponent(exportSources);
    tableSection.addComponent(tableSectionContent);
    tableSection.addComponent(exportSamples);
    this.vert.addComponent(tableSection);

    sampleBioGrid.setWidth(100, Unit.PERCENTAGE);
    sampleEntityGrid.setWidth(100, Unit.PERCENTAGE);

    // sampleBioGrid.setHeightMode(HeightMode.ROW);
    // sampleEntityGrid.setHeightMode(HeightMode.ROW);

    // sampleBioGrid.setHeightByRows(Math.min(10, numberOfBioSamples));
    // sampleEntityGrid.setHeightByRows(Math.min(10, 5));

    tableSection.setSizeFull();
    sampletableSectionContent.setSizeFull();
    tableSectionContent.setSizeFull();
}