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

import javax.inject.Named;

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

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

  public static final String COMPONENT_NAME = "internetWidgetSearchFilesAction";

  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 InternetWidgetFileSearchView.VIEW_ID;
  }

  @Override
  public String getLabelKey() {
    return "internet.widget.file.search.action";
  }

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