Example usage for com.vaadin.event EventRouter EventRouter

List of usage examples for com.vaadin.event EventRouter EventRouter

Introduction

In this page you can find the example usage for com.vaadin.event EventRouter EventRouter.

Prototype

EventRouter

Source Link

Usage

From source file:org.vaadin.training.fundamentals.happening.ui.viewimpl.EditHappeningViewImpl.java

License:Apache License

public EditHappeningViewImpl() {
    eventRouter = new EventRouter();
    presenter = new EditHappeningPresenter(this);
}

From source file:org.vaadin.training.fundamentals.happening.ui.viewimpl.ListHappeningsViewImpl.java

License:Apache License

@SuppressWarnings("serial")
public void init(Navigation navigation, Map<String, String> params)
        throws NotAuthenticatedException, NoAccessException {
    if (AppData.getCurrentUser() == null) {
        throw new NotAuthenticatedException();
    }/*from www.j a v  a2s  .  c o  m*/
    eventRouter = new EventRouter();
    presenter = new ListHappeningsPresenter(this);
    this.navigation = navigation;
    setSizeFull();
    setMargin(true);
    table = new Table("Your events");
    table.setSelectable(true);
    table.addListener(new ItemClickListener() {
        @SuppressWarnings("unchecked")
        @Override
        public void itemClick(ItemClickEvent event) {
            if (table.getValue() != null) {
                eventRouter.fireEvent(new ItemOpenEvent(table, (BeanItem<Happening>) event.getItem()));
            }
        }
    });
    table.setSizeFull();
    addComponent(table);
    presenter.init();
}

From source file:org.vaadin.training.fundamentals.happening.ui.viewimpl.ShowHappeningViewImpl.java

License:Apache License

@Override
public void init(Navigation navigation, Map<String, String> params)
        throws NotAuthenticatedException, NoAccessException {
    setColumns(2);//  w w  w.j a va 2s .c  o m
    this.navigation = navigation;
    eventRouter = new EventRouter();
    setSizeFull();
    rebuildLayout();
    presenter = new ShowHappeningPresenter(this);
    try {
        presenter.init(params);
    } catch (PresenterInitFailedException e) {
        e.printStackTrace();
    }

}