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

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

import de.ivu.elect.business.kandidatur.boundary.DirektkandidaturConversationSelect;
import de.ivu.elect.business.kandidatur.entity.Direktkandidatur;
import de.ivu.elect.business.security.UseCasePermission;
import de.ivu.elect.presentation.kandidatur.DirektkandidaturEditView;
import de.ivu.elect.presentation.security.AbstractGebietSecurity;

@Named(DirektkandidaturEditAction.COMPONENT_NAME)
public class DirektkandidaturEditAction extends AbstractDirektkandidaturAction {

  private static final long serialVersionUID = 1L;

  public static final String COMPONENT_NAME = "direktkandidaturEditAction";

  @Inject
  private transient DirektkandidaturConversationSelect direktkandidaturConversationSelect;

  public DirektkandidaturEditAction() {
    super();
  }

  @Override
  public UseCasePermission getRequiredPermission() {
    return UseCasePermission.DIREKTKANDIDATUR_EDIT;
  }

  @Override
  protected AbstractGebietSecurity getGebietSecurity() {
    return getKandidaturEditGebietSecurity();
  }

  @Override
  protected String doIt(Direktkandidatur entity) {
    direktkandidaturConversationSelect.setEntity(entity);

    return DirektkandidaturEditView.VIEW_ID;
  }

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

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