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

import javax.inject.Named;

import de.ivu.elect.business.gruppeimgebiet.entity.GruppeImGebiet;
import de.ivu.elect.business.security.UseCasePermission;
import de.ivu.elect.presentation.security.AbstractGebietSecurity;

@Named(ReferendumVorlageImGebietDeleteAction.COMPONENT_NAME)
public class ReferendumVorlageImGebietDeleteAction extends AbstractReferendumVorlageImGebietAction {

  private static final long serialVersionUID = 1L;

  public static final String COMPONENT_NAME = "referendumVorlageImGebietDeleteAction";

  public ReferendumVorlageImGebietDeleteAction() {
    super();
  }

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

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

  @Override
  protected String doIt(GruppeImGebiet gruppeImGebiet) {
    referendumVorlageImGebietSelect.setEntity(gruppeImGebiet);

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

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

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

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

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