Example usage for com.vaadin.ui VerticalLayout VerticalLayout

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

Introduction

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

Prototype

public VerticalLayout() 

Source Link

Document

Constructs an empty VerticalLayout.

Usage

From source file:com.example.bbs.vaadin.view.Labels.java

License:Apache License

public Labels() {
    setMargin(true);//from w  ww .  j  a  v a2s . c om
    addStyleName("content-labels");

    Label h1 = new Label("Labels");
    h1.addStyleName(ValoTheme.LABEL_H1);
    addComponent(h1);

    HorizontalLayout split = new HorizontalLayout();
    split.setWidth("100%");
    addComponent(split);

    VerticalLayout left = new VerticalLayout();
    left.setMargin(new MarginInfo(false, true, false, false));
    split.addComponent(left);

    Label huge = new Label("Huge type for display text.");
    huge.addStyleName(ValoTheme.LABEL_HUGE);
    left.addComponent(huge);

    Label large = new Label(
            "Large type for introductory text. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.");
    large.addStyleName(ValoTheme.LABEL_LARGE);
    left.addComponent(large);

    Label h2 = new Label("Subtitle");
    h2.addStyleName(ValoTheme.LABEL_H2);
    left.addComponent(h2);

    Label normal = new Label(
            "Normal type for plain text, with a <a href=\"https://vaadin.com\">regular link</a>. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.",
            ContentMode.HTML);
    left.addComponent(normal);

    Label h3 = new Label("Small Title");
    h3.addStyleName(ValoTheme.LABEL_H3);
    left.addComponent(h3);

    Label small = new Label(
            "Small type for additional text. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.");
    small.addStyleName(ValoTheme.LABEL_SMALL);
    left.addComponent(small);

    Label tiny = new Label("Tiny type for minor text.");
    tiny.addStyleName(ValoTheme.LABEL_TINY);
    left.addComponent(tiny);

    Label h4 = new Label("Section Title");
    h4.addStyleName(ValoTheme.LABEL_H4);
    left.addComponent(h4);

    normal = new Label(
            "Normal type for plain text. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.");
    left.addComponent(normal);

    Panel p = new Panel("Additional Label Styles");
    split.addComponent(p);

    VerticalLayout right = new VerticalLayout();
    right.setSpacing(true);
    right.setMargin(true);
    p.setContent(right);

    Label label = new Label(
            "Bold type for prominent text. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.");
    label.addStyleName(ValoTheme.LABEL_BOLD);
    right.addComponent(label);

    label = new Label(
            "Light type for subtle text. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.");
    label.addStyleName(ValoTheme.LABEL_LIGHT);
    right.addComponent(label);

    label = new Label(
            "Colored type for highlighted text. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.");
    label.addStyleName(ValoTheme.LABEL_COLORED);
    right.addComponent(label);

    label = new Label("A label for success");
    label.addStyleName(ValoTheme.LABEL_SUCCESS);
    right.addComponent(label);

    label = new Label("A label for failure");
    label.addStyleName(ValoTheme.LABEL_FAILURE);
    right.addComponent(label);

}

From source file:com.example.EditingWindow.java

License:Apache License

public EditingWindow(final BeanItem<Person> item, final MongoOperations mongoOperations, final Table table) {
    super("Edit");
    this.mongoOperations = mongoOperations;
    this.table = table;
    center();// w  w w  .ja v a  2 s. co  m
    setWidth("400px");
    setResizable(false);

    this.beanItem = item;
    this.person = item.getBean();
    this.layout = new VerticalLayout();
    this.layout.setMargin(true);

    this.fieldGroup = new BeanFieldGroup<Person>(Person.class);

    this.layout.addComponent(makeFormLayout(fieldGroup, item));
    this.layout.addComponent(makeFooter());

    this.setContent(this.layout);

    this.btnCancel.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent event) {
            EditingWindow.this.close();
        }
    });

    this.btnOK.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent event) {
            onOKButtonClick();
        }
    });

}

From source file:com.example.mmowgli_2_0.RootCards.java

@AutoGenerated
private VerticalLayout buildVerticalLayout_idea1() {
    // common part: create layout
    verticalLayout_idea1 = new VerticalLayout();
    verticalLayout_idea1.setImmediate(false);
    verticalLayout_idea1.setWidth("-1px");
    verticalLayout_idea1.setHeight("-1px");
    verticalLayout_idea1.setMargin(false);

    // label_idea1
    label_idea1 = new Label();
    label_idea1.setImmediate(false);//from  ww  w  .j  a  va 2s  . c o m
    label_idea1.setWidth("-1px");
    label_idea1.setHeight("-1px");
    label_idea1.setValue("Idea 1");
    verticalLayout_idea1.addComponent(label_idea1);
    verticalLayout_idea1.setComponentAlignment(label_idea1, new Alignment(48));

    // root_button1
    root_button1 = new NativeButton();
    root_button1.setCaption(
            "Project Gutenbergs The Time Machine by H. G. Herbert George Wells  This eBook is for the use of anyone anywhere at no cost and with almost no ");
    root_button1.setImmediate(true);
    root_button1.setWidth("399px");
    root_button1.setHeight("134px");
    verticalLayout_idea1.addComponent(root_button1);

    return verticalLayout_idea1;
}

From source file:com.example.mmowgli_2_0.RootCards.java

@AutoGenerated
private VerticalLayout buildVerticalLayout_idea2() {
    // common part: create layout
    verticalLayout_idea2 = new VerticalLayout();
    verticalLayout_idea2.setImmediate(false);
    verticalLayout_idea2.setWidth("-1px");
    verticalLayout_idea2.setHeight("-1px");
    verticalLayout_idea2.setMargin(false);

    // label_idea2
    label_idea2 = new Label();
    label_idea2.setImmediate(false);/*  ww w.ja  v a 2s .  c  o m*/
    label_idea2.setWidth("-1px");
    label_idea2.setHeight("-1px");
    label_idea2.setValue("Idea 2");
    verticalLayout_idea2.addComponent(label_idea2);
    verticalLayout_idea2.setComponentAlignment(label_idea2, new Alignment(20));

    // root_button2
    root_button2 = new NativeButton();
    root_button2.setCaption(
            "restrictions whatsoever.  You may copy it give it away or reuse it under the terms of the Project Gutenberg License included with this eBook or on");
    root_button2.setImmediate(true);
    root_button2.setWidth("399px");
    root_button2.setHeight("134px");
    verticalLayout_idea2.addComponent(root_button2);

    return verticalLayout_idea2;
}

From source file:com.example.SimpleExampleVaadinUI.java

License:Apache License

@Override
protected void init(VaadinRequest request) {
    VerticalLayout vl = new VerticalLayout();
    vl.addComponent(new MyComponent());
    setContent(vl);/* w  w w . j  a v a 2  s  .co  m*/
}

From source file:com.example.tomeevaadin.ui.BookUI.java

@Override
protected void init(VaadinRequest request) {
    Label label = new Label("welcome");
    verticalLayout = new VerticalLayout();
    //verticalLayout.setSizeFull();
    verticalLayout.addComponent(label);/*w w w.ja  va2s.c om*/
    setContent(verticalLayout);
    verticalLayout.addComponent(addInputFields());
    addInputFields();
    addTable();
}

From source file:com.example.vaadin.MyVaadinApplication.java

License:Apache License

public void authenticatedScreen() {

    VerticalLayout vLayout = new VerticalLayout();
    Label label = new Label("Logged in as " + currentUser.getPrincipal().toString());
    vLayout.setSizeFull();/*  w  w  w.  jav a  2s  .com*/
    vLayout.addComponent(horizontalSplit);

    /* Allocate all available extra space to the horizontal split panel */

    vLayout.setExpandRatio(horizontalSplit, 1);
    /* Set the initial split position so we can have a 200 pixel menu to the left */
    horizontalSplit.setFirstComponent(tree);
    horizontalSplit.setSplitPosition(200, SplitPanel.UNITS_PIXELS);
    vLayout.addStyleName("view");

    getMainWindow().setContent(vLayout);

    //this.addComponent(layout);

}

From source file:com.expressui.core.MainApplication.java

License:Open Source License

@Override
public void init() {
    currentInstance.set(this);

    setTheme(getCustomTheme());/*  w  ww  .j  a v  a 2 s  .  c o m*/
    customizeConfirmDialogStyle();

    Window mainWindow = new Window();
    setMainWindow(mainWindow);
    mainWindow.addStyleName("e-main-window");
    mainWindow.setCaption(getTypeCaption());

    VerticalLayout mainLayout = new VerticalLayout();
    String id = StringUtil.generateDebugId("e", this, mainLayout, "mainLayout");
    mainLayout.setDebugId(id);

    mainWindow.setSizeFull();
    mainLayout.setSizeFull();
    mainWindow.setContent(mainLayout);

    setLogoutURL(getApplicationProperties().getRestartApplicationUrl());

    configureLeftMenuBar(mainMenuBar.getLeftMenuBarRoot());
    configureRightMenuBar(mainMenuBar.getRightMenuBarRoot());
    mainLayout.addComponent(mainMenuBar);

    pageLayoutTabSheet = new TabSheet();
    id = StringUtil.generateDebugId("e", this, pageLayoutTabSheet, "pageLayoutTabSheet");
    pageLayoutTabSheet.setDebugId(id);

    pageLayoutTabSheet.addStyleName("e-main-page-layout");
    pageLayoutTabSheet.setSizeFull();
    mainLayout.addComponent(pageLayoutTabSheet);
    mainLayout.setExpandRatio(pageLayoutTabSheet, 1.0f);

    Link expressUILink = new Link(uiMessageSource.getMessage("mainApplication.footerMessage"),
            new ExternalResource(uiMessageSource.getMessage("mainApplication.footerLink")));
    expressUILink.setTargetName("_blank");
    expressUILink.setIcon(new ThemeResource("../expressui/favicon.png"));
    expressUILink.setSizeUndefined();
    mainLayout.addComponent(expressUILink);
    mainLayout.setComponentAlignment(expressUILink, Alignment.TOP_CENTER);

    configureSessionTimeout(mainWindow);
    postWire();
    onDisplay();
}

From source file:com.expressui.core.view.form.layout.TopLabelGridLayout.java

License:Open Source License

private void addFieldImpl(FormField formField) {
    VerticalLayout fieldLayout = new VerticalLayout();
    fieldLayout.setWidth(SIZE_UNDEFINED, Sizeable.UNITS_PERCENTAGE);
    String id = StringUtil.generateDebugId("e", this, fieldLayout, "fieldLayout");
    fieldLayout.setDebugId(id);//  ww w.ja v a2s. co m
    fieldLayout.addComponent(formField.getFieldLabel());
    fieldLayout.addComponent(formField.getField());
    if (formField.getColumnEnd() != null && formField.getRowEnd() != null) {
        addComponent(fieldLayout, formField.getColumnStart() - 1, formField.getRowStart() - 1,
                formField.getColumnEnd() - 1, formField.getRowEnd() - 1);
    } else {
        addComponent(fieldLayout, formField.getColumnStart() - 1, formField.getRowStart() - 1);
    }
}

From source file:com.expressui.core.view.form.ResultsConnectedEntityForm.java

License:Open Source License

private HorizontalLayout createNavigationFormLayout() {
    HorizontalLayout navigationFormLayout = new HorizontalLayout();
    String id = StringUtil.generateDebugId("e", this, navigationFormLayout, "navigationFormLayout");
    navigationFormLayout.setDebugId(id);
    navigationFormLayout.setSizeUndefined();

    VerticalLayout previousButtonLayout = new VerticalLayout();
    id = StringUtil.generateDebugId("e", this, previousButtonLayout, "previousButtonLayout");
    previousButtonLayout.setDebugId(id);

    previousButtonLayout.setSizeUndefined();
    previousButtonLayout.setMargin(false);
    previousButtonLayout.setSpacing(false);
    Label spaceLabel = new Label("</br></br></br>", Label.CONTENT_XHTML);
    spaceLabel.setSizeUndefined();/*from   www  .j a v  a2s .  c o m*/
    previousButtonLayout.addComponent(spaceLabel);

    Button previousButton = new Button(null, this, "previousItem");
    previousButton.setDescription(entityForm.uiMessageSource.getToolTip("entityForm.previous.toolTip"));
    previousButton.setSizeUndefined();
    previousButton.addStyleName("borderless");
    previousButton.setIcon(new ThemeResource("../expressui/icons/16/previous.png"));

    if (entityForm.getViewableToManyRelationships().size() == 0) {
        HorizontalLayout previousButtonHorizontalLayout = new HorizontalLayout();
        id = StringUtil.generateDebugId("e", this, previousButtonHorizontalLayout,
                "previousButtonHorizontalLayout");
        previousButtonHorizontalLayout.setDebugId(id);
        previousButtonHorizontalLayout.setSizeUndefined();
        Label horizontalSpaceLabel = new Label("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", Label.CONTENT_XHTML);
        horizontalSpaceLabel.setSizeUndefined();
        previousButtonHorizontalLayout.addComponent(previousButton);
        previousButtonHorizontalLayout.addComponent(horizontalSpaceLabel);
        previousButtonLayout.addComponent(previousButtonHorizontalLayout);
    } else {
        previousButtonLayout.addComponent(previousButton);
    }

    navigationFormLayout.addComponent(previousButtonLayout);
    navigationFormLayout.setComponentAlignment(previousButtonLayout, Alignment.TOP_LEFT);

    navigationFormLayout.addComponent(entityForm);

    VerticalLayout nextButtonLayout = new VerticalLayout();
    id = StringUtil.generateDebugId("e", this, nextButtonLayout, "nextButtonLayout");
    nextButtonLayout.setDebugId(id);
    nextButtonLayout.setSizeUndefined();
    nextButtonLayout.setMargin(false);
    nextButtonLayout.setSpacing(false);
    spaceLabel = new Label("</br></br></br>", Label.CONTENT_XHTML);
    spaceLabel.setSizeUndefined();
    previousButtonLayout.addComponent(spaceLabel);
    nextButtonLayout.addComponent(spaceLabel);

    Button nextButton = new Button(null, this, "nextItem");
    nextButton.setDescription(entityForm.uiMessageSource.getToolTip("entityForm.next.toolTip"));
    nextButton.setSizeUndefined();
    nextButton.addStyleName("borderless");
    nextButton.setIcon(new ThemeResource("../expressui/icons/16/next.png"));

    HorizontalLayout nextButtonHorizontalLayout = new HorizontalLayout();
    id = StringUtil.generateDebugId("e", this, nextButtonHorizontalLayout, "nextButtonHorizontalLayout");
    nextButtonHorizontalLayout.setDebugId(id);
    nextButtonHorizontalLayout.setSizeUndefined();
    Label horizontalSpaceLabel = new Label("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", Label.CONTENT_XHTML);
    horizontalSpaceLabel.setSizeUndefined();
    nextButtonHorizontalLayout.addComponent(horizontalSpaceLabel);
    nextButtonHorizontalLayout.addComponent(nextButton);

    nextButtonLayout.addComponent(nextButtonHorizontalLayout);
    navigationFormLayout.addComponent(nextButtonLayout);
    navigationFormLayout.setComponentAlignment(nextButtonLayout, Alignment.TOP_RIGHT);

    navigationFormLayout.setSpacing(false);
    navigationFormLayout.setMargin(false);

    return navigationFormLayout;
}