package de.ivu.elect.presentation.veranstaltung.action;

import javax.annotation.Nonnull;
import javax.inject.Inject;

import de.ivu.elect.business.veranstaltung.boundary.VeranstaltungChangeEvent;
import de.ivu.elect.business.veranstaltung.boundary.VeranstaltungConversationSelect;
import de.ivu.elect.business.veranstaltung.entity.Veranstaltung;
import de.ivu.elect.presentation.menu.AbstractActionEntry;

public abstract class AbstractVeranstaltungAction extends AbstractActionEntry<Veranstaltung> {

  private static final long serialVersionUID = 1L;

  @Inject
  protected VeranstaltungConversationSelect conversationSelect;

  @Inject
  private VeranstaltungChangeEvent changeEvent;

  @Override
  public boolean isDisabledInternal(@Nonnull Veranstaltung entity) {
    return entity == null;
  }

  @Override
  protected boolean isFireChangeEvent() {
    return false;
  }

  @Override
  protected void fireChangeEvent() {
    changeEvent.sendChangeEvent();
  }
}
