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

import javax.annotation.Nonnull;
import javax.inject.Inject;
import javax.inject.Named;

import de.ivu.elect.business.security.UseCasePermission;
import de.ivu.elect.business.wertelisten.entity.Wertelisten;
import de.ivu.elect.presentation.View;
import de.ivu.elect.presentation.wertelisten.WertelistenEditView;

@Named(WertelistenDeleteAction.COMPONENT_NAME)
public class WertelistenDeleteAction extends AbstractWertelistenAction {

  public static final String COMPONENT_NAME = "wertelistenDeleteAction";

  private static final long serialVersionUID = 1L;

  @View
  @Inject
  private WertelistenEditView editView;

  @Override
  public boolean isDisabledInternal(@Nonnull Wertelisten entity) {
    return false;
  }

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

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

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

  @Override
  protected String doIt(Wertelisten entity) {
    editView.setEntity(entity);
    return null;
  }

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

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

}
