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

import de.ivu.elect.business.internet.entity.InternetSeite;
import de.ivu.elect.business.internet.entity.InternetWidget;
import de.ivu.elect.business.security.UseCasePermission;

import javax.inject.Named;

@Named(InternetWidgetDeleteAction.COMPONENT_NAME)
public class InternetWidgetDeleteAction extends AbstractInternetWidgetAction {

  public static final String COMPONENT_NAME = "internetWidgetDeleteAction";

  private static final long serialVersionUID = 1L;

  public InternetWidgetDeleteAction() {
    super();
  }

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

  @Override
  protected String doIt(InternetWidget entity) {
    conversationSelect.setEntity(entity);

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

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

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

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

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