List of usage examples for com.vaadin.ui HorizontalLayout addComponents
@Override public void addComponents(Component... components)
From source file:me.uni.emuseo.view.common.paging.PagedTableLayout.java
License:Open Source License
protected void buildNavPanel() { navigationLayout = new HorizontalLayout(); HorizontalLayout extraLayout = new HorizontalLayout(); createItemsPeerPageComboBox();//from w w w.j ava 2 s . co m itemsPerPageComboBox.setWidth(100, Unit.PIXELS); middleLayout = new HorizontalLayout(); middleLayout.setSpacing(true); buildNavButtons(); extraLayout.addComponent(firstPageButton); extraLayout.addComponent(prevPageButton); extraLayout.addComponents(middleLayout); extraLayout.addComponent(nextPageButton); extraLayout.addComponent(lastPageButton); extraLayout.setSpacing(true); navigationLayout.addComponent(itemsPerPageComboBox); navigationLayout.addComponent(extraLayout); navigationLayout.setExpandRatio(itemsPerPageComboBox, 0); navigationLayout.setExpandRatio(extraLayout, 1); navigationLayout.setComponentAlignment(itemsPerPageComboBox, Alignment.MIDDLE_LEFT); navigationLayout.setComponentAlignment(extraLayout, Alignment.BOTTOM_CENTER); navigationLayout.setWidth(100, Unit.PERCENTAGE); navigationLayout.setMargin(new MarginInfo(false, true, false, true)); }
From source file:org.eclipse.hawkbit.ui.artifacts.upload.UploadResultWindow.java
License:Open Source License
private void createLayout() { final HorizontalLayout footer = new HorizontalLayout(); footer.setSizeUndefined();// w w w . j a va2 s.com footer.addStyleName("confirmation-window-footer"); footer.setSpacing(true); footer.setMargin(false); footer.addComponents(closeBtn); footer.setComponentAlignment(closeBtn, Alignment.TOP_CENTER); final VerticalLayout uploadResultDetails = new VerticalLayout(); uploadResultDetails.setWidth(SPUIDefinitions.MIN_UPLOAD_CONFIRMATION_POPUP_WIDTH + "px"); uploadResultDetails.addStyleName("confirmation-popup"); uploadResultDetails.addComponent(uploadResultTable); uploadResultDetails.setComponentAlignment(uploadResultTable, Alignment.MIDDLE_CENTER); uploadResultDetails.addComponent(footer); uploadResultDetails.setComponentAlignment(footer, Alignment.MIDDLE_CENTER); uploadResultsWindow = new Window(); uploadResultsWindow.setContent(uploadResultDetails); uploadResultsWindow.setResizable(Boolean.FALSE); uploadResultsWindow.setClosable(Boolean.FALSE); uploadResultsWindow.setDraggable(Boolean.TRUE); uploadResultsWindow.setModal(true); uploadResultsWindow.setCaption(SPUILabelDefinitions.UPLOAD_RESULT); uploadResultsWindow.addStyleName(SPUIStyleDefinitions.CONFIRMATION_WINDOW_CAPTION); }
From source file:org.eclipse.hawkbit.ui.common.AbstractMetadataPopupLayout.java
License:Open Source License
private void buildLayout() { final HorizontalLayout headerLayout = new HorizontalLayout(); headerLayout.addStyleName(SPUIStyleDefinitions.WIDGET_TITLE); headerLayout.setSpacing(false);/* www . j av a 2 s .co m*/ headerLayout.setMargin(false); headerLayout.setSizeFull(); headerLayout.addComponent(headerCaption); if (hasCreatePermission()) { headerLayout.addComponents(addIcon); headerLayout.setComponentAlignment(addIcon, Alignment.MIDDLE_RIGHT); } headerLayout.setExpandRatio(headerCaption, 1.0F); final HorizontalLayout headerWrapperLayout = new HorizontalLayout(); headerWrapperLayout .addStyleName("bordered-layout" + " " + "no-border-bottom" + " " + "metadata-table-margin"); headerWrapperLayout.addComponent(headerLayout); headerWrapperLayout.setWidth("100%"); headerLayout.setHeight("30px"); final VerticalLayout tableLayout = new VerticalLayout(); tableLayout.setSizeFull(); tableLayout.setHeight("100%"); tableLayout.addComponent(headerWrapperLayout); tableLayout.addComponent(metaDataGrid); tableLayout.addStyleName("table-layout"); tableLayout.setExpandRatio(metaDataGrid, 1.0F); final VerticalLayout metadataFieldsLayout = createMetadataFieldsLayout(); mainLayout = new HorizontalLayout(); mainLayout.addComponent(tableLayout); mainLayout.addComponent(metadataFieldsLayout); mainLayout.setExpandRatio(tableLayout, 0.5F); mainLayout.setExpandRatio(metadataFieldsLayout, 0.5F); mainLayout.setSizeFull(); mainLayout.setSpacing(true); setCompositionRoot(mainLayout); setSizeFull(); }
From source file:org.eclipse.hawkbit.ui.common.grid.AbstractGridHeader.java
License:Open Source License
private void buildLayout() { final HorizontalLayout titleFilterIconsLayout = createHeaderFilterIconLayout(); titleFilterIconsLayout.addComponents(headerCaptionLayout); if (isAllowSearch() && isRollout()) { titleFilterIconsLayout.addComponents(searchField, searchResetIcon); titleFilterIconsLayout.setExpandRatio(headerCaptionLayout, 0.3F); titleFilterIconsLayout.setExpandRatio(searchField, 0.7F); }/*w w w . ja v a 2 s . c om*/ if (hasCreatePermission() && isRollout()) { titleFilterIconsLayout.addComponent(addButton); titleFilterIconsLayout.setComponentAlignment(addButton, Alignment.TOP_LEFT); } if (showCloseButton()) { titleFilterIconsLayout.addComponent(closeButton); titleFilterIconsLayout.setComponentAlignment(closeButton, Alignment.TOP_RIGHT); } titleFilterIconsLayout.setHeight("40px"); addComponent(titleFilterIconsLayout); addStyleName("bordered-layout"); addStyleName("no-border-bottom"); }
From source file:org.jumpmind.vaadin.ui.common.ResizableWindow.java
License:Open Source License
protected HorizontalLayout buildButtonFooter(Button[] toTheLeftButtons, Button... toTheRightButtons) { HorizontalLayout footer = new HorizontalLayout(); footer.setWidth("100%"); footer.setSpacing(true);//from w ww .j a v a2s. c om footer.addStyleName(ValoTheme.WINDOW_BOTTOM_TOOLBAR); if (toTheLeftButtons != null) { footer.addComponents(toTheLeftButtons); } Label footerText = new Label(""); footerText.setSizeUndefined(); footer.addComponents(footerText); footer.setExpandRatio(footerText, 1); if (toTheRightButtons != null) { footer.addComponents(toTheRightButtons); } return footer; }
From source file:uk.co.intec.keyDatesApp.components.Pager.java
License:Apache License
/** * Load pager sizes buttons/*ww w. j a va2 s.c om*/ * * @return HorizontalLayout containing the pager sizes buttons */ public HorizontalLayout loadPagerSizesButtons() { final HorizontalLayout panel = new HorizontalLayout(); for (final Sizes size : getAvailableSizes()) { final Button pageSizeLink = new Button(); pageSizeLink.setCaption(Integer.toString(size.getValue())); pageSizeLink.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED); pageSizeLink.addStyleName(ValoTheme.BUTTON_TINY); pageSizeLink.addClickListener(new ClickListener() { private static final long serialVersionUID = 1L; /* * (non-Javadoc) * * @see * com.vaadin.ui.Button.ClickListener#buttonClick(com.vaadin.ui. * Button.ClickEvent) */ @Override public void buttonClick(ClickEvent event) { getWrappedView().setCount(size.getValue()); getWrappedView().redrawContents(); updatePagerSizeButtonStyles(); loadPagerPagesButtons(); } }); getPagerSizeButtons().put(size, pageSizeLink); panel.addComponents(pageSizeLink); if (getAvailableSizes().indexOf(size) < (getAvailableSizes().size() - 1)) { final Label spacer = new Label("|"); panel.addComponent(spacer); } } updatePagerSizeButtonStyles(); return panel; }