Example usage for com.vaadin.ui HorizontalLayout addComponent

List of usage examples for com.vaadin.ui HorizontalLayout addComponent

Introduction

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

Prototype

@Override
public void addComponent(Component c) 

Source Link

Document

Add a component into this container.

Usage

From source file:com.dungnv.streetfood.ui.CategoryItemUI.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()));
    }/*w  w  w  .  j a  v a2 s. co  m*/
    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");
    if ("1".equals(item.getCategoryStatus())) {
        lbTitle.addStyleName("lb-status-active");
    } else {
        lbTitle.addStyleName("lb-status-inActive");
    }
    vlInfo.addComponent(lbTitle);

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

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

    btnLock = new Button();
    if ("1".equals(item.getCategoryStatus())) {
        btnLock.setIcon(FontAwesome.LOCK);
    } else {
        btnLock.setIcon(FontAwesome.UNLOCK);
    }

    btnLock.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    btnLock.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED);
    btnLock.setWidth("25px");
    btnLock.setHeight("25px");
    htToolBar.addComponent(btnLock);
    htToolBar.setComponentAlignment(btnLock, Alignment.BOTTOM_RIGHT);

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

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

private final void init() {

    setWidth("100%");
    setStyleName("item-search-box");
    HorizontalLayout layout = new HorizontalLayout();
    layout.setSpacing(true);//from   w  ww  . j  av  a  2 s  .c o  m
    this.addComponent(layout);

    FormLayout form = new FormLayout();
    //        form.setWidth("100%");
    form.setMargin(false);
    layout.addComponent(form);
    layout.setComponentAlignment(form, Alignment.MIDDLE_CENTER);

    cbRecordPerPage = new ComboBox();
    cbRecordPerPage.setWidth("65px");
    cbRecordPerPage.setStyleName(ValoTheme.COMBOBOX_TINY);
    cbRecordPerPage.setCaption(BundleUtils.getLanguage("lbl.recordsPerPage"));
    cbRecordPerPage.setTextInputAllowed(false);
    cbRecordPerPage.addItem(10);
    cbRecordPerPage.addItem(20);
    cbRecordPerPage.addItem(30);
    cbRecordPerPage.addItem(50);
    cbRecordPerPage.addItem(100);
    cbRecordPerPage.addItem(200);
    cbRecordPerPage.select(10);
    form.addComponent(cbRecordPerPage);
    cbRecordPerPage.setNullSelectionAllowed(false);

    btnFastBackward = new Button();
    btnFastBackward.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    btnFastBackward.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED);
    btnFastBackward.setIcon(FontAwesome.FAST_BACKWARD);
    layout.addComponent(btnFastBackward);
    layout.setComponentAlignment(btnFastBackward, Alignment.MIDDLE_CENTER);

    btnBackward = new Button();
    btnBackward.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    btnBackward.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED);
    btnBackward.setIcon(FontAwesome.BACKWARD);
    layout.addComponent(btnBackward);
    layout.setComponentAlignment(btnBackward, Alignment.MIDDLE_CENTER);

    cbPaged = new ComboBox();
    cbPaged.setTextInputAllowed(false);
    for (int i = 1; i <= pageCount; i++) {
        cbPaged.addItem(i);
    }

    cbPaged.setNullSelectionAllowed(false);
    cbPaged.select(1);
    cbPaged.addStyleName(ValoTheme.COMBOBOX_TINY);
    cbPaged.setWidth("60px");
    layout.addComponent(cbPaged);
    layout.setComponentAlignment(cbPaged, Alignment.MIDDLE_CENTER);

    btnFoward = new Button();
    btnFoward.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    btnFoward.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED);
    btnFoward.setIcon(FontAwesome.FORWARD);
    layout.addComponent(btnFoward);
    layout.setComponentAlignment(btnFoward, Alignment.MIDDLE_CENTER);

    btnFastFoward = new Button();
    btnFastFoward.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    btnFastFoward.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED);
    btnFastFoward.setIcon(FontAwesome.FAST_FORWARD);
    layout.addComponent(btnFastFoward);
    layout.setComponentAlignment(btnFastFoward, Alignment.MIDDLE_CENTER);
    enableComponent();
}

From source file:com.dungnv.streetfood.ui.DishItemUI.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()));
    }//  w w w . jav  a 2 s  .co m
    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);

    lbDesc = new Label(item.getShortDescription());
    lbDesc.setStyleName("lb-description");
    vlInfo.addComponent(lbDesc);

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

    btnLock = new Button();
    if ("1".equals(item.getDishStatus())) {
        btnLock.setIcon(FontAwesome.LOCK);
    } else {
        btnLock.setIcon(FontAwesome.UNLOCK);
    }

    btnLock.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    btnLock.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED);
    btnLock.setWidth("25px");
    btnLock.setHeight("25px");
    htToolBar.addComponent(btnLock);
    htToolBar.setComponentAlignment(btnLock, Alignment.BOTTOM_RIGHT);

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

    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.RestaurantItemUI.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()));
    }/* www.java 2  s. co m*/
    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.getAddress());
    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);

    btnLock = new Button();
    if ("1".equals(item.getRestaurantStatus())) {
        btnLock.setIcon(FontAwesome.LOCK);
    } else {
        btnLock.setIcon(FontAwesome.UNLOCK);
    }

    btnLock.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    btnLock.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED);
    btnLock.setWidth("25px");
    btnLock.setHeight("25px");
    htToolBar.addComponent(btnLock);
    htToolBar.setComponentAlignment(btnLock, Alignment.BOTTOM_RIGHT);

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

    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.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()));
    }/*from w w w .  j  a v  a2  s  . c  o m*/
    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);//  w w w  . j a  va2 s.  c  om
    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.ArticleSearchDetail.java

private void init() {
    layout = new VerticalLayout();
    layout.setSpacing(true);/*from   w w w  .j av a2 s . 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

private void init() {
    header = new VerticalLayout();
    header.addStyleName("viewheader");
    header.setSpacing(true);/*  www.j  a  v  a2  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.CategoryLink.java

private void init() {

    setLocale(VaadinSession.getCurrent().getLocale());
    tabSheet = new TabSheet();
    tabSheet.setStyleName(ValoTheme.TABSHEET_EQUAL_WIDTH_TABS);
    tabSheet.setSizeFull();/* www. j  a  v  a2 s  .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);/*from   w w  w.  j  a  v a2s.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);

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

}