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

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

import de.ivu.elect.business.kandidatur.boundary.ListenkandidaturConversationSelect;
import de.ivu.elect.business.kandidatur.entity.Listenkandidatur;
import de.ivu.elect.business.security.UseCasePermission;
import de.ivu.elect.presentation.kandidatur.ListenkandidaturEditView;
import de.ivu.elect.presentation.security.AbstractGebietSecurity;

@Named(ListenkandidaturEditAction.COMPONENT_NAME)
public class ListenkandidaturEditAction extends AbstractListenkandidaturAction {

  private static final long serialVersionUID = 1L;

  public static final String COMPONENT_NAME = "listenkandidaturEditAction";

  @Inject
  private transient ListenkandidaturConversationSelect listenkandidaturConversationSelect;

  public ListenkandidaturEditAction() {
    super();
  }

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

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

  @Override
  protected String doIt(Listenkandidatur listenkandidatur) {
    listenkandidaturConversationSelect.setEntity(listenkandidatur);

    return ListenkandidaturEditView.VIEW_ID;
  }

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

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