
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;

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

  private static final long serialVersionUID = 1L;

  public static final String COMPONENT_NAME = "listenkandidaturDeleteAction";

  @Inject
  private transient ListenkandidaturConversationSelect listenkandidaturConversationSelect;

  public ListenkandidaturDeleteAction() {
    super();
  }

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

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

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

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

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

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

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