package de.ivu.elect.presentation.statistik.action;

import javax.inject.Inject;
import javax.inject.Named;

import de.ivu.elect.business.security.UseCasePermission;
import de.ivu.elect.business.statistik.entity.StatistikLauf;
import de.ivu.elect.presentation.View;
import de.ivu.elect.presentation.statistik.StatistikLaufEditView;

@Named(StatistikLaufEditAction.COMPONENT_NAME)
public class StatistikLaufEditAction extends AbstractStatistikLaufAction {

  public static final String COMPONENT_NAME = "statistikLaufEditAction";

  private static final long serialVersionUID = 1L;

  @View
  @Inject
  private StatistikLaufEditView editView;

  public StatistikLaufEditAction() {
    super();
  }

  @Override
  protected UseCasePermission getRequiredPermission() {
    return UseCasePermission.STATISTIK_LAUF_EDIT;
  }

  @Override
  protected String doIt(StatistikLauf statistikLauf) {
    return editView.edit(statistikLauf);
  }

  @Override
  public String getLabelKey() {
    return "entity.edit.action.edit";
  }

  @Override
  public String getIcon() {
    return appIcons.getIconEdit();
  }
}
