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

import javax.inject.Inject;

import de.ivu.elect.business.kandidatur.entity.ListenkandidaturConstants;
import de.ivu.elect.business.mandant.entity.Mandant;
import de.ivu.elect.business.security.UseCasePermission;
import de.ivu.elect.presentation.kandidatur.ListenkandidaturCreateViewResolver;

public class ListenkandidaturCreateMenuItemEntry extends AbstractListenkandidaturCreateMenuItemEntry {

  private static final long serialVersionUID = 1L;

  @Inject
  private transient ListenkandidaturCreateViewResolver listenkandidaturCreateViewResolver;

  public ListenkandidaturCreateMenuItemEntry() {
    super();
  }

  @Override
  public boolean isRendered() {
    return hasUseCasePermission(UseCasePermission.LISTENKANDIDATUR_CREATE) && !isEinzelbewerberListeSelected() && !isWaehlerBenannteListeSelected();
  }

  @Override
  protected String getViewId(Mandant mandant) {
    return listenkandidaturCreateViewResolver.getViewId(getMandant());
  }

  @Override
  protected String getEntityEinzahlMessageKey() {
    return ListenkandidaturConstants.MESSAGE_KEY_ENTITY_EINZAHL;
  }
}
