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 de.ivu.elect.presentation.internet.InternetSeiteEditView;
import de.ivu.elect.presentation.internet.InternetWidgetEditView;

import javax.inject.Named;

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

  public static final String COMPONENT_NAME = "internetWidgetEditAction";

  private static final long serialVersionUID = 1L;

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

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

    return InternetWidgetEditView.VIEW_ID;
  }

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

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