List of usage examples for com.vaadin.ui VerticalLayout setIcon
@Override public void setIcon(Resource icon)
From source file:de.kaiserpfalzEdv.vaadin.about.AboutViewImpl.java
License:Apache License
private VerticalLayout createVerticalLayout(final String caption, final String description, Resource icon) { VerticalLayout result = new VerticalLayout(); result.setSizeFull();/*www. ja va 2 s . c o m*/ result.setSpacing(true); result.setResponsive(true); if (caption != null) result.setCaption(presenter.translate(caption)); if (description != null) result.setDescription(presenter.translate(description)); if (icon != null) result.setIcon(icon); return result; }
From source file:de.uni_tuebingen.qbic.qbicmainportlet.PatientView.java
License:Open Source License
/** * initializes the description layout/*from w ww. j a v a2 s . com*/ * * @return */ VerticalLayout initDescription() { VerticalLayout projDescription = new VerticalLayout(); VerticalLayout projDescriptionContent = new VerticalLayout(); projDescription.setCaption(""); projDescription.setIcon(FontAwesome.FILE_TEXT_O); descContent = new Label(""); contact = new Label("", ContentMode.HTML); patientInformation = new Label("No patient information provided.", ContentMode.HTML); projDescriptionContent.addComponent(patientInformation); projDescriptionContent.addComponent(descContent); projDescriptionContent.addComponent(contact); projDescriptionContent.setMargin(new MarginInfo(true, false, true, true)); projDescriptionContent.setSpacing(true); projDescription.addComponent(projDescriptionContent); descContent.setStyleName("patientview"); contact.setStyleName("patientview"); patientInformation.setStyleName("patientview"); projDescription.setMargin(new MarginInfo(true, false, true, true)); projDescription.setSpacing(true); projDescription.setWidth("100%"); return projDescription; }
From source file:dhbw.clippinggorilla.userinterface.windows.PreferencesWindow.java
private Component buildSupportTab(User user) { VerticalLayout root = new VerticalLayout(); root.setCaption(Language.get(Word.SUPPORT)); root.setIcon(VaadinIcons.HEADSET); root.setWidth("100%"); root.setHeight("100%"); root.setSpacing(true);/*from w w w . j a va 2 s . c om*/ root.setMargin(true); TextArea textAreaMessage = new TextArea(Language.get(Word.MESSAGE)); textAreaMessage.setWidth("100%"); textAreaMessage.setHeight("100%"); Button buttonSend = new Button(Language.get(Word.SEND), VaadinIcons.ENVELOPE); buttonSend.addStyleName(ValoTheme.BUTTON_PRIMARY); buttonSend.addClickListener(ce -> { try { if (emailsSend.containsKey(user)) { Map<LocalDate, Integer> times = emailsSend.get(user); if (times.containsKey(LocalDate.now())) { if (times.get(LocalDate.now()) > 3) { if (times.get(LocalDate.now()) > 15) { UserUtils.banUser(user); VaadinUtils.errorNotification("BANNED DUE TO TOO MUCH EMAILS"); } else { VaadinUtils.errorNotification("TOO MUCH EMAILS"); } return; } else { times.put(LocalDate.now(), times.get(LocalDate.now()) + 1); } } else { times.put(LocalDate.now(), 1); } } else { HashMap<LocalDate, Integer> times = new HashMap<>(); times.put(LocalDate.now(), 1); emailsSend.put(user, times); } Mail.send(Props.get("supportmail"), "SUPPORT", user.toString() + "\n" + textAreaMessage.getValue()); VaadinUtils.middleInfoNotification(Language.get(Word.SUCCESSFULLY_SEND)); textAreaMessage.clear(); } catch (EmailException ex) { VaadinUtils.errorNotification(Language.get(Word.SEND_FAILED)); Log.error("Could not send Supportmail: ", ex); } }); root.addComponents(textAreaMessage, buttonSend); root.setExpandRatio(textAreaMessage, 5); root.setComponentAlignment(buttonSend, Alignment.MIDDLE_LEFT); return root; }
From source file:module.pandabox.presentation.PandaBox.java
License:Open Source License
private Component getVerticalLayout() { HorizontalLayout controls = new HorizontalLayout(); controls.setSpacing(true);//from ww w. jav a2 s . c om controls.setStyleName("inline"); final VerticalLayout main = new VerticalLayout(); final VerticalLayout vl = new VerticalLayout(); vl.setSpacing(true); vl.setMargin(true); vl.setCaption("Layout Caption"); vl.setIcon(new ThemeResource("../runo/icons/16/document.png")); vl.addComponent(createImageFixedHeight()); vl.addComponent(createImageFixedHeight()); vl.addComponent(createImageFixedHeight()); controls.addComponent( new StyleController(vl, BennuTheme.LAYOUT_BIG, BennuTheme.LAYOUT_INSET, BennuTheme.LAYOUT_SECTION)); controls.addComponent(new SpacingController(vl)); controls.addComponent(new MarginController(vl)); main.addComponent(controls); main.addComponent(vl); return main; }