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

import javax.inject.Named;

import de.ivu.elect.business.security.UseCasePermission;
import de.ivu.elect.business.wahlvorschlag.entity.ReferendumOption;
import de.ivu.elect.presentation.security.AbstractGebietSecurity;
import de.ivu.elect.presentation.wahlvorschlag.ReferendumOptionEditView;

@Named(ReferendumOptionEditAction.COMPONENT_NAME)
public class ReferendumOptionEditAction extends AbstractReferendumOptionAction {

  private static final long serialVersionUID = 1L;

  public static final String COMPONENT_NAME = "referendumOptionEditAction";

  public ReferendumOptionEditAction() {
    super();
  }

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

  @Override
  protected AbstractGebietSecurity getGebietSecurity() {
    return getEinsehenGebietSecurity();
  }

  @Override
  protected String doIt(ReferendumOption entity) {
    referendumOptionSelect.setEntity(entity);

    return ReferendumOptionEditView.VIEW_ID;
  }

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

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