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

import javax.inject.Named;

import de.ivu.elect.business.security.UseCasePermission;
import de.ivu.elect.business.wahl.entity.Wahl;

@Named(WahlDeleteAction.COMPONENT_NAME)
public class WahlDeleteAction extends AbstractWahlAction {

  private static final long serialVersionUID = 1L;

  public static final String COMPONENT_NAME = "wahlDeleteAction";

  public WahlDeleteAction() {
    super();
  }

  @Override
  public UseCasePermission getRequiredPermission() {
    return UseCasePermission.WAHL_DELETE;
  }

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

  @Override
  public String doIt(Wahl wahl) {
    wahlConversationSelect.setEntity(wahl);

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

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

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

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