List of usage examples for com.vaadin.ui VerticalLayout setHeight
@Override public void setHeight(String height)
From source file:fr.univlorraine.mondossierweb.views.FavorisMobileView.java
License:Apache License
/** * Initialise la vue/*from ww w. j av a 2 s.c o m*/ */ @PostConstruct public void init() { //On vrifie le droit d'accder la vue if (UI.getCurrent() instanceof MdwTouchkitUI && userController.isEnseignant()) { removeAllComponents(); /* Style */ setSizeFull(); liste_types_inscrits = new LinkedList<String>(); liste_types_inscrits.add("ELP"); liste_types_inscrits.add("VET"); liste_type_arbo = new LinkedList<String>(); liste_type_arbo.add("CMP"); liste_type_arbo.add("VET"); List<Favoris> lfav = favorisController.getFavoris(); //NAVBAR HorizontalLayout navbar = new HorizontalLayout(); navbar.setSizeFull(); navbar.setHeight("40px"); navbar.setStyleName("navigation-bar"); //Bouton info infoButton = new Button(); infoButton.setIcon(FontAwesome.INFO); infoButton.setStyleName("v-nav-button"); infoButton.addClickListener(e -> { /** * NOUVELLE VERSION */ Notification note = new Notification( applicationContext.getMessage("helpWindowMobile.text.enseignant", null, getLocale()), "", Notification.TYPE_TRAY_NOTIFICATION, true); note.setPosition(Position.MIDDLE_CENTER); note.setDelayMsec(6000); note.show(UI.getCurrent().getPage()); /** * ANCIENNE VERSION */ /* //afficher message HelpMobileWindow hbw = new HelpMobileWindow(applicationContext.getMessage("helpWindowMobile.text.enseignant", null, getLocale()),applicationContext.getMessage("helpWindow.defaultTitle", null, getLocale()),false); UI.getCurrent().addWindow(hbw); */ }); navbar.addComponent(infoButton); navbar.setComponentAlignment(infoButton, Alignment.MIDDLE_LEFT); //Title Label labelFav = new Label(applicationContext.getMessage(NAME + ".title.label", null, getLocale())); labelFav.setStyleName("v-label-navbar"); navbar.addComponent(labelFav); navbar.setComponentAlignment(labelFav, Alignment.MIDDLE_CENTER); //Bouton Search Button searchButton = new Button(); searchButton.setIcon(FontAwesome.SEARCH); searchButton.setStyleName("v-nav-button"); navbar.addComponent(searchButton); navbar.setComponentAlignment(searchButton, Alignment.MIDDLE_RIGHT); searchButton.addClickListener(e -> { ((MdwTouchkitUI) MdwTouchkitUI.getCurrent()).navigateToRecherche(NAME); }); navbar.setExpandRatio(labelFav, 1); addComponent(navbar); VerticalLayout globalLayout = new VerticalLayout(); globalLayout.setSizeFull(); globalLayout.setSpacing(true); globalLayout.setMargin(true); FormLayout labelLayout = new FormLayout(); labelLayout.setSizeFull(); labelLayout.setMargin(false); labelLayout.setSpacing(false); Label infoLabel = new Label(applicationContext.getMessage(NAME + ".info.label", null, getLocale())); infoLabel.setStyleName(ValoTheme.LABEL_SMALL); infoLabel.setIcon(FontAwesome.INFO_CIRCLE); infoLabel.setWidth("100%"); labelLayout.addComponent(infoLabel); globalLayout.addComponent(labelLayout); if (lfav != null && lfav.size() > 0) { if (favorisContientVet(lfav)) { Panel vetPanel = new Panel( applicationContext.getMessage(NAME + ".vetpanel.title", null, getLocale())); vetPanel.setStyleName("centertitle-panel"); vetPanel.addStyleName("v-colored-panel-caption"); vetPanel.setSizeFull(); VerticalLayout vetLayout = new VerticalLayout(); vetLayout.setSizeFull(); vetLayout.setHeight(null); int i = 0; for (Favoris fav : lfav) { if (fav.getId().getTypfav().equals(Utils.VET)) { i++; HorizontalLayout favVetLayout = new HorizontalLayout(); favVetLayout.setSizeFull(); favVetLayout.setMargin(true); favVetLayout.setSpacing(true); favVetLayout.setStyleName("v-layout-multiline"); favVetLayout.setWidth("100%"); favVetLayout.setHeight("100%"); Button codeButton = new Button(fav.getId().getIdfav()); codeButton.setCaption(fav.getId().getIdfav()); Utils.setButtonStyle(codeButton); codeButton.setWidth("90px"); codeButton.addClickListener(e -> { accessToDetail(fav.getId().getIdfav(), fav.getId().getTypfav()); }); Button libButton = new Button(favorisController.getLibObjFavori(fav.getId().getTypfav(), fav.getId().getIdfav())); Utils.setButtonStyle(libButton); libButton.setHeight("100%"); libButton.setWidth("100%"); libButton.addClickListener(e -> { accessToDetail(fav.getId().getIdfav(), fav.getId().getTypfav()); }); favVetLayout.addComponent(codeButton); //favVetLayout.setComponentAlignment(codeButton, Alignment.MIDDLE_CENTER); favVetLayout.addComponent(libButton); favVetLayout.setComponentAlignment(libButton, Alignment.MIDDLE_CENTER); favVetLayout.setExpandRatio(libButton, 1); vetLayout.addComponent(favVetLayout); if (i > 1) { favVetLayout.addStyleName("line-separator"); } } } vetPanel.setContent(vetLayout); globalLayout.addComponent(vetPanel); } if (favorisContientElp(lfav)) { Panel elpPanel = new Panel( applicationContext.getMessage(NAME + ".elppanel.title", null, getLocale())); elpPanel.setStyleName("centertitle-panel"); elpPanel.addStyleName("v-colored-panel-caption"); elpPanel.setSizeFull(); VerticalLayout elpLayout = new VerticalLayout(); elpLayout.setSizeFull(); elpLayout.setHeight(null); int i = 0; for (Favoris fav : lfav) { if (fav.getId().getTypfav().equals(Utils.ELP)) { i++; HorizontalLayout favElpLayout = new HorizontalLayout(); favElpLayout.setSizeFull(); favElpLayout.setMargin(true); favElpLayout.setSpacing(true); favElpLayout.setStyleName("v-layout-multiline"); favElpLayout.setWidth("100%"); favElpLayout.setHeight("100%"); Button codeButton = new Button(fav.getId().getIdfav()); Utils.setButtonStyle(codeButton); codeButton.setWidth("90px"); codeButton.addClickListener(e -> { accessToDetail(fav.getId().getIdfav(), fav.getId().getTypfav()); }); Button libButton = new Button(favorisController.getLibObjFavori(fav.getId().getTypfav(), fav.getId().getIdfav())); Utils.setButtonStyle(libButton); libButton.setHeight("100%"); libButton.setWidth("100%"); libButton.addClickListener(e -> { accessToDetail(fav.getId().getIdfav(), fav.getId().getTypfav()); }); favElpLayout.addComponent(codeButton); favElpLayout.addComponent(libButton); favElpLayout.setComponentAlignment(libButton, Alignment.MIDDLE_CENTER); favElpLayout.setExpandRatio(libButton, 1); elpLayout.addComponent(favElpLayout); if (i > 1) { favElpLayout.addStyleName("line-separator"); } } } elpPanel.setContent(elpLayout); globalLayout.addComponent(elpPanel); } } labelAucunFavoriLayout = new HorizontalLayout(); labelAucunFavoriLayout.setMargin(true); labelAucunFavoriLayout.setSizeFull(); Button aucunFavoris = new Button( applicationContext.getMessage(NAME + ".favoris.aucun", null, getLocale())); aucunFavoris.setStyleName("v-nav-button"); aucunFavoris.addStyleName(ValoTheme.BUTTON_LINK); aucunFavoris.addClickListener(e -> { ((MdwTouchkitUI) MdwTouchkitUI.getCurrent()).navigateToRecherche(NAME); }); labelAucunFavoriLayout.addComponent(aucunFavoris); labelAucunFavoriLayout.setVisible(false); globalLayout.addComponent(labelAucunFavoriLayout); if (lfav == null || lfav.size() == 0) { labelAucunFavoriLayout.setVisible(true); } //addComponent(globalLayout); contentLayout.setStyleName("v-scrollableelement"); contentLayout.addComponent(globalLayout); addComponent(contentLayout); setExpandRatio(contentLayout, 1); } }
From source file:fr.univlorraine.mondossierweb.views.ListeInscritsView.java
License:Apache License
private void displayTrombinoscope() { List<Inscrit> linscrits = MainUI.getCurrent().getListeInscrits(); if (trombiLayout != null) { trombiLayout.removeAllComponents(); } else {/*from w ww. ja v a 2 s . com*/ trombiLayout = new GridLayout(); trombiLayout.setColumns(5); trombiLayout.setWidth("100%"); trombiLayout.setHeight(null); trombiLayout.setSpacing(true); } for (Inscrit inscrit : linscrits) { if (listecodind.contains(inscrit.getCod_ind())) { VerticalLayout photoLayout = new VerticalLayout(); photoLayout.setId(inscrit.getCod_ind()); photoLayout.setHeight("100%"); if (inscrit.getUrlphoto() != null) { //Button fotoEtu=new Button(); Image fotoEtudiant = new Image(null, new ExternalResource(inscrit.getUrlphoto())); fotoEtudiant.setWidth("120px"); fotoEtudiant.setStyleName(ValoTheme.BUTTON_LINK); fotoEtudiant.addClickListener(e -> { rechercheController.accessToDetail(inscrit.getCod_etu().toString(), Utils.TYPE_ETU, null); }); photoLayout.addComponent(fotoEtudiant); //photoLayout.addComponent(fotoEtu); photoLayout.setComponentAlignment(fotoEtudiant, Alignment.MIDDLE_CENTER); photoLayout.setExpandRatio(fotoEtudiant, 1); } VerticalLayout nomCodeLayout = new VerticalLayout(); nomCodeLayout.setSizeFull(); nomCodeLayout.setSpacing(false); Button btnNomEtudiant = new Button(inscrit.getPrenom() + " " + inscrit.getNom()); btnNomEtudiant.setSizeFull(); btnNomEtudiant.setStyleName(ValoTheme.BUTTON_BORDERLESS); btnNomEtudiant.addStyleName("link"); btnNomEtudiant.addStyleName("v-link"); nomCodeLayout.addComponent(btnNomEtudiant); btnNomEtudiant.addClickListener(e -> { rechercheController.accessToDetail(inscrit.getCod_etu().toString(), Utils.TYPE_ETU, null); }); nomCodeLayout.setComponentAlignment(btnNomEtudiant, Alignment.MIDDLE_CENTER); //nomCodeLayout.setExpandRatio(btnNomEtudiant, 1); Label codetuLabel = new Label(inscrit.getCod_etu()); codetuLabel.setSizeFull(); codetuLabel.setStyleName(ValoTheme.LABEL_TINY); codetuLabel.addStyleName("label-centre"); nomCodeLayout.addComponent(codetuLabel); nomCodeLayout.setComponentAlignment(codetuLabel, Alignment.TOP_CENTER); photoLayout.addComponent(nomCodeLayout); trombiLayout.addComponent(photoLayout); trombiLayout.setComponentAlignment(photoLayout, Alignment.MIDDLE_CENTER); } } }
From source file:gov.va.ds4p.ds4pmobileportal.ui.eHealthDirect.java
License:Open Source License
private Panel getDropArea() { Panel p = new Panel(); p.setStyleName(Runo.PANEL_LIGHT);// w w w . j a v a2 s. c om VerticalLayout v = (VerticalLayout) p.getContent(); v.setHeight("100%"); v.addComponent(getDropPanel()); v.addComponent(label1); v.addComponent(label2); v.addComponent(label3); return p; }
From source file:gov.va.ds4p.ds4pmobileportal.ui.eHealthDirect.java
License:Open Source License
private Panel createHTMLVersionOfC32(String c32) { Panel p = new Panel(); p.setStyleName(Runo.PANEL_LIGHT);/*from www .jav a 2 s . co m*/ VerticalLayout v = (VerticalLayout) p.getContent(); v.setSpacing(true); v.setHeight("100%"); v.setWidth("100%"); Label l = new Label(); l.setContentMode(Label.CONTENT_XHTML); l.setValue(getHTMLVersionOfCDA(c32)); v.addComponent(l); return p; }
From source file:gov.va.ds4p.ds4pmobileportal.ui.LoginView.java
License:Open Source License
private Panel getLoginPanel() { Panel p = new Panel(); VerticalLayout v = (VerticalLayout) p.getContent(); v.setSpacing(true);/* www . ja va 2 s. c o m*/ v.setHeight("300px"); Label sandi = new Label(""); sandi.setIcon(new ThemeResource("onc_s_and_i_logo.png")); v.addComponent(sandi); final TextField username = new TextField("User Name:"); final PasswordField userpass = new PasswordField("Password:"); username.setWidth("500px"); userpass.setWidth("500px"); v.addComponent(username); v.addComponent(userpass); HorizontalLayout h = new HorizontalLayout(); h.setSpacing(true); h.setWidth("500px"); Button okBTN = new Button("Ok"); Label l = new Label(""); l.setIcon(new ThemeResource("header-logo.png")); h.addComponent(okBTN); h.addComponent(l); v.addComponent(h); okBTN.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { userN = (String) username.getValue(); userP = (String) userpass.getValue(); authenticate(); if (userProfile == null) { getWindow().showNotification("Login Error", "Incorrect username or password combination.", Window.Notification.TYPE_WARNING_MESSAGE); } else { AdminContext.getSessionAttributes().setUserProfile(userProfile); ((MyVaadinApplication) getApplication()).loginComplete(); } } }); okBTN.setImmediate(true); return p; }
From source file:jp.primecloud.auto.ui.ServerDesc.java
License:Open Source License
public ServerDesc() { setWidth("100%"); setHeight("100%"); setCaption(ViewProperties.getCaption("panel.serverDesc")); addStyleName(Reindeer.PANEL_LIGHT);//from w ww .ja v a 2s . c om addStyleName("server-desc-panel"); VerticalLayout layout = (VerticalLayout) getContent(); layout.setWidth("100%"); layout.setHeight("100%"); layout.setMargin(false); layout.setSpacing(false); layout.addStyleName("server-desc-layout"); tabDesc.addStyleName(Reindeer.TABSHEET_BORDERLESS); tabDesc.setWidth("100%"); tabDesc.setHeight("100%"); tabDesc.addTab(serverDescBasic, ViewProperties.getCaption("tab.serverDescBasic"), Icons.BASIC.resource()); tabDesc.addTab(serverDescDetail, ViewProperties.getCaption("tab.serverDescDetail"), Icons.DETAIL.resource()); // tabDesc.addListener(TabSheet.SelectedTabChangeEvent.class, this, "selectedTabChange"); addComponent(tabDesc); }
From source file:jp.primecloud.auto.ui.ServerDescBasic.java
License:Open Source License
public ServerDescBasic() { setHeight("100%"); addStyleName(Reindeer.PANEL_LIGHT);//from w ww . ja va 2s. c o m VerticalLayout panel = (VerticalLayout) getContent(); panel.setWidth("100%"); panel.setHeight("100%"); panel.setMargin(true); panel.setSpacing(false); panel.addStyleName("server-desc-basic"); HorizontalLayout hlPanels = new HorizontalLayout(); hlPanels.setWidth("100%"); hlPanels.setHeight("100%"); hlPanels.setMargin(true); hlPanels.setSpacing(true); hlPanels.addStyleName("server-desc-basic"); // setContent(hlPanels); left.setWidth("100%"); right.setHeight("100%"); right.setWidth("100%"); //???? Label padding = new Label(" "); padding.setWidth("7px"); padding.setHeight("99%"); padding.addStyleName("desc-padding"); Label padding2 = new Label(""); padding2.setWidth("1px"); hlPanels.addComponent(left); hlPanels.addComponent(padding); hlPanels.addComponent(padding2); hlPanels.addComponent(right); hlPanels.setExpandRatio(left, 40); hlPanels.setExpandRatio(right, 60); panel.addComponent(hlPanels); panel.setExpandRatio(hlPanels, 1.0f); }
From source file:jp.primecloud.auto.ui.ServerDescDetail.java
License:Open Source License
public ServerDescDetail() { setHeight("100%"); addStyleName(Reindeer.PANEL_LIGHT);// ww w. j a v a 2s.c om VerticalLayout panel = (VerticalLayout) getContent(); panel.setWidth("100%"); panel.setHeight("100%"); panel.setMargin(true); panel.setSpacing(false); panel.addStyleName("server-desc-detail"); HorizontalLayout hlPanels = new HorizontalLayout(); hlPanels.setWidth("100%"); hlPanels.setHeight("100%"); hlPanels.setMargin(true); hlPanels.setSpacing(true); hlPanels.addStyleName("server-desc-detail"); // setContent(hlPanels); left.setWidth("200px"); right.setWidth("100%"); right.setHeight("100%"); hlPanels.addComponent(left); hlPanels.addComponent(right); hlPanels.setExpandRatio(right, 100); panel.addComponent(hlPanels); panel.setExpandRatio(hlPanels, 1.0f); }
From source file:jp.primecloud.auto.ui.ServiceDesc.java
License:Open Source License
public ServiceDesc() { setWidth("100%"); setHeight("100%"); setCaption(ViewProperties.getCaption("panel.serviceDesc")); addStyleName("service-desc-panel"); addStyleName(Reindeer.PANEL_LIGHT);//w w w . java 2 s . c om VerticalLayout layout = (VerticalLayout) getContent(); layout.setWidth("100%"); layout.setHeight("100%"); layout.setMargin(false); layout.setSpacing(false); layout.addStyleName("service-desc-layout"); tabDesc.addStyleName(Reindeer.TABSHEET_BORDERLESS); tabDesc.setWidth("100%"); tabDesc.setHeight("100%"); tabDesc.addTab(serviceDescBasic, ViewProperties.getCaption("tab.serviceDescBasic"), Icons.BASIC.resource()); tabDesc.addTab(serviceDescDetail, ViewProperties.getCaption("tab.serviceDescDetail"), Icons.DETAIL.resource()); // tabDesc.addListener(TabSheet.SelectedTabChangeEvent.class, this, "selectedTabChange"); addComponent(tabDesc); }
From source file:jp.primecloud.auto.ui.ServiceDescBasic.java
License:Open Source License
public ServiceDescBasic() { addStyleName(Reindeer.PANEL_LIGHT);/*from w w w. j a va 2 s.co m*/ setHeight("100%"); HorizontalLayout hlPanels = new HorizontalLayout(); hlPanels.setWidth("100%"); hlPanels.setHeight("100%"); hlPanels.setMargin(true); hlPanels.setSpacing(true); hlPanels.addStyleName("service-desc-basic"); setContent(hlPanels); left.setWidth("100%"); right.setWidth("100%"); //???? Label padding = new Label(" "); padding.setWidth("7px"); padding.setHeight("99%"); padding.addStyleName("desc-padding"); Label padding2 = new Label(""); padding2.setWidth("1px"); VerticalLayout layLeft = new VerticalLayout(); layLeft.setMargin(false); layLeft.setSpacing(false); layLeft.setWidth("100%"); layLeft.setHeight("100%"); layLeft.addComponent(left); layLeft.setExpandRatio(left, 1.0f); VerticalLayout layRight = new VerticalLayout(); layRight.setMargin(false); layRight.setSpacing(false); layRight.setWidth("100%"); layRight.setHeight("100%"); layRight.addComponent(right); layRight.addComponent(serverOpe); layRight.setExpandRatio(right, 1.0f); hlPanels.addComponent(layLeft); hlPanels.addComponent(padding); hlPanels.addComponent(padding2); hlPanels.addComponent(layRight); hlPanels.setExpandRatio(layLeft, 40); hlPanels.setExpandRatio(layRight, 60); }