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

import javax.inject.Inject;

import de.ivu.elect.presentation.exchange.ExportDescription;
import de.ivu.elect.presentation.exchange.menu.AbstractExportMenuItemEntry;
import de.ivu.elect.presentation.gruppe.exchange.GruppeExportDescription;

public class GruppeExportMenuItemEntry extends AbstractExportMenuItemEntry {

  private static final long serialVersionUID = 1L;

  @Inject
  private transient GruppeExportDescription gruppeExportDescription;

  public GruppeExportMenuItemEntry() {
    super();
  }

  @Override
  public boolean isRendered() {
    return super.isRendered() && isWahlMitKandidaturenSelected();
  }

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

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

  private boolean isWahlMitKandidaturenSelected() {
    return isWahlSelected() && getSelectedWahl().isWahlMitKandidaturen();
  }
}
