
package de.ivu.elect.presentation.system.menu;

import javax.inject.Inject;

import de.ivu.elect.business.security.UseCasePermission;
import de.ivu.elect.business.system.control.SkriptRunner;
import de.ivu.elect.presentation.menu.AbstractMenuItemEntry;
import de.ivu.elect.presentation.security.AbstractGebietSecurity;
import de.ivu.elect.presentation.system.SkriptConsoleViewId;

public class SkriptConsoleMenuItemEntry extends AbstractMenuItemEntry {

  private static final long serialVersionUID = 1L;

  @Inject
  private SkriptRunner skriptRunner;

  @Override
  public boolean isRendered() {
    return hasUseCasePermission(UseCasePermission.SKRIPT_AUSFUEHREN) && skriptRunner.isSkriptEngineVerfuegbar();
  }

  @Override
  public String getLabelKey() {
    return "skript.console.menu.item.label";
  }

  @Override
  public String getTargetViewId() {
    return SkriptConsoleViewId.VIEW_ID;
  }

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

  @Override
  public String getIcon() {
    return "fa fa-chevron-right";
  }

  @Override
  protected AbstractGebietSecurity getGebietSecurity() {
    return KEINE_GEBIET_SECURITY;
  }

}
