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.ui.SlideShowItemUI.java

private void init() {
    this.addStyleName("item-interator");
    this.setSpacing(true);
    this.setWidth("100%");

    CssLayout horizontal = new CssLayout();
    horizontal.setStyleName("padding-5");
    horizontal.setWidth("100%");
    Responsive.makeResponsive(horizontal);
    this.addComponent(horizontal);

    Image imag = new Image();
    if (!StringUtils.isNullOrEmpty(item.getImageUrl())) {
        imag.setSource(new ExternalResource(item.getImageUrl()));
    }/*  ww  w  .  j  av a  2s. c  om*/
    horizontal.addComponent(imag);

    VerticalLayout vlInfo = new VerticalLayout();
    vlInfo.setStyleName("padding-5");
    vlInfo.setWidth("70%");

    horizontal.addComponent(vlInfo);

    lbTitle = new Label(item.getName());
    lbTitle.addStyleName("lb-title");
    vlInfo.addComponent(lbTitle);

    lbIntroduce = new Label(item.getDescription());
    lbIntroduce.setStyleName("lb-description");
    vlInfo.addComponent(lbIntroduce);

    HorizontalLayout htInfo = new HorizontalLayout();
    vlInfo.addComponent(htInfo);

    lbInfo = new Label();
    lbInfo.setCaptionAsHtml(true);
    htInfo.addComponent(lbInfo);

    HorizontalLayout htToolBar = new HorizontalLayout();
    htToolBar.setStyleName("lb-toolbar");
    horizontal.addComponent(htToolBar);

    btnEdit = new Button();
    btnEdit.setIcon(FontAwesome.EDIT);
    btnEdit.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    btnEdit.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED);
    btnEdit.setWidth("25px");
    btnEdit.setHeight("25px");
    htToolBar.addComponent(btnEdit);
    htToolBar.setComponentAlignment(btnEdit, Alignment.BOTTOM_RIGHT);

    btnDelete = new Button();
    btnDelete.setIcon(FontAwesome.TIMES);
    btnDelete.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    btnDelete.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED);
    btnDelete.setWidth("25px");
    btnDelete.setHeight("25px");
    htToolBar.addComponent(btnDelete);
    htToolBar.setComponentAlignment(btnDelete, Alignment.BOTTOM_RIGHT);
}

From source file:com.dungnv.streetfood.ui.TwinColumnUI.java

public final void init() {
    setMargin(true);//from  w  w w  .j  a  v  a  2 s .  co m
    setSpacing(true);
    setWidth(100f, Unit.PERCENTAGE);

    HorizontalLayout hLayout = new HorizontalLayout();
    hLayout.setSpacing(true);
    hLayout.setWidth(100f, Unit.PERCENTAGE);
    addComponent(hLayout);

    msLeft = new MultiSelectUI(searchField);
    msLeft.setWidth(100.0f, Unit.PERCENTAGE);
    hLayout.addComponent(msLeft);
    hLayout.setExpandRatio(msLeft, .45f);

    VerticalLayout vButtonLayout = new VerticalLayout();
    vButtonLayout.setSpacing(true);
    hLayout.addComponent(vButtonLayout);
    hLayout.setExpandRatio(vButtonLayout, .1f);
    hLayout.setComponentAlignment(vButtonLayout, Alignment.BOTTOM_CENTER);

    btnLeftAll = new Button();
    btnLeftAll.setWidth(100f, Unit.PERCENTAGE);
    btnLeftAll.setIcon(FontAwesome.ANGLE_DOUBLE_LEFT);
    vButtonLayout.addComponent(btnLeftAll);

    btnLeft = new Button();
    btnLeft.setWidth(100f, Unit.PERCENTAGE);
    btnLeft.setIcon(FontAwesome.ANGLE_LEFT);
    vButtonLayout.addComponent(btnLeft);

    btnRight = new Button();
    btnRight.setWidth(100f, Unit.PERCENTAGE);
    btnRight.setIcon(FontAwesome.ANGLE_RIGHT);
    vButtonLayout.addComponent(btnRight);

    btnRightAll = new Button();
    btnRightAll.setWidth(100f, Unit.PERCENTAGE);
    btnRightAll.setIcon(FontAwesome.ANGLE_DOUBLE_RIGHT);
    vButtonLayout.addComponent(btnRightAll);

    msRight = new MultiSelectUI(searchField);
    msRight.setWidth(100.0f, Unit.PERCENTAGE);
    hLayout.addComponent(msRight);
    hLayout.setExpandRatio(msRight, .45f);

    HorizontalLayout hlButtonFooter = new HorizontalLayout();
    hlButtonFooter.setSpacing(true);
    addComponent(hlButtonFooter);
    setComponentAlignment(hlButtonFooter, Alignment.BOTTOM_RIGHT);

    btnSave = new Button(BundleUtils.getLanguage("lbl.save"), FontAwesome.SAVE);
    hlButtonFooter.addComponent(btnSave);

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

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

public final void init() {

    layout = new VerticalLayout();
    layout.setSpacing(true);//w ww .  j a  v a  2 s .  com
    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.article.insert"));
    } else if (Constants.ACTION.UPDATE.equals(action)) {
        wizard.addStep(new IntroStep(), BundleUtils.getLanguage("lbl.article.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.ArticleLink.java

private void init() {

    setLocale(VaadinSession.getCurrent().getLocale());

    VerticalLayout vLayout = new VerticalLayout();

    tabSheet = new TabSheet();
    tabSheet.setStyleName(ValoTheme.TABSHEET_EQUAL_WIDTH_TABS);
    tabSheet.setSizeFull();/*from  www  .  ja  v  a2 s .c  o m*/
    vLayout.addComponent(tabSheet);

    // DishArticle
    tuiDish = new TwinColumnUI("name");
    tuiDish.setLeftLabelCaption(BundleUtils.getLanguage("lbl.dish.avaiable.list"));
    tuiDish.setRightLabelCaption(BundleUtils.getLanguage("lbl.dish.selected.list"));
    tabSheet.addTab(tuiDish, BundleUtils.getLanguage("lbl.article.dishArticle.tab"));

    // RestaurantArticle
    tuiRestaurant = new TwinColumnUI("name");
    tuiRestaurant.setLeftLabelCaption(BundleUtils.getLanguage("lbl.restaurant.avaiable.list"));
    tuiRestaurant.setRightLabelCaption(BundleUtils.getLanguage("lbl.restaurant.selected.list"));
    tabSheet.addTab(tuiRestaurant, BundleUtils.getLanguage("lbl.article.restaurantArticle.tab"));

    setContent(tabSheet);
}

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

private void init() {
    layout = new VerticalLayout();
    layout.setSpacing(true);//w  w w  .  java  2s.  c o m
    layout.setMargin(true);

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

    tfTitle = new TextField(BundleUtils.getLanguage("lbl.article.title"));
    tfTitle.setWidth(80.0f, Unit.PERCENTAGE);
    form.addComponent(tfTitle);

    tfShortContent = new TextField(BundleUtils.getLanguage("lbl.article.shortContent"));
    tfShortContent.setWidth(80.0f, Unit.PERCENTAGE);
    form.addComponent(tfShortContent);

    HorizontalLayout hlStatus = new HorizontalLayout();
    hlStatus.setCaption(BundleUtils.getLanguage("lbl.status"));
    hlStatus.addStyleName("horizontal");
    hlStatus.setSpacing(true);
    form.addComponent(hlStatus);

    tagSuggestFieldUI = new TagSuggestFieldUI(false);
    tagSuggestFieldUI.setWidth(80.0f, Unit.PERCENTAGE);
    form.addComponent(tagSuggestFieldUI);

    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.ArticleView.java

public ArticleView() {
    user = (UserDTO) VaadinSession.getCurrent().getAttribute(UserDTO.class.getName());
    setLocale(VaadinSession.getCurrent().getLocale());
    setSizeFull();/*from w ww .jav a 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 ArticleDTO();
    onSearch(true);

}

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

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

    titleLabel = new Label(BundleUtils.getLanguage("menu.ARTICLE"));
    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.article.title.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 ArticleSearchDetail(this);
}

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

public final void init() {

    layout = new VerticalLayout();
    layout.setSpacing(true);//ww  w.ja  v  a2  s .c om
    layout.setMargin(true);

    wizard = new Wizard();
    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.category.insert"));
    } else if (Constants.ACTION.UPDATE.equals(action)) {
        wizard.addStep(new IntroStep(), BundleUtils.getLanguage("lbl.category.update"));
    }
    wizard.addStep(new SecondStep(), "intro");

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

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

private void init() {

    setLocale(VaadinSession.getCurrent().getLocale());
    tabSheet = new TabSheet();
    tabSheet.setStyleName(ValoTheme.TABSHEET_EQUAL_WIDTH_TABS);
    tabSheet.setSizeFull();/*from w ww  . ja  v a  2s . c  o m*/

    VerticalLayout vLayout = new VerticalLayout();

    tuiDish = new TwinColumnUI("name");
    tuiDish.setLeftLabelCaption(BundleUtils.getLanguage("lbl.dish.avaiable.list"));
    tuiDish.setRightLabelCaption(BundleUtils.getLanguage("lbl.dish.selected.list"));
    vLayout.addComponent(tuiDish);

    lsDishLeft = tuiDish.getMsLeft().getLsItem();
    lsDishRight = tuiDish.getMsRight().getLsItem();
    HorizontalLayout hlButtonFooter = new HorizontalLayout();
    hlButtonFooter.setSpacing(true);
    hlButtonFooter.setMargin(true);
    vLayout.addComponent(hlButtonFooter);
    vLayout.setComponentAlignment(hlButtonFooter, Alignment.BOTTOM_RIGHT);

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

    tabSheet.addTab(vLayout, BundleUtils.getLanguage("lbl.category.categoryDish.tab"));
    setContent(tabSheet);
}

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

private void init() {
    layout = new VerticalLayout();
    layout.setSpacing(true);//w  ww.  j  a  v a2  s.  c  om
    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.description"));
    tfDescription.setWidth(80.0f, Unit.PERCENTAGE);
    form.addComponent(tfDescription);

    HorizontalLayout hlStatus = new HorizontalLayout();
    hlStatus.setCaption(BundleUtils.getLanguage("lbl.status"));
    hlStatus.addStyleName("horizontal");
    hlStatus.setSpacing(true);
    form.addComponent(hlStatus);

    cbActive = new CheckBox(BundleUtils.getLanguage("lbl.active"));
    cbActive.setValue(Boolean.TRUE);
    hlStatus.addComponent(cbActive);

    cbInActive = new CheckBox(BundleUtils.getLanguage("lbl.inActive"));
    cbInActive.setValue(Boolean.TRUE);
    hlStatus.addComponent(cbInActive);

    tagSuggestFieldUI = new TagSuggestFieldUI(false);
    tagSuggestFieldUI.setWidth(80.0f, Unit.PERCENTAGE);
    form.addComponent(tagSuggestFieldUI);

    Map<String, LocaleDTO> mapLocale = ClientServiceImpl.getAllLocales();
    if (mapLocale != null && !mapLocale.isEmpty()) {
        List<LocaleDTO> listLocale = new ArrayList<>(mapLocale.values());
        listLocale.stream().map((localeDTO) -> new OptionGroupUI(localeDTO.getLocale()//
                , localeDTO.getId())).forEach((ogLocale) -> {
                    form.addComponent(ogLocale);
                    listOgLocale.add(ogLocale);
                });
    }

    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);

    btnExportExcel = new Button(BundleUtils.getLanguage("lbl.exportExcel"), FontAwesome.FILE_EXCEL_O);
    hlButton.addComponent(btnExportExcel);

    btnExportXML = new Button(BundleUtils.getLanguage("lbl.exportXML"), FontAwesome.FILE_CODE_O);
    hlButton.addComponent(btnExportXML);

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

}