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

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

import de.ivu.elect.business.geodata.entity.GeodataOrt;
import de.ivu.elect.business.security.UseCasePermission;
import de.ivu.elect.presentation.View;
import de.ivu.elect.presentation.geodata.GeodataOrtEditView;

@Named(GeodataOrtDeleteAction.COMPONENT_NAME)
public class GeodataOrtDeleteAction extends AbstractGeodataOrtAction {

  public static final String COMPONENT_NAME = "geodataOrtDeleteAction";

  private static final long serialVersionUID = 1L;

  @View
  @Inject
  private GeodataOrtEditView editView;

  public GeodataOrtDeleteAction() {
    super();
  }

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

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

  @Override
  protected String doIt(GeodataOrt geodataOrt) {
    editView.setEntity(geodataOrt);

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