
package de.ivu.elect.presentation.praesentation.menu;

import javax.inject.Inject;

import de.ivu.elect.business.internet.boundary.InternetPraesentationErmittler;
import de.ivu.elect.presentation.ergebnis.menu.ErgebnisMenuDisabled;
import de.ivu.elect.presentation.exchange.ExportDescription;
import de.ivu.elect.presentation.exchange.menu.AbstractExportMenuItemEntry;
import de.ivu.elect.presentation.praesentation.exchange.PraesentationExportDescription;

public class PraesentationExportMenuItemEntry extends AbstractExportMenuItemEntry {

  private static final long serialVersionUID = 1L;

  @Inject
  private transient ErgebnisMenuDisabled ergebnisMenuDisabled;

  @Inject
  private transient PraesentationExportDescription praesentationExportDescription;

  @Inject
  private transient InternetPraesentationErmittler internetPraesentationErmittler;

  @Override
  protected ExportDescription getExportDescription() {
    return praesentationExportDescription;
  }

  @Override
  public String getLabelKey() {
    return "praesentation.exportieren.menu.item.label";
  }

  @Override
  public boolean isDisabledInternal() {
    return super.isDisabledInternal() || ergebnisMenuDisabled.isDisabled(this);
  }

  @Override
  public boolean isRendered() {
    return super.isRendered() && internetPraesentationErmittler.getInternetPraesentationTyp().isPraesentationVerfuegbar();
  }
}
