List of usage examples for com.vaadin.ui Panel setWidth
@Override public void setWidth(String width)
From source file:foo.MyVaadinApplication.java
License:Apache License
/** * Initializes the top banner//www . ja v a 2s . c om * * @return initialized top banner */ private Panel initTopBanner() { Panel topBanner = new Panel(); topBanner.setWidth("100%"); String basepath = VaadinService.getCurrent().getBaseDirectory().getAbsolutePath(); FileResource resource = new FileResource(new File(basepath + "/WEB-INF/images/topBannerPlaceholder.png")); Embedded image = new Embedded("", resource); VerticalLayout v = new VerticalLayout(); v.addComponent(image); topBanner.setContent(v); return topBanner; }
From source file:foo.MyVaadinApplication.java
License:Apache License
/** * Initializes the bottom banner/*from w w w . ja v a 2s . c om*/ * * @return initialized bottom banner */ private Panel initBottomBanner() { Panel bottomBanner = new Panel(); bottomBanner.setWidth("100%"); String basepath = VaadinService.getCurrent().getBaseDirectory().getAbsolutePath(); FileResource resource = new FileResource( new File(basepath + "/WEB-INF/images/bottomBannerPlaceholder.png")); Embedded image = new Embedded("", resource); VerticalLayout v = new VerticalLayout(); v.addComponent(image); bottomBanner.setContent(v); return bottomBanner; }
From source file:fr.amapj.view.engine.tools.BaseUiTools.java
License:Open Source License
/** * Cre un Panel avec un VerticalLayout l'intrieur * //from w w w .j av a2s . c om * @param layout * @param styleName * @return */ static public VerticalLayout addPanel(Layout layout, String styleName) { Panel p0 = new Panel(); p0.setWidth("100%"); p0.addStyleName(styleName); VerticalLayout vl1 = new VerticalLayout(); vl1.setMargin(true); p0.setContent(vl1); layout.addComponent(p0); return vl1; }
From source file:fr.amapj.view.views.compte.MonCompteView.java
License:Open Source License
/** * /* ww w . j ava2 s . c o m*/ */ @Override public void enter() { Panel p0 = new Panel(); p0.setWidth("100%"); p0.addStyleName(PANEL_COMPTEFORM); VerticalLayout vl1 = new VerticalLayout(); vl1.setMargin(true); p0.setContent(vl1); addComponent(p0); // Bloc nom et prenom - Le nom et le prenom ne sont pas modifiables form1 = new FormLayout(); form1.setMargin(false); form1.addStyleName("light"); vl1.addComponent(form1); Label section = new Label("Nom et prnom"); section.addStyleName("h2"); section.addStyleName("colored"); form1.addComponent(section); nom = addTextField("Votre nom ", form1); prenom = addTextField("Votre prnom ", form1); // Bloc Adresse mail InLineFormHelper formHelper = new InLineFormHelper("Votre mail", "Modifier votre adresse mail", this, e -> handleSaveMail()); mail = addTextField("Votre mail", formHelper.getForm()); formHelper.getValidatorManager().add(mail, "Votre mail", "mail", new EmailValidator()); formHelper.addIn(vl1); // Bloc mot de passe formHelper = new InLineFormHelper("Votre mot de passe", "Modifier votre mot de passe", this, e -> handleSavePassword()); pwd = addTextField("Votre mot de passe", formHelper.getForm()); formHelper.addIn(vl1); // les coordonnes formHelper = new InLineFormHelper("Vos coordonnes", "Modifier vos coordonnes", this, e -> handleSaveChangerCoordonnees()); numTel1 = addTextField("Numro de tel 1", formHelper.getForm()); numTel2 = addTextField("Numro de tel 2", formHelper.getForm()); adresse = addTextField("Adresse", formHelper.getForm()); codePostal = addTextField("Code Postal", formHelper.getForm()); ville = addTextField("Ville", formHelper.getForm()); formHelper.addIn(vl1); refresh(); }
From source file:fr.amapj.view.views.listeproducteurreferent.ListeProducteurReferentView.java
License:Open Source License
/** * // w w w . ja v a 2 s .co m */ @Override public void enter() { List<DetailProducteurDTO> dtos = new ListeProducteurReferentService().getAllProducteurs(); for (DetailProducteurDTO detailProducteurDTO : dtos) { Panel p0 = new Panel(); p0.setWidth("100%"); p0.addStyleName(PANEL_PRODUCTEUR); VerticalLayout vl1 = new VerticalLayout(); vl1.setMargin(true); p0.setContent(vl1); addComponent(p0); // Le titre String str = "Producteur : " + detailProducteurDTO.nom; Label l = new Label(str, ContentMode.HTML); l.addStyleName(LABEL_TITRE); vl1.addComponent(l); str = detailProducteurDTO.description; if (str != null) { l = new Label(str, ContentMode.HTML); l.addStyleName(LABEL_LIGNE); vl1.addComponent(l); } str = formatUtilisateur(detailProducteurDTO.utilisateurs); l = new Label(str, ContentMode.HTML); l.addStyleName(LABEL_LIGNE); vl1.addComponent(l); str = formatReferent(detailProducteurDTO.referents); l = new Label(str, ContentMode.HTML); l.addStyleName(LABEL_LIGNE); vl1.addComponent(l); } }
From source file:fr.amapj.view.views.mespaiements.MesPaiementsView.java
License:Open Source License
@Override public void enter() { MesPaiementsDTO mesPaiementsDTO = new MesPaiementsService().getMesPaiements(SessionManager.getUserId()); // Le titre/*from w w w . ja v a2s . co m*/ addLabel("Les chques que je dois donner l'AMAP"); Panel p0 = new Panel(); p0.setWidth("100%"); p0.addStyleName(PANEL_CHEQUEAFOURNIR); VerticalLayout vl1 = new VerticalLayout(); vl1.setMargin(true); p0.setContent(vl1); addComponent(p0); // la liste des chques donner List<PaiementAFournirDTO> paiementAFournirs = mesPaiementsDTO.paiementAFournir; if (paiementAFournirs.size() == 0) { String str = "Vous tes jour de vos paiements, vous n'avez pas de chques fournir l'AMAP <br/>"; Label l = new Label(str, ContentMode.HTML); l.addStyleName(LABEL_CHEQUEAFOURNIR); vl1.addComponent(l); } for (PaiementAFournirDTO paiementAFournir : paiementAFournirs) { String str = formatContrat(paiementAFournir); Label l = new Label(str, ContentMode.HTML); l.addStyleName(LABEL_CONTRAT); Panel p1 = new Panel(); p1.setContent(l); p1.addStyleName(PANEL_CONTRAT); vl1.addComponent(p1); for (DetailPaiementAFournirDTO detail : paiementAFournir.paiements) { str = detail.formatPaiement(); Label ld = new Label(str, ContentMode.HTML); ld.addStyleName(LABEL_CHEQUEAFOURNIR); vl1.addComponent(ld); } // Une ligne vide vl1.addComponent(new Label("<br/>", ContentMode.HTML)); } // Le titre addLabel("Le planning de mes paiements venir mois par mois"); Panel p = new Panel(); p.setWidth("100%"); p.addStyleName(PANEL_AVENIR); VerticalLayout vl = new VerticalLayout(); vl.setMargin(true); p.setContent(vl); addComponent(p); // la liste des chques qui seront bientot encaisss for (PaiementFourniDTO paiementFourni : mesPaiementsDTO.paiementFourni) { String str = formatMois(paiementFourni); Label l = new Label(str, ContentMode.HTML); l.addStyleName(LABEL_MOIS); Panel p1 = new Panel(); p1.setContent(l); p1.addStyleName(PANEL_MOIS); vl.addComponent(p1); for (DetailPaiementFourniDTO detail : paiementFourni.paiements) { str = formatPaiement(detail); Label cheque = new Label(str, ContentMode.HTML); cheque.addStyleName(LABEL_CHEQUE); vl.addComponent(cheque); } // Une ligne vide vl.addComponent(new Label("<br/>", ContentMode.HTML)); } }
From source file:fr.univlorraine.mondossierweb.views.windows.SignificationsMobileWindow.java
License:Apache License
/** * Cre une fentre//from w w w .j a v a 2s . c om */ public SignificationsMobileWindow(boolean afficherSignificationIndicateurProfondeur) { setWidth("95%"); setHeight("95%"); setCaption(applicationContext.getMessage("significationsWindow.title", null, getLocale())); setModal(true); setResizable(false); setClosable(false); setStyleName("v-popover-blank"); VerticalLayout layout = new VerticalLayout(); layout.setSizeFull(); setContent(layout); VerticalLayout panelLayout = new VerticalLayout(); panelLayout.setWidth("100%"); panelLayout.setStyleName("v-scrollableelement"); panelLayout.setSpacing(true); panelLayout.setMargin(true); if (MdwTouchkitUI.getCurrent().getEtudiant().isSignificationResultatsUtilisee()) { Panel panelSignificationResultats = new Panel(); panelSignificationResultats.setCaption( applicationContext.getMessage(NAME + ".info.significations.resultats", null, getLocale())); panelSignificationResultats.addStyleName("significationpanel"); panelSignificationResultats.setWidth("100%"); VerticalLayout significationLayout = new VerticalLayout(); significationLayout.setWidth("100%"); significationLayout.setMargin(true); significationLayout.setSpacing(true); Set<String> ss = MdwTouchkitUI.getCurrent().getEtudiant().getSignificationResultats().keySet(); for (String k : ss) { if (k != null && !k.equals("") && !k.equals(" ")) { HorizontalLayout signLayout = new HorizontalLayout(); signLayout.setSizeFull(); signLayout.setMargin(true); signLayout.setSpacing(true); Label codeLabel = new Label(k); codeLabel.setStyleName(ValoTheme.LABEL_BOLD); codeLabel.addStyleName("v-label-align-right"); signLayout.addComponent(codeLabel); Label valueLabel = new Label( "" + MdwTouchkitUI.getCurrent().getEtudiant().getSignificationResultats().get(k)); signLayout.addComponent(valueLabel); significationLayout.addComponent(signLayout); } } panelSignificationResultats.setContent(significationLayout); panelLayout.addComponent(panelSignificationResultats); } if (afficherSignificationIndicateurProfondeur) { Panel panelSignificationIndicateurs = new Panel(); panelSignificationIndicateurs.setCaption( applicationContext.getMessage(NAME + ".info.significations.indicateurs", null, getLocale())); panelSignificationIndicateurs.addStyleName("significationpanel"); panelSignificationIndicateurs.setWidth("100%"); VerticalLayout significationLayout = new VerticalLayout(); significationLayout.setMargin(true); significationLayout.setSpacing(true); significationLayout.setWidth("100%"); //1er NIVEAU HorizontalLayout levelLayout1 = new HorizontalLayout(); levelLayout1.setWidth("100%"); HorizontalLayout levelMainLayout1 = new HorizontalLayout(); levelMainLayout1.setWidth("100%"); levelMainLayout1.setSpacing(true); levelMainLayout1.setStyleName("level-indicator-layout"); int k = 0; for (int i = 0; i < 1; i++) { //Ajout d'un level k++; Label libLevelLayout = new Label(); libLevelLayout.setSizeFull(); libLevelLayout.setHeight("8px"); libLevelLayout.setStyleName("layout-level-green-indicator"); levelMainLayout1.addComponent(libLevelLayout); } //On pense avoir 7 level maxi for (int j = k; j < 8; j++) { Label libLevelSpaceLayout = new Label(); libLevelSpaceLayout.setSizeFull(); libLevelSpaceLayout.setHeight("8px"); levelMainLayout1.addComponent(libLevelSpaceLayout); } levelLayout1.addComponent(levelMainLayout1); levelLayout1.addComponent(new Label("1er niveau")); significationLayout.addComponent(levelLayout1); //2em NIVEAU HorizontalLayout levelLayout2 = new HorizontalLayout(); levelLayout2.setSizeFull(); HorizontalLayout levelMainLayout2 = new HorizontalLayout(); levelMainLayout2.setSizeFull(); levelMainLayout2.setSpacing(true); levelMainLayout2.setStyleName("level-indicator-layout"); k = 0; for (int i = 0; i < 2; i++) { //Ajout d'un level k++; Label libLevelLayout = new Label(); libLevelLayout.setSizeFull(); libLevelLayout.setHeight("8px"); libLevelLayout.setStyleName("layout-level-green-indicator"); levelMainLayout2.addComponent(libLevelLayout); } //On pense avoir 7 level maxi for (int j = k; j < 8; j++) { Label libLevelSpaceLayout = new Label(); libLevelSpaceLayout.setSizeFull(); libLevelSpaceLayout.setHeight("8px"); levelMainLayout2.addComponent(libLevelSpaceLayout); } levelLayout2.addComponent(levelMainLayout2); levelLayout2.addComponent(new Label("2em niveau")); significationLayout.addComponent(levelLayout2); //3em NIVEAU HorizontalLayout levelLayout3 = new HorizontalLayout(); levelLayout3.setSizeFull(); HorizontalLayout levelMainLayout3 = new HorizontalLayout(); levelMainLayout3.setSizeFull(); levelMainLayout3.setSpacing(true); levelMainLayout3.setStyleName("level-indicator-layout"); k = 0; for (int i = 0; i < 3; i++) { //Ajout d'un level k++; Label libLevelLayout = new Label(); libLevelLayout.setSizeFull(); libLevelLayout.setHeight("8px"); libLevelLayout.setStyleName("layout-level-green-indicator"); levelMainLayout3.addComponent(libLevelLayout); } //On pense avoir 7 level maxi for (int j = k; j < 8; j++) { Label libLevelSpaceLayout = new Label(); libLevelSpaceLayout.setSizeFull(); libLevelSpaceLayout.setHeight("8px"); levelMainLayout3.addComponent(libLevelSpaceLayout); } levelLayout3.addComponent(levelMainLayout3); levelLayout3.addComponent(new Label("3em niveau")); significationLayout.addComponent(levelLayout3); //4em NIVEAU HorizontalLayout levelLayout4 = new HorizontalLayout(); levelLayout4.setSizeFull(); HorizontalLayout levelMainLayout4 = new HorizontalLayout(); levelMainLayout4.setSizeFull(); levelMainLayout4.setSpacing(true); levelMainLayout4.setStyleName("level-indicator-layout"); k = 0; for (int i = 0; i < 4; i++) { //Ajout d'un level k++; Label libLevelLayout = new Label(); libLevelLayout.setSizeFull(); libLevelLayout.setHeight("8px"); libLevelLayout.setStyleName("layout-level-green-indicator"); levelMainLayout4.addComponent(libLevelLayout); } //On pense avoir 7 level maxi for (int j = k; j < 8; j++) { Label libLevelSpaceLayout = new Label(); libLevelSpaceLayout.setSizeFull(); libLevelSpaceLayout.setHeight("8px"); levelMainLayout4.addComponent(libLevelSpaceLayout); } levelLayout4.addComponent(levelMainLayout4); levelLayout4.addComponent(new Label("4em niveau")); significationLayout.addComponent(levelLayout4); //ETC HorizontalLayout levelLayoutEtc = new HorizontalLayout(); levelLayoutEtc.setSizeFull(); levelLayoutEtc.addComponent(new Label("...")); levelLayoutEtc.addComponent(new Label("")); significationLayout.addComponent(levelLayoutEtc); panelSignificationIndicateurs.setContent(significationLayout); panelLayout.addComponent(panelSignificationIndicateurs); } layout.addComponent(panelLayout); // close button HorizontalLayout bLayout = new HorizontalLayout(); bLayout.setSizeFull(); bLayout.setHeight("50px"); Button closeButton = new Button(); //closeButton.setCaption(applicationContext.getMessage("significationsWindow.btnFermer", null, getLocale())); closeButton.setStyleName(ValoTheme.BUTTON_PRIMARY); closeButton.addStyleName("v-popover-button"); closeButton.setIcon(FontAwesome.CHECK); closeButton.addClickListener(e -> { close(); }); bLayout.addComponent(closeButton); bLayout.setComponentAlignment(closeButton, Alignment.MIDDLE_CENTER); layout.addComponent(bLayout); layout.setExpandRatio(panelLayout, 1); }
From source file:gov.va.ehtac.appsonfhir.ui.FHIRChart.java
private Panel getProblemList() { Panel panel = new Panel(); panel.setCaption("Problem List"); panel.setWidth("80%"); panel.setHeight("100px"); return panel; }
From source file:gov.va.ehtac.appsonfhir.ui.FHIRChart.java
private Panel getMedications() { Panel panel = new Panel(); panel.setStyleName(Runo.LAYOUT_DARKER); panel.setCaption("Medications"); panel.setWidth("80%"); panel.setHeight("100px"); return panel; }
From source file:gov.va.ehtac.appsonfhir.ui.FHIRChart.java
private Panel getEncounters() { Panel panel = new Panel(); panel.setCaption("Encounters"); panel.setWidth("80%"); panel.setHeight("100px"); return panel; }