001package edu.pdx.cs410J.grader.poa;
002
003import com.google.common.eventbus.EventBus;
004import com.google.common.eventbus.Subscribe;
005import com.google.inject.Inject;
006import com.google.inject.Singleton;
007
008@Singleton
009public class StatusMessagePresenter {
010  private final EventBus bus;
011  private final StatusMessageView view;
012
013  @Inject
014  public StatusMessagePresenter(EventBus bus, StatusMessageView view) {
015    this.bus = bus;
016    this.view = view;
017
018    this.bus.register(this);
019  }
020
021  @Subscribe
022  public void handleStatusMessage(StatusMessage message) {
023    this.view.setStatusMessage(message.getStatusMessage());
024  }
025}