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

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

import de.ivu.elect.business.security.UseCasePermission;
import de.ivu.elect.business.wertelisten.entity.Wertelisten;
import de.ivu.elect.presentation.View;
import de.ivu.elect.presentation.wertelisten.WertelistenEditView;

@Named(WertelistenEditAction.COMPONENT_NAME)
public class WertelistenEditAction extends AbstractWertelistenAction {

  public static final String COMPONENT_NAME = "wertelistenEditAction";

  @View
  @Inject
  private WertelistenEditView editView;

  private static final long serialVersionUID = 1L;

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

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

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

  @Override
  protected String doIt(Wertelisten entity) {
    return editView.edit(entity);
  }

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

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

}
