
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;

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

  private static final long serialVersionUID = 1L;

  public static final String COMPONENT_NAME = "direktkandidaturDeleteAction";

  @Inject
  private transient DirektkandidaturConversationSelect direktkandidaturConversationSelect;

  public DirektkandidaturDeleteAction() {
    super();
  }

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

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

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

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

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

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

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