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

import javax.inject.Named;

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

@Named(InternetWidgetFileDeleteAction.COMPONENT_NAME)
public class InternetWidgetFileDeleteAction extends AbstractInternetWidgetFileAction {

  public static final String COMPONENT_NAME = "internetWidgetFileDeleteAction";

  private static final long serialVersionUID = 1L;

  public InternetWidgetFileDeleteAction() {
    super();
  }

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

  @Override
  protected String doIt(InternetWidgetFileEntity entity) {
    conversationSelect.setEntity(entity, internetWidgetConversationSelect.getEntity());

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