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

import javax.annotation.Nonnull;
import javax.inject.Inject;
import javax.inject.Named;

import de.ivu.elect.business.konfiguration.entity.Konfiguration;
import de.ivu.elect.business.security.UseCasePermission;
import de.ivu.elect.presentation.View;
import de.ivu.elect.presentation.konfiguration.KonfigurationEditView;

@Named(KonfigurationEditAction.COMPONENT_NAME)
public class KonfigurationEditAction extends AbstractKonfigurationAction {

  public static final String COMPONENT_NAME = "konfigurationEditAction";

  @View
  @Inject
  KonfigurationEditView konfigurationEditView;

  private static final long serialVersionUID = 1L;

  @Override
  public boolean isDisabledInternal(@Nonnull Konfiguration entity) {
    return false;
  }

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

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

  @Override
  protected String doIt(Konfiguration entity) {
    return konfigurationEditView.edit(entity);
  }

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

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

}
