
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(StatistikLaufDeleteAction.COMPONENT_NAME)
public class StatistikLaufDeleteAction extends AbstractStatistikLaufAction {

  public static final String COMPONENT_NAME = "statistikLaufDeleteAction";

  private static final long serialVersionUID = 1L;

  @View
  @Inject
  private StatistikLaufEditView editView;

  public StatistikLaufDeleteAction() {
    super();
  }

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

  @Override
  protected boolean isFireChangeEvent() {
    return true;
  }

  @Override
  protected String doIt(StatistikLauf statistikLauf) {
    editView.setEntity(statistikLauf);

    // Return to current page and display the dialog!
    return null;
  }

  @Override
  public String getDialogName() {
    return "DeleteConfirm";
  }

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

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