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

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

import de.ivu.elect.business.mandant.entity.Mandant;
import de.ivu.elect.business.security.UseCasePermission;
import de.ivu.elect.presentation.View;
import de.ivu.elect.presentation.mandant.MandantEditView;

@Named(MandantEditAction.COMPONENT_NAME)
public class MandantEditAction extends AbstractMandantAction {

  private static final long serialVersionUID = 1L;

  public static final String COMPONENT_NAME = "mandantEditAction";

  @View
  @Inject
  private MandantEditView editView;

  public MandantEditAction() {
    super();
  }

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

  @Override
  protected String doIt(Mandant mandant) {
    return editView.edit(mandant);
  }

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

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