List of usage examples for com.vaadin.ui VerticalLayout setHeight
@Override public void setHeight(float height, Unit unit)
From source file:com.rdonasco.security.user.views.UserListPanelView.java
License:Apache License
@Override public void initWidget() throws WidgetInitalizeException { getAddUserButton().setCaption(I18NResource.localize("Add new user")); getAddUserButton().setIcon(new ThemeResource(SecurityDefaultTheme.ICON_16x16_ADD)); getAddUserButton().setWidth(100, UNITS_PERCENTAGE); getAddUserButton().addStyleName(SecurityDefaultTheme.CSS_SMALL); getRefreshButton().setCaption("Refresh"); getRefreshButton().setIcon(new ThemeResource(SecurityDefaultTheme.ICON_16x16_REFRESH)); getRefreshButton().addStyleName(SecurityDefaultTheme.CSS_SMALL); VerticalLayout content = ((VerticalLayout) getContent()); content.setMargin(true);// www . j a v a 2 s . co m content.setHeight(600, UNITS_PIXELS); content.removeAllComponents(); if (null != getDataViewListTable()) { getDataViewListTable().setSizeFull(); HorizontalLayout buttonLayout = new HorizontalLayout(); buttonLayout.setSpacing(true); buttonLayout.setWidth(100F, UNITS_PERCENTAGE); buttonLayout.addComponent(getAddUserButton()); buttonLayout.addComponent(getRefreshButton()); buttonLayout.setExpandRatio(getAddUserButton(), 1); content.addComponent(buttonLayout); content.addComponent(getDataViewListTable()); content.setExpandRatio(getDataViewListTable(), 1); content.setSpacing(true); } }
From source file:de.escidoc.admintool.view.context.ContextView.java
License:Open Source License
public ContextView(final AdminToolApplication app, final ContextListView contextList, final ContextEditForm contextEditForm, final ContextAddView contextAddView, final PdpRequest pdpRequest) { Preconditions.checkNotNull(app, "App can not be null"); Preconditions.checkNotNull(contextList, "contextList can not be null"); Preconditions.checkNotNull(contextEditForm, "contextEditForm can not be null"); Preconditions.checkNotNull(contextAddView, "contextAddView can not be null"); Preconditions.checkNotNull(pdpRequest, "pdpRequest is null: %s", pdpRequest); this.app = app; this.contextList = contextList; this.contextEditForm = contextEditForm; this.pdpRequest = pdpRequest; final VerticalLayout vLayout = new VerticalLayout(); vLayout.setHeight(100, UNITS_PERCENTAGE); final Label text = new Label("<b>" + "Contexts" + "</b>", Label.CONTENT_XHTML); vLayout.addComponent(text);//from w ww. j a va 2 s .c o m contextList.setSizeFull(); vLayout.addComponent(contextList); vLayout.addComponent(contextList.createControls()); vLayout.setExpandRatio(contextList, 1.0f); setFirstComponent(vLayout); setSplitPosition(ViewConstants.SPLIT_POSITION_IN_PERCENT); setOrientation(ORIENTATION_HORIZONTAL); setSecondComponent(new Label("")); }
From source file:de.fatalix.bookery.view.admin.AdminView.java
License:Open Source License
public HorizontalLayout createUserManagement() { userManagementLayout = new HorizontalLayout(); userManagementLayout.addStyleName("wrapping"); userManagementLayout.setSpacing(true); userManagementLayout.setMargin(true); Label label = new Label("Add new user..."); label.setSizeUndefined();// w w w . j a v a2 s .c om label.addStyleName(ValoTheme.LABEL_LARGE); VerticalLayout emptyLayout = new VerticalLayout(label); emptyLayout.addStyleName("dashed-border"); emptyLayout.setWidth(380, Unit.PIXELS); emptyLayout.setHeight(220, Unit.PIXELS); emptyLayout.setComponentAlignment(label, Alignment.MIDDLE_CENTER); emptyLayout.addLayoutClickListener(new LayoutEvents.LayoutClickListener() { @Override public void layoutClick(LayoutEvents.LayoutClickEvent event) { AppUser appUser = presenter.createNewUser(); AppUserCard appUserCard = appUserCardInstances.get(); appUserCard.loadAppUser(appUser); appUserCard.addAppUserCardListener(AdminView.this); userManagementLayout.addComponent(appUserCard, userManagementLayout.getComponentCount() - 1); } }); userManagementLayout.addComponent(emptyLayout); return userManagementLayout; }
From source file:de.fatalix.bookery.view.admin.BatchJobsLayout.java
private Layout createEmptyLayout() { Label label = new Label("Add new job..."); label.setSizeUndefined();// w w w . j a va 2 s . com label.addStyleName(ValoTheme.LABEL_LARGE); VerticalLayout emptyLayout = new VerticalLayout(label); emptyLayout.addStyleName("dashed-border"); emptyLayout.setWidth(380, Unit.PIXELS); emptyLayout.setHeight(220, Unit.PIXELS); emptyLayout.setComponentAlignment(label, Alignment.MIDDLE_CENTER); emptyLayout.addLayoutClickListener(new LayoutEvents.LayoutClickListener() { @Override public void layoutClick(LayoutEvents.LayoutClickEvent event) { BatchJobConfiguration jobConfig = presenter.createBatchJob(); BatchJobCard batchJobCard = batchJobCardInstances.get(); batchJobCard.load(jobConfig); batchJobCard.addBatchJobCardListener(BatchJobsLayout.this); batchJobLayout.addComponent(batchJobCard, batchJobLayout.getComponentCount() - 1); } }); return emptyLayout; }
From source file:de.symeda.sormas.ui.dashboard.contacts.ContactsDashboardView.java
License:Open Source License
protected VerticalLayout createEpiCurveLayout() { if (epiCurveComponent == null) { throw new UnsupportedOperationException( "EpiCurveComponent needs to be initialized before calling createEpiCurveLayout"); }/*from ww w .jav a2s. c o m*/ VerticalLayout layout = new VerticalLayout(); layout.setMargin(false); layout.setSpacing(false); layout.setWidth(100, Unit.PERCENTAGE); layout.setHeight(400, Unit.PIXELS); epiCurveComponent.setSizeFull(); layout.addComponent(epiCurveComponent); layout.setExpandRatio(epiCurveComponent, 1); epiCurveComponent.setExpandListener(expanded -> { if (expanded) { dashboardLayout.removeComponent(statisticsComponent); epiCurveAndMapLayout.removeComponent(mapLayout); ContactsDashboardView.this.setHeight(100, Unit.PERCENTAGE); epiCurveAndMapLayout.setHeight(100, Unit.PERCENTAGE); epiCurveLayout.setSizeFull(); } else { dashboardLayout.addComponent(statisticsComponent, 1); epiCurveAndMapLayout.addComponent(mapLayout, 1); epiCurveLayout.setHeight(400, Unit.PIXELS); ContactsDashboardView.this.setHeightUndefined(); epiCurveAndMapLayout.setHeightUndefined(); } }); return layout; }
From source file:de.symeda.sormas.ui.dashboard.contacts.ContactsDashboardView.java
License:Open Source License
protected VerticalLayout createMapLayout() { if (mapComponent == null) { throw new UnsupportedOperationException( "MapComponent needs to be initialized before calling createMapLayout"); }/* w w w.j a va 2 s. c o m*/ VerticalLayout layout = new VerticalLayout(); layout.setMargin(false); layout.setSpacing(false); layout.setWidth(100, Unit.PERCENTAGE); layout.setHeight(555, Unit.PIXELS); mapComponent.setSizeFull(); layout.addComponent(mapComponent); layout.setExpandRatio(mapComponent, 1); mapComponent.setExpandListener(expanded -> { if (expanded) { dashboardLayout.removeComponent(statisticsComponent); epiCurveAndMapLayout.removeComponent(epiCurveLayout); ContactsDashboardView.this.setHeight(100, Unit.PERCENTAGE); epiCurveAndMapLayout.setHeight(100, Unit.PERCENTAGE); mapLayout.setSizeFull(); } else { dashboardLayout.addComponent(statisticsComponent, 1); epiCurveAndMapLayout.addComponent(epiCurveLayout, 0); mapLayout.setHeight(400, Unit.PIXELS); ContactsDashboardView.this.setHeightUndefined(); epiCurveAndMapLayout.setHeightUndefined(); } }); return layout; }
From source file:de.symeda.sormas.ui.dashboard.surveillance.DiseaseTileComponent.java
License:Open Source License
void addTopLayout(Disease disease, Long casesCount, boolean isOutbreak) { HorizontalLayout layout = new HorizontalLayout(); layout.setMargin(false);//from w w w . ja v a 2 s. c o m layout.setSpacing(false); CssStyles.style(layout, CssStyles.getDiseaseColor(disease)); layout.setHeight(75, Unit.PIXELS); layout.setWidth(100, Unit.PERCENTAGE); VerticalLayout nameAndOutbreakLayout = new VerticalLayout(); nameAndOutbreakLayout.setMargin(false); nameAndOutbreakLayout.setSpacing(false); nameAndOutbreakLayout.setHeight(100, Unit.PERCENTAGE); nameAndOutbreakLayout.setWidth(100, Unit.PERCENTAGE); HorizontalLayout nameLayout = new HorizontalLayout(); nameLayout.setMargin(false); nameLayout.setSpacing(false); nameLayout.setWidth(100, Unit.PERCENTAGE); nameLayout.setHeight(100, Unit.PERCENTAGE); Label nameLabel = new Label(disease.toShortString()); CssStyles.style(nameLabel, CssStyles.LABEL_WHITE, nameLabel.getValue().length() > 12 ? CssStyles.LABEL_LARGE : CssStyles.LABEL_XLARGE, CssStyles.LABEL_BOLD, CssStyles.ALIGN_CENTER, CssStyles.LABEL_UPPERCASE); nameLayout.addComponent(nameLabel); nameLayout.setComponentAlignment(nameLabel, Alignment.MIDDLE_CENTER); nameAndOutbreakLayout.addComponent(nameLayout); nameAndOutbreakLayout.setExpandRatio(nameLayout, 1); if (isOutbreak) { HorizontalLayout outbreakLayout = new HorizontalLayout(); outbreakLayout.setMargin(false); outbreakLayout.setSpacing(false); CssStyles.style(outbreakLayout, CssStyles.BACKGROUND_CRITICAL); outbreakLayout.setWidth(100, Unit.PERCENTAGE); outbreakLayout.setHeight(30, Unit.PIXELS); Label outbreakLabel = new Label(I18nProperties.getCaption(Captions.dashboardOutbreak)); CssStyles.style(outbreakLabel, CssStyles.LABEL_WHITE, CssStyles.ALIGN_CENTER, CssStyles.LABEL_UPPERCASE); outbreakLayout.addComponent(outbreakLabel); outbreakLayout.setComponentAlignment(outbreakLabel, Alignment.MIDDLE_CENTER); nameAndOutbreakLayout.addComponent(outbreakLayout); } layout.addComponent(nameAndOutbreakLayout); layout.setExpandRatio(nameAndOutbreakLayout, 1); HorizontalLayout countLayout = new HorizontalLayout(); countLayout.setMargin(false); countLayout.setSpacing(false); CssStyles.style(countLayout, CssStyles.getDiseaseColor(disease), CssStyles.BACKGROUND_DARKER); countLayout.setHeight(100, Unit.PERCENTAGE); countLayout.setWidth(100, Unit.PERCENTAGE); Label countLabel = new Label(casesCount.toString()); CssStyles.style(countLabel, CssStyles.LABEL_WHITE, CssStyles.LABEL_BOLD, CssStyles.LABEL_XXXLARGE, CssStyles.ALIGN_CENTER); countLayout.addComponent(countLabel); countLayout.setComponentAlignment(countLabel, Alignment.MIDDLE_CENTER); layout.addComponent(countLayout); layout.setExpandRatio(countLayout, 0.65f); addComponent(layout); }
From source file:dhbw.ka.mwi.businesshorizon2.ui.initialscreen.InitialScreenViewImpl.java
License:Open Source License
public void createImportButton() { importButton = new VerticalLayout(); importButton.setWidth(150, com.vaadin.terminal.Sizeable.UNITS_PIXELS); importButton.setHeight(80, com.vaadin.terminal.Sizeable.UNITS_PIXELS); importButton.setStyleName("topBarButtonContainer"); UploadReceiver receiver = new UploadReceiver(eventBus); Upload upload = new Upload(null, receiver); upload.setButtonCaption(""); upload.setImmediate(true);// w w w .j a v a 2 s .co m upload.addListener(receiver); upload.setStyleName("importButton"); upload.setWidth(30, com.vaadin.terminal.Sizeable.UNITS_PIXELS); upload.setHeight(30, com.vaadin.terminal.Sizeable.UNITS_PIXELS); Label gap = new Label(); gap.setHeight("5px"); Label label = new Label("Projekte"); label.setStyleName("topBarButtonLabel"); label.setSizeUndefined(); Label label2 = new Label("importieren"); label2.setStyleName("topBarButtonLabel"); label2.setSizeUndefined(); VerticalLayout labelLayout = new VerticalLayout(); labelLayout.setHeight(45, com.vaadin.terminal.Sizeable.UNITS_PIXELS); labelLayout.setWidth(100, UNITS_PERCENTAGE); importButton.addComponent(upload); labelLayout.addComponent(label); labelLayout.addComponent(label2); importButton.addComponent(gap); importButton.addComponent(labelLayout); importButton.setComponentAlignment(upload, Alignment.TOP_CENTER); labelLayout.setComponentAlignment(label, Alignment.MIDDLE_CENTER); labelLayout.setComponentAlignment(label2, Alignment.MIDDLE_CENTER); }
From source file:no.uib.probe.csf.pr.touch.view.core.SearchingField.java
/** * Default constructor to initialize the main attributes. */// www . jav a 2s . com public SearchingField() { this.setSpacing(true); this.setHeightUndefined(); HorizontalLayout searchFieldContainerLayout = new HorizontalLayout(); searchFieldContainerLayout.setWidthUndefined(); searchFieldContainerLayout.setHeight(100, Unit.PERCENTAGE); searchFieldContainerLayout.setSpacing(true); TextField searchField = new TextField(); searchField.setDescription("Search proteins by name or accession"); searchField.setImmediate(true); searchField.setWidth(100, Unit.PIXELS); searchField.setHeight(18, Unit.PIXELS); searchField.setInputPrompt("Search..."); searchFieldContainerLayout.addComponent(searchField); searchField.setTextChangeTimeout(1500); searchField.setStyleName(ValoTheme.TEXTFIELD_SMALL); searchField.addStyleName(ValoTheme.TEXTFIELD_TINY); final Button b = new Button(); searchField.setTextChangeEventMode(AbstractTextField.TextChangeEventMode.LAZY); searchField.addShortcutListener(new Button.ClickShortcut(b, ShortcutListener.KeyCode.ENTER)); VerticalLayout searchingBtn = new VerticalLayout(); searchingBtn.setWidth(22, Unit.PIXELS); searchingBtn.setHeight(18, Unit.PIXELS); searchingBtn.setStyleName("tablesearchingbtn"); searchFieldContainerLayout.addComponent(searchingBtn); searchFieldContainerLayout.setComponentAlignment(searchingBtn, Alignment.TOP_CENTER); this.addComponent(searchFieldContainerLayout); this.setComponentAlignment(searchFieldContainerLayout, Alignment.TOP_CENTER); searchingCommentLabel = new Label(); searchingCommentLabel.setWidth(100, Unit.PERCENTAGE); searchingCommentLabel.setHeight(23, Unit.PIXELS); searchingCommentLabel.addStyleName(ValoTheme.LABEL_BOLD); searchingCommentLabel.addStyleName(ValoTheme.LABEL_SMALL); searchingCommentLabel.addStyleName(ValoTheme.LABEL_TINY); this.addComponent(searchingCommentLabel); this.setComponentAlignment(searchingCommentLabel, Alignment.TOP_CENTER); searchingBtn.addLayoutClickListener((LayoutEvents.LayoutClickEvent event) -> { b.click(); }); searchField.addTextChangeListener((FieldEvents.TextChangeEvent event) -> { SearchingField.this.textChanged(event.getText()); }); b.addClickListener((Button.ClickEvent event) -> { SearchingField.this.textChanged(searchField.getValue()); }); }
From source file:org.eclipse.hawkbit.ui.menu.DashboardMenu.java
License:Open Source License
private VerticalLayout buildMenuItems() { final VerticalLayout menuItemsLayout = new VerticalLayout(); menuItemsLayout.addStyleName("valo-menuitems"); menuItemsLayout.setHeight(100.0F, Unit.PERCENTAGE); final List<DashboardMenuItem> accessibleViews = getAccessibleViews(); if (accessibleViews.isEmpty()) { accessibleViewsEmpty = true;//from w ww . j a v a 2s.co m return menuItemsLayout; } initialViewName = accessibleViews.get(0).getViewName(); for (final DashboardMenuItem view : accessibleViews) { final ValoMenuItemButton menuItemComponent = new ValoMenuItemButton(view); menuButtons.add(menuItemComponent); menuItemsLayout.addComponent(buildLabelWrapper(menuItemComponent, view.getNotificationUnreadLabel())); } return menuItemsLayout; }