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.expressui.core.view.form.TypedForm.java

License:Open Source License

@PostConstruct
@Override/*  www .  j ava  2s. c  om*/
public void postConstruct() {
    super.postConstruct();

    form = new ConfigurableForm();
    form.setSizeUndefined();

    form.setWriteThrough(true);
    form.setInvalidCommitted(true);
    form.setImmediate(true);
    form.setValidationVisibleOnCommit(true);

    formFieldSet.setForm(this);
    init(formFieldSet);
    formFieldSet.assertValid();
    form.setFormFieldFactory(new TypedFormFieldFactory(getFormFieldSet()));

    final Layout gridLayout = getFormFieldSet().createGridLayout();
    form.setLayout(gridLayout);

    form.getFooter().addStyleName("e-typed-form-footer");
    createFooterButtons((HorizontalLayout) form.getFooter());

    VerticalLayout tabsAndForm = new VerticalLayout();
    setDebugId(tabsAndForm, "tabsAndForm");
    tabsAndForm.setSizeUndefined();
    if (getFormFieldSet().hasTabs()) {
        initializeTabs(tabsAndForm);
        if (getFormFieldSet().hasOptionalTabs()) {
            initializeOptionalTabs(tabsAndForm);
        }
    }
    tabsAndForm.addComponent(form);

    Label spaceLabel = new Label("</br>", Label.CONTENT_XHTML);
    spaceLabel.setSizeUndefined();
    tabsAndForm.addComponent(spaceLabel);

    addComponent(makeCollapsible(getTypeCaption(), tabsAndForm));
    labelRegistry.registerLabels(getFormFieldSet());
}

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

License:Open Source License

/**
 * Makes the component collapsible by wrapping it with a layout and button for toggling
 * the component's visibility. This allows the user to expand/collapse the given component in order
 * to free space for viewing other components.
 *
 * @param component         component to show/hide
 * @param useVerticalLayout true if toggle button should be laid out vertically next to animated component
 * @return the newly created layout that contains the toggle button and animated component
 *//*  w ww . j a va2s .c  o  m*/
protected Component makeCollapsible(String caption, Component component, boolean useVerticalLayout) {
    formAnimator = new Animator(component);
    formAnimator.setSizeUndefined();

    AbstractOrderedLayout animatorLayout;
    if (useVerticalLayout) {
        animatorLayout = new VerticalLayout();
    } else {
        animatorLayout = new HorizontalLayout();
    }
    setDebugId(animatorLayout, "animatorLayout");

    animatorLayout.setMargin(false, false, false, false);
    animatorLayout.setSpacing(false);

    toggleFormCollapseButton = new Button(null, new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent event) {
            setFormVisible(!isFormVisible());
        }
    });
    toggleFormCollapseButton.setDescription(uiMessageSource.getToolTip("typedForm.toggleSearchForm.toolTip"));
    toggleFormCollapseButton.setIcon(new ThemeResource("../expressui/icons/collapse-icon.png"));
    toggleFormCollapseButton.addStyleName("borderless");

    if (useVerticalLayout) {
        HorizontalLayout toggleFormButtonAndCaption = new HorizontalLayout();
        setDebugId(toggleFormButtonAndCaption, "toggleFormButtonAndCaption");
        toggleFormButtonAndCaption.setSizeUndefined();
        toggleFormButtonAndCaption.addComponent(toggleFormCollapseButton);
        Label label = new Label(caption);
        label.setSizeUndefined();
        toggleFormButtonAndCaption.addComponent(label);
        animatorLayout.addComponent(toggleFormButtonAndCaption);
        animatorLayout.addComponent(formAnimator);
    } else {
        animatorLayout.addComponent(toggleFormCollapseButton);
        animatorLayout.addComponent(formAnimator);
    }

    return animatorLayout;
}

From source file:com.expressui.core.view.results.Results.java

License:Open Source License

@PostConstruct
@Override//from   w  ww  .  java 2s.  com
public void postConstruct() {
    super.postConstruct();
    resultsFieldSet.setType(getType());
    init(resultsFieldSet);

    resultsTable = new ResultsTable(this);
    configureTable(resultsTable);

    VerticalLayout rootLayout = new VerticalLayout();
    setDebugId(rootLayout, "rootLayout");
    setCompositionRoot(rootLayout);

    crudButtons = new HorizontalLayout();
    HorizontalLayout navigationLine = createNavigationLine();
    addComponent(crudButtons);
    addComponent(navigationLine);

    addComponent(resultsTable);

    rootLayout.setMargin(true);

    setSizeUndefined();

    labelRegistry.registerLabels(resultsFieldSet);
}

From source file:com.expressui.core.view.RootComponent.java

License:Open Source License

/**
 * Sets composition root of this component to a VerticalLayout with margins and spacing.
 *//*from  ww w.j  a v a2s.  c  om*/
public VerticalLayout createVerticalLayout() {
    VerticalLayout rootLayout = new VerticalLayout();
    setDebugId(rootLayout, "rootLayout");
    rootLayout.setMargin(true);
    rootLayout.setSpacing(false);

    return rootLayout;
}

From source file:com.fatminds.vaadin_cmis_integration.demo.DemoPage.java

License:Apache License

@AutoGenerated
private VerticalLayout buildMainLayout() {
    // common part: create layout
    mainLayout = new VerticalLayout();
    mainLayout.setImmediate(false);// w  w w. j  a  v a  2  s  .  c om
    mainLayout.setWidth("900px");
    mainLayout.setHeight("800px");
    mainLayout.setMargin(true);
    mainLayout.setSpacing(true);

    // top-level component properties
    setWidth("900px");
    setHeight("800px");

    // gridLayout_2
    gridLayout_2 = buildGridLayout_2();
    mainLayout.addComponent(gridLayout_2);
    mainLayout.setComponentAlignment(gridLayout_2, new Alignment(20));

    // horizontalLayout_3
    horizontalLayout_3 = buildHorizontalLayout_3();
    mainLayout.addComponent(horizontalLayout_3);
    mainLayout.setComponentAlignment(horizontalLayout_3, new Alignment(20));

    // gridLayout_1
    gridLayout_1 = buildGridLayout_1();
    mainLayout.addComponent(gridLayout_1);
    mainLayout.setExpandRatio(gridLayout_1, 1.0f);
    mainLayout.setComponentAlignment(gridLayout_1, new Alignment(20));

    return mainLayout;
}

From source file:com.fatminds.vaadin_cmis_integration.demo.DemoPage.java

License:Apache License

@AutoGenerated
private VerticalLayout buildVerticalLayout_2() {
    // common part: create layout
    verticalLayout_2 = new VerticalLayout();
    verticalLayout_2.setImmediate(false);
    verticalLayout_2.setWidth("-1px");
    verticalLayout_2.setHeight("-1px");
    verticalLayout_2.setMargin(false);//from  w  w w .  ja  v a2s . com

    // label_1
    label_1 = new Label();
    label_1.setImmediate(false);
    label_1.setWidth("-1px");
    label_1.setHeight("-1px");
    label_1.setValue("Upload a text or html file");
    verticalLayout_2.addComponent(label_1);
    verticalLayout_2.setComponentAlignment(label_1, new Alignment(33));

    // upload_1
    upload_1 = new Upload();
    upload_1.setImmediate(false);
    upload_1.setWidth("100.0%");
    upload_1.setHeight("100.0%");
    verticalLayout_2.addComponent(upload_1);
    verticalLayout_2.setComponentAlignment(upload_1, new Alignment(33));

    return verticalLayout_2;
}

From source file:com.fatminds.vaadin_cmis_integration.demo.DemoPage.java

License:Apache License

@AutoGenerated
private VerticalLayout buildVerticalLayout_3() {
    // common part: create layout
    verticalLayout_3 = new VerticalLayout();
    verticalLayout_3.setImmediate(false);
    verticalLayout_3.setWidth("-1px");
    verticalLayout_3.setHeight("-1px");
    verticalLayout_3.setMargin(false);/*w w w. j  av  a  2  s.c  o m*/
    verticalLayout_3.setSpacing(true);

    // richTextArea_1
    richTextArea_1 = new RichTextArea();
    richTextArea_1.setImmediate(false);
    richTextArea_1.setWidth("450px");
    richTextArea_1.setHeight("250px");
    verticalLayout_3.addComponent(richTextArea_1);

    // btnSaveContent
    btnSaveContent = new Button();
    btnSaveContent.setCaption("Save rich editor changes to cm:content");
    btnSaveContent.setImmediate(true);
    btnSaveContent.setWidth("450px");
    btnSaveContent.setHeight("-1px");
    verticalLayout_3.addComponent(btnSaveContent);

    return verticalLayout_3;
}

From source file:com.fatminds.vaadin_cmis_integration.demo.DemoPage.java

License:Apache License

@AutoGenerated
private VerticalLayout buildVerticalLayout_4() {
    // common part: create layout
    verticalLayout_4 = new VerticalLayout();
    verticalLayout_4.setImmediate(false);
    verticalLayout_4.setWidth("-1px");
    verticalLayout_4.setHeight("-1px");
    verticalLayout_4.setMargin(false);//from ww  w.  j  a  va 2  s  .c  o  m

    // demoTemplateForm_1
    demoTemplateForm_1 = new DemoTemplateForm();
    demoTemplateForm_1.setImmediate(false);
    demoTemplateForm_1.setWidth("350px");
    demoTemplateForm_1.setHeight("250px");
    verticalLayout_4.addComponent(demoTemplateForm_1);

    return verticalLayout_4;
}

From source file:com.fatminds.vaadin_cmis_integration.demo.DemoTemplateForm.java

License:Apache License

@AutoGenerated
private VerticalLayout buildMainLayout() {
    // common part: create layout
    mainLayout = new VerticalLayout();
    mainLayout.setImmediate(false);//from w  w w  .  jav  a 2  s .c  om
    mainLayout.setWidth("350px");
    mainLayout.setHeight("110px");
    mainLayout.setMargin(false);
    mainLayout.setSpacing(true);

    // top-level component properties
    setWidth("350px");
    setHeight("110px");

    // gridLayout_1
    gridLayout_1 = buildGridLayout_1();
    mainLayout.addComponent(gridLayout_1);
    mainLayout.setComponentAlignment(gridLayout_1, new Alignment(20));

    return mainLayout;
}

From source file:com.firstbanknigeria.ofsaaenhancers.UI.AdjustmentUI.java

public AdjustmentUI() {
    super("Load Adjustments");
    this.setWidth("1000px");
    this.setHeight("250px");

    objectContext = ObjectStore.getObjectContext(VaadinSession.getCurrent().getSession().getId());

    final VerticalLayout layout = new VerticalLayout();
    layout.setDefaultComponentAlignment(Alignment.MIDDLE_CENTER);
    layout.setSpacing(true);/*from  w w w.j  a  v a 2 s.c  o m*/

    AdjustmentFileProcessor adjFileProcessor = new AdjustmentFileProcessor();
    adjFileProcessor.setAdjustmentUI(this);

    Upload uploadComponent = new Upload("", adjFileProcessor);
    uploadComponent.addSucceededListener(adjFileProcessor);
    uploadComponent.setButtonCaption("Upload Adjustments");
    uploadComponent.setImmediate(true);

    Button runAdjustmenstButton = new Button("Run Adjustments");
    runAdjustmenstButton.addClickListener(new Button.ClickListener() {

        public void buttonClick(Button.ClickEvent e) {
            ProcedureQuery query = new ProcedureQuery("RUN_ADJUSTMENTS");
            QueryResponse response = objectContext.performGenericQuery(query);
        }
    });

    layout.addComponents(uploadComponent, runAdjustmenstButton);
    layout.setMargin(true);
    layout.setSpacing(true);

    setContent(layout);
}