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.dungnv.streetfood.view.RestaurantView.java

public RestaurantView() {
    user = (UserDTO) VaadinSession.getCurrent().getAttribute(UserDTO.class.getName());
    setLocale(VaadinSession.getCurrent().getLocale());
    setSizeFull();//from w w w  .  j a v a  2s. c  o  m
    root = new VerticalLayout();
    root.setSizeFull();
    root.setMargin(true);
    root.addStyleName("dashboard-view");
    setContent(root);
    Responsive.makeResponsive(root);
    init();
    root.addComponent(header);

    builAction();
    dtoSearch = new RestaurantDTO();
    onSearch(true);

}

From source file:com.dungnv.streetfood.view.RestaurantView.java

private void init() {
    header = new VerticalLayout();
    header.addStyleName("viewheader");
    header.setSpacing(true);/*from   w ww  . j  a v  a 2  s.c o m*/
    header.setId("hehehe");

    titleLabel = new Label(BundleUtils.getLanguage("menu.RESTAURANT"));
    titleLabel.setId(TITLE_ID);
    titleLabel.setWidth("100%");
    titleLabel.addStyleName(ValoTheme.LABEL_BOLD);
    header.addComponent(titleLabel);

    btnAdd = new Button();
    btnAdd.setCaption(FontAwesome.PLUS_CIRCLE.getLabel().setSize3x().getCssHtml());
    btnAdd.setCaptionAsHtml(true);
    btnAdd.addStyleName("float-button");
    //        add.addStyleName(ValoTheme.BUTTON_BORDERLESS);
    //        add.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    //        add.addStyleName(ValoTheme.BUTTON_LARGE);
    header.addComponent(btnAdd);

    HorizontalLayout item = new HorizontalLayout();

    //        item.setSpacing(true);
    item.setWidth("100%");
    header.addComponent(item);

    txtSearch = new TextField();
    txtSearch.setImmediate(true);
    txtSearch.setTextChangeEventMode(AbstractTextField.TextChangeEventMode.TIMEOUT);
    txtSearch.setIcon(FontAwesome.SEARCH);
    txtSearch.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);
    txtSearch.setInputPrompt(BundleUtils.getLanguage("lbl.restaurant.name.input"));
    txtSearch.setWidth("100%");

    item.addComponent(txtSearch);
    item.setComponentAlignment(txtSearch, Alignment.TOP_RIGHT);

    lbAdvanced = new Button();
    lbAdvanced.setCaption(BundleUtils.getLanguage("lbl.search.advanced"));
    lbAdvanced.addStyleName(ValoTheme.BUTTON_LINK);
    lbAdvanced.addStyleName(ValoTheme.BUTTON_LARGE);
    item.addComponent(lbAdvanced);
    item.setComponentAlignment(lbAdvanced, Alignment.BOTTOM_LEFT);

    uiSearchPaged = new CommonSearchPagedUI(1) {
        @Override
        public void cbChanged() {
            this.getCbPaged().addValueChangeListener(new Property.ValueChangeListener() {
                @Override
                public void valueChange(Property.ValueChangeEvent event) {
                    if (event.getProperty().getValue() != null) {
                        onSearch(false);
                    }
                }
            });
            this.getCbRecordPerPage().addValueChangeListener(new Property.ValueChangeListener() {
                @Override
                public void valueChange(Property.ValueChangeEvent event) {
                    if (event.getProperty().getValue() != null) {
                        onSearch(true);
                    }

                }
            });
        }
    };

    header.addComponent(uiSearchPaged);

    searchLayout = new VerticalLayout();
    //        searchLayout.setSpacing(true);
    searchLayout.setSizeFull();
    header.addComponent(searchLayout);

    searchDetail = new RestaurantSearchDetail(this);
}

From source file:com.dungnv.streetfood.view.SlideShowInsert.java

public final void init() {

    layout = new VerticalLayout();
    layout.setSpacing(true);// w w w  .j  a  v  a  2s.  co  m
    layout.setMargin(true);

    wizard = new Wizard();
    wizard.setHeight("80%");
    wizard.setUriFragmentEnabled(true);
    wizard.addListener(this);
    ((HorizontalLayout) wizard.getFinishButton().findAncestor(HorizontalLayout.class))
            .setMargin(new MarginInfo(true, false, true, true));
    if (Constants.ACTION.INSERT.equals(action)) {
        wizard.addStep(new IntroStep(), BundleUtils.getLanguage("lbl.slideShow.insert"));
    } else if (Constants.ACTION.UPDATE.equals(action)) {
        wizard.addStep(new IntroStep(), BundleUtils.getLanguage("lbl.slideShow.update"));
    }
    wizard.addStep(new SecondStep(), BundleUtils.getLanguage("lbl.language.update"));

    layout.addComponent(wizard);
    layout.setComponentAlignment(wizard, Alignment.TOP_CENTER);
}

From source file:com.dungnv.streetfood.view.SlideShowSearchDetail.java

private void init() {
    layout = new VerticalLayout();
    layout.setSpacing(true);//from w w w  .  j  a  v  a2 s  .com
    layout.setMargin(true);

    form = new FormLayout();
    form.addStyleName("light");
    //                form.addStyleName("outlined");
    form.setSizeFull();
    form.setMargin(true);
    form.setSpacing(true);
    layout.addComponent(form);

    tfName = new TextField(BundleUtils.getLanguage("lbl.category.name"));
    tfName.setWidth(80.0f, Unit.PERCENTAGE);
    form.addComponent(tfName);

    tfDescription = new TextField(BundleUtils.getLanguage("lbl.slideShow.description"));
    tfDescription.setWidth(80.0f, Unit.PERCENTAGE);
    form.addComponent(tfDescription);

    HorizontalLayout hlButton = new HorizontalLayout();
    hlButton.setSpacing(true);
    hlButton.setMargin(true);
    form.addComponent(hlButton);

    btnSearch = new Button(BundleUtils.getLanguage("lbl.search"), FontAwesome.SEARCH);
    hlButton.addComponent(btnSearch);

    btnCancel = new Button(BundleUtils.getLanguage("lbl.cancel"), FontAwesome.BAN);
    hlButton.addComponent(btnCancel);

}

From source file:com.dungnv.streetfood.view.SlideShowView.java

public SlideShowView() {
    user = (UserDTO) VaadinSession.getCurrent().getAttribute(UserDTO.class.getName());
    setLocale(VaadinSession.getCurrent().getLocale());
    setSizeFull();// w w w  . ja va 2  s .  c om
    root = new VerticalLayout();
    root.setSizeFull();
    root.setMargin(true);
    root.addStyleName("dashboard-view");
    setContent(root);
    Responsive.makeResponsive(root);
    init();
    root.addComponent(header);

    builAction();
    dtoSearch = new SlideShowDTO();
    onSearch(true);

}

From source file:com.dungnv.streetfood.view.SlideShowView.java

private void init() {
    header = new VerticalLayout();
    header.addStyleName("viewheader");
    header.setSpacing(true);/*from   w  w w .  j  av  a 2 s  .co  m*/
    header.setId("hehehe");

    titleLabel = new Label(BundleUtils.getLanguage("menu.RESTAURANT"));
    titleLabel.setId(TITLE_ID);
    titleLabel.setWidth("100%");
    titleLabel.addStyleName(ValoTheme.LABEL_BOLD);
    header.addComponent(titleLabel);

    btnAdd = new Button();
    btnAdd.setCaption(FontAwesome.PLUS_CIRCLE.getLabel().setSize3x().getCssHtml());
    btnAdd.setCaptionAsHtml(true);
    btnAdd.addStyleName("float-button");
    //        add.addStyleName(ValoTheme.BUTTON_BORDERLESS);
    //        add.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    //        add.addStyleName(ValoTheme.BUTTON_LARGE);
    header.addComponent(btnAdd);

    HorizontalLayout item = new HorizontalLayout();

    //        item.setSpacing(true);
    item.setWidth("100%");
    header.addComponent(item);

    txtSearch = new TextField();
    txtSearch.setImmediate(true);
    txtSearch.setTextChangeEventMode(AbstractTextField.TextChangeEventMode.TIMEOUT);
    txtSearch.setIcon(FontAwesome.SEARCH);
    txtSearch.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);
    txtSearch.setInputPrompt(BundleUtils.getLanguage("lbl.slideShow.name.input"));
    txtSearch.setWidth("100%");

    item.addComponent(txtSearch);
    item.setComponentAlignment(txtSearch, Alignment.TOP_RIGHT);

    lbAdvanced = new Button();
    lbAdvanced.setCaption(BundleUtils.getLanguage("lbl.search.advanced"));
    lbAdvanced.addStyleName(ValoTheme.BUTTON_LINK);
    lbAdvanced.addStyleName(ValoTheme.BUTTON_LARGE);
    item.addComponent(lbAdvanced);
    item.setComponentAlignment(lbAdvanced, Alignment.BOTTOM_LEFT);

    uiSearchPaged = new CommonSearchPagedUI(1) {
        @Override
        public void cbChanged() {
            this.getCbPaged().addValueChangeListener(new Property.ValueChangeListener() {
                @Override
                public void valueChange(Property.ValueChangeEvent event) {
                    if (event.getProperty().getValue() != null) {
                        onSearch(false);
                    }
                }
            });
            this.getCbRecordPerPage().addValueChangeListener(new Property.ValueChangeListener() {
                @Override
                public void valueChange(Property.ValueChangeEvent event) {
                    if (event.getProperty().getValue() != null) {
                        onSearch(true);
                    }

                }
            });
        }
    };

    header.addComponent(uiSearchPaged);

    searchLayout = new VerticalLayout();
    //        searchLayout.setSpacing(true);
    searchLayout.setSizeFull();
    header.addComponent(searchLayout);

    searchDetail = new SlideShowSearchDetail(this);
}

From source file:com.ejt.vaadin.loginform.DefaultVerticalLoginForm.java

License:Apache License

@Override
protected Component createContent(TextField userNameField, PasswordField passwordField, Button loginButton) {
    VerticalLayout layout = new VerticalLayout();
    layout.setSpacing(true);//from w  w  w. j  a va2s.  co  m
    layout.setMargin(true);

    layout.addComponent(userNameField);
    layout.addComponent(passwordField);
    layout.addComponent(loginButton);
    return layout;
}

From source file:com.esofthead.mycollab.community.view.NotPresentedView.java

License:Open Source License

public NotPresentedView() {
    this.setHeight("370px");
    this.setWidth("100%");
    VerticalLayout layoutWapper = new VerticalLayout();
    layoutWapper.setWidth("100%");

    VerticalLayout layout = new VerticalLayout();
    final Embedded titleIcon = new Embedded();
    titleIcon.setSource(MyCollabResource.newResource("icons/not_present.png"));
    layout.addComponent(titleIcon);/*  w  ww. j  a v  a 2 s  .  c  o m*/
    layout.setComponentAlignment(titleIcon, Alignment.MIDDLE_CENTER);

    Label label = new Label("Module is not presented for community edition");
    label.setStyleName("h2_community");
    layout.addComponent(label);
    layout.setComponentAlignment(label, Alignment.MIDDLE_CENTER);

    layoutWapper.addComponent(layout);
    layoutWapper.setComponentAlignment(layout, Alignment.MIDDLE_CENTER);
    this.addComponent(layoutWapper);
    this.setComponentAlignment(layoutWapper, Alignment.MIDDLE_CENTER);
}

From source file:com.esofthead.mycollab.form.view.DynaFormLayout.java

License:Open Source License

@Override
public Layout getLayout() {
    layout = new VerticalLayout();
    int sectionCount = dynaForm.getSectionCount();
    sectionMappings = new HashMap<DynaSection, GridFormLayoutHelper>();

    for (int i = 0; i < sectionCount; i++) {
        DynaSection section = dynaForm.getSection(i);
        if (section.isDeletedSection()) {
            continue;
        }/*from   w w w  .j  a va2  s  .com*/
        Label header = new Label(section.getHeader());
        header.setStyleName("h2");
        layout.addComponent(header);

        GridFormLayoutHelper gridLayout;

        if (section.isDeletedSection() || section.getFieldCount() == 0) {
            continue;
        }

        if (section.getLayoutType() == LayoutType.ONE_COLUMN) {
            gridLayout = new GridFormLayoutHelper(2, section.getFieldCount(), "100%", "167px",
                    Alignment.TOP_LEFT);
        } else if (section.getLayoutType() == LayoutType.TWO_COLUMN) {
            gridLayout = new GridFormLayoutHelper(2, (section.getFieldCount() + 3) / 2, "100%", "167px",
                    Alignment.TOP_LEFT);
        } else {
            throw new MyCollabException("Does not support attachForm layout except 1 or 2 columns");
        }

        gridLayout.getLayout().setWidth("100%");
        gridLayout.getLayout().setMargin(false);
        gridLayout.getLayout().setSpacing(false);
        gridLayout.getLayout().addStyleName("colored-gridlayout");
        layout.addComponent(gridLayout.getLayout());

        sectionMappings.put(section, gridLayout);
    }
    return layout;
}

From source file:com.esofthead.mycollab.mobile.form.view.DynaFormLayout.java

License:Open Source License

@Override
public ComponentContainer getLayout() {
    layout = new VerticalLayout();
    int sectionCount = dynaForm.getSectionCount();
    sectionMappings = new HashMap<DynaSection, GridFormLayoutHelper>();

    for (int i = 0; i < sectionCount; i++) {
        DynaSection section = dynaForm.getSection(i);
        if (section.isDeletedSection()) {
            continue;
        }//ww w  . ja v a 2  s  . co m
        Label header = new Label(section.getHeader());
        header.setStyleName("h2");
        layout.addComponent(header);

        GridFormLayoutHelper gridLayout;

        if (section.isDeletedSection() || section.getFieldCount() == 0) {
            continue;
        }

        gridLayout = new GridFormLayoutHelper(1, section.getFieldCount(), "100%", "150px", Alignment.TOP_RIGHT);

        gridLayout.getLayout().setWidth("100%");
        gridLayout.getLayout().setMargin(false);
        gridLayout.getLayout().setSpacing(false);
        gridLayout.getLayout().addStyleName("colored-gridlayout");
        layout.addComponent(gridLayout.getLayout());

        sectionMappings.put(section, gridLayout);
    }
    return layout;
}