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

import de.ivu.elect.business.security.UseCasePermission;
import de.ivu.elect.business.wahl.boundary.WahlkonfigurationAnpassbar;
import de.ivu.elect.presentation.wahl.WahlartCreateView;

import javax.inject.Inject;

public class WahlartCreateMenuItemEntry extends AbstractWahlartMenuItemEntry {

  private static final long serialVersionUID = 1L;

  @Inject
  private transient WahlkonfigurationAnpassbar wahlkonfigurationAnpassbar;

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

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

  @Override
  protected String getLabel() {
    return getMessage(getLabelKey(), getMeta().getEinzahlMessage());
  }

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

  @Override
  public String getIcon() {
    return getIcons().getIconCreate();
  }

  @Override
  public boolean isRendered() {
    return super.isRendered() && wahlkonfigurationAnpassbar.isWahlkonfigurationAnpassbar(getMandant());
  }
}
