
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(DokumentVorlageEditAction.COMPONENT_NAME)
public class DokumentVorlageEditAction extends AbstractDokumentVorlageAction {

  private static final long serialVersionUID = 1L;

  public static final String COMPONENT_NAME = "dokumentVorlageEditAction";

  @View
  @Inject
  private transient DokumentVorlageEditView dokumentVorlageEditView;

  public DokumentVorlageEditAction() {
    super();
  }

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

  @Override
  protected String doIt(DokumentVorlage entity) {
    return dokumentVorlageEditView.edit(entity);
  }

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

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