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

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

import de.ivu.elect.business.dokumente.entity.DokumentVorlage;
import de.ivu.elect.business.security.UseCasePermission;
import de.ivu.elect.presentation.View;
import de.ivu.elect.presentation.dokumente.DokumentVorlageEditView;

@Named(DokumentVorlageDeleteAction.COMPONENT_NAME)
public class DokumentVorlageDeleteAction extends AbstractDokumentVorlageAction {

  private static final long serialVersionUID = 1L;

  public static final String COMPONENT_NAME = "dokumentVorlageDeleteAction";

  @View
  @Inject
  private transient DokumentVorlageEditView dokumentVorlageEditView;

  public DokumentVorlageDeleteAction() {
    super();
  }

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

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

  @Override
  protected String doIt(DokumentVorlage entity) {
    dokumentVorlageEditView.setEntity(entity);

    return null;
  }

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

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

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