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

import javax.inject.Named;

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

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

  public static final String COMPONENT_NAME = "internetWidgetFileEditAction";

  private static final long serialVersionUID = 1L;

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

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

    return InternetWidgetFileEditView.VIEW_ID;
  }

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

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