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

import javax.inject.Inject;

import de.ivu.elect.business.security.UseCasePermission;
import de.ivu.elect.business.wahl.boundary.WahlSessionSelector;
import de.ivu.elect.business.wahl.boundary.WahlterminSessionSelect;
import de.ivu.elect.presentation.dokumente.DokumentVorlageLeerformularSearchView;

public class DokumentVorlageLeerformularSearchMenuItemEntry extends AbstractDokumentVorlageMenuItemEntry {

  @Inject
  private transient WahlterminSessionSelect wahlterminSessionSelect;

  @Inject
  private transient WahlSessionSelector wahlSessionSelector;

  private static final long serialVersionUID = 1L;

  public DokumentVorlageLeerformularSearchMenuItemEntry() {
    super();
  }

  @Override
  protected UseCasePermission getUseCasePermission() {
    return UseCasePermission.DOKUMENT_VORLAGE_LEERFORMULAR_SEARCH;
  }

  @Override
  public boolean isDisabledInternal() {
    return !wahlterminSessionSelect.isSelected() && !wahlSessionSelector.isSelected();
  }

  @Override
  public String getTargetViewId() {
    return DokumentVorlageLeerformularSearchView.VIEW_ID;
  }

  @Override
  public String getLabelKey() {
    return "dokumentvorlage.leerformular.search.menu.item";
  }

  @Override
  public String getIcon() {
    return "fa fa-file-o";
  }
}
