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

import javax.inject.Inject;

import de.ivu.elect.presentation.exchange.ImportDescription;
import de.ivu.elect.presentation.exchange.menu.AbstractImportMenuItemEntry;
import de.ivu.elect.presentation.gruppe.exchange.GruppeImportDescription;

public class GruppeImportMenuItemEntry extends AbstractImportMenuItemEntry {

  private static final long serialVersionUID = 1L;

  @Inject
  private transient GruppeImportDescription gruppeImportDescription;

  public GruppeImportMenuItemEntry() {
    super();
  }

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

  @Override
  protected ImportDescription getImportDescription() {
    return gruppeImportDescription;
  }

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

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