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

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

import de.ivu.elect.business.security.UseCasePermission;
import de.ivu.elect.business.staat.entity.Staat;
import de.ivu.elect.presentation.View;
import de.ivu.elect.presentation.staat.StaatEditView;

@Named(StaatDeleteAction.COMPONENT_NAME)
public class StaatDeleteAction extends AbstractStaatAction {

  public static final String COMPONENT_NAME = "staatDeleteAction";

  private static final long serialVersionUID = 1L;

  @View
  @Inject
  private StaatEditView editView;

  public StaatDeleteAction() {
    super();
  }

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

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

  @Override
  protected String doIt(Staat staat) {
    editView.setEntity(staat);

    // 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();
  }
}
