diff --git a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/business/EventMeldung.java b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/business/EventMeldung.java index 817f222..2fc90fc 100644 --- a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/business/EventMeldung.java +++ b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/business/EventMeldung.java @@ -37,6 +37,10 @@ public class EventMeldung { throw new IllegalStateException("No Group found for " + p); } + public String getCaption() { + return event.getCaption(); + } + public Map> getGroups() { return Collections.unmodifiableMap(groups); } diff --git a/src/test/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/ClubEventBuilder.java b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/ClubEventBuilder.java similarity index 100% rename from src/test/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/ClubEventBuilder.java rename to src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/ClubEventBuilder.java diff --git a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/ui/EventDetails.java b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/ui/EventDetails.java index 454d137..0c18595 100644 --- a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/ui/EventDetails.java +++ b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/ui/EventDetails.java @@ -2,12 +2,14 @@ package de.kreth.vaadin.clubhelper.vaadinclubhelper.ui; import com.vaadin.navigator.Navigator; import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent; +import com.vaadin.shared.ui.ContentMode; import com.vaadin.ui.Button; import com.vaadin.ui.Grid.SelectionMode; import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Notification; -import com.vaadin.ui.Notification.Type; +import com.vaadin.ui.HorizontalLayout; +import com.vaadin.ui.Label; import com.vaadin.ui.VerticalLayout; +import com.vaadin.ui.Window; import de.kreth.vaadin.clubhelper.vaadinclubhelper.business.EventBusiness; import de.kreth.vaadin.clubhelper.vaadinclubhelper.business.EventMeldung; @@ -64,7 +66,7 @@ public class EventDetails extends GridLayout implements NamedView { Button createMeldung = new Button("Meldung"); createMeldung.addClickListener(ev -> show(eventBusiness.createMeldung())); - VerticalLayout buttonLayout = new VerticalLayout(back, createMeldung); + HorizontalLayout buttonLayout = new HorizontalLayout(back, createMeldung); buttonLayout.setMargin(true); buttonLayout.setSpacing(true); @@ -81,8 +83,14 @@ public class EventDetails extends GridLayout implements NamedView { } private void show(EventMeldung createMeldung) { - Notification.show("Meldung für " + eventBusiness.getCurrent().getCaption(), createMeldung.toString(), - Type.HUMANIZED_MESSAGE); + VerticalLayout content = new VerticalLayout(); + content.addComponent(new Label(createMeldung.toString(), ContentMode.PREFORMATTED)); + + Window dlg = new Window("Meldung für " + eventBusiness.getCurrent().getCaption()); + dlg.setContent(content); + dlg.center(); + getUI().addWindow(dlg); + } @Override