
package de.ivu.elect.presentation.wahlvorschlag.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.wahlvorschlag.exchange.SperrlisteExportDescription;

public class SperrlisteExportMenuItemEntry extends AbstractExportMenuItemEntry {

  private static final long serialVersionUID = 1L;

  @Inject
  private transient SperrlisteExportDescription sperrlisteExportDescription;

  public SperrlisteExportMenuItemEntry() {
    super();
  }

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

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

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

  @Override
  public String getLabel() {
    return getMessage(getLabelKey(), getMessage("entity.einzahl.SPERRLISTE"));
  }
}
