Meldung shown in window.

master
Markus Kreth 7 years ago
parent f467f3654a
commit 89a362f731
  1. 4
      src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/business/EventMeldung.java
  2. 0
      src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/ClubEventBuilder.java
  3. 18
      src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/ui/EventDetails.java

@ -37,6 +37,10 @@ public class EventMeldung {
throw new IllegalStateException("No Group found for " + p); throw new IllegalStateException("No Group found for " + p);
} }
public String getCaption() {
return event.getCaption();
}
public Map<Altersgruppe, List<Person>> getGroups() { public Map<Altersgruppe, List<Person>> getGroups() {
return Collections.unmodifiableMap(groups); return Collections.unmodifiableMap(groups);
} }

@ -2,12 +2,14 @@ package de.kreth.vaadin.clubhelper.vaadinclubhelper.ui;
import com.vaadin.navigator.Navigator; import com.vaadin.navigator.Navigator;
import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent; import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent;
import com.vaadin.shared.ui.ContentMode;
import com.vaadin.ui.Button; import com.vaadin.ui.Button;
import com.vaadin.ui.Grid.SelectionMode; import com.vaadin.ui.Grid.SelectionMode;
import com.vaadin.ui.GridLayout; import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Notification; import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Notification.Type; import com.vaadin.ui.Label;
import com.vaadin.ui.VerticalLayout; 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.EventBusiness;
import de.kreth.vaadin.clubhelper.vaadinclubhelper.business.EventMeldung; import de.kreth.vaadin.clubhelper.vaadinclubhelper.business.EventMeldung;
@ -64,7 +66,7 @@ public class EventDetails extends GridLayout implements NamedView {
Button createMeldung = new Button("Meldung"); Button createMeldung = new Button("Meldung");
createMeldung.addClickListener(ev -> show(eventBusiness.createMeldung())); createMeldung.addClickListener(ev -> show(eventBusiness.createMeldung()));
VerticalLayout buttonLayout = new VerticalLayout(back, createMeldung); HorizontalLayout buttonLayout = new HorizontalLayout(back, createMeldung);
buttonLayout.setMargin(true); buttonLayout.setMargin(true);
buttonLayout.setSpacing(true); buttonLayout.setSpacing(true);
@ -81,8 +83,14 @@ public class EventDetails extends GridLayout implements NamedView {
} }
private void show(EventMeldung createMeldung) { private void show(EventMeldung createMeldung) {
Notification.show("Meldung für " + eventBusiness.getCurrent().getCaption(), createMeldung.toString(), VerticalLayout content = new VerticalLayout();
Type.HUMANIZED_MESSAGE); 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 @Override

Loading…
Cancel
Save