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

import java.util.Collections;
import java.util.List;

import javax.inject.Inject;

import de.ivu.elect.presentation.menu.AbstractMenuItemEntry;
import de.ivu.elect.presentation.security.AbstractGebietSecurity;

public class LogoutMainMenuEntry extends AbstractMenuItemEntry {

  private static final long serialVersionUID = 1L;

  @Inject
  private transient LogoutGuiAction logoutGuiAction;

  public LogoutMainMenuEntry() {
    super();
  }

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

  @Override
  public boolean isRendered() {
    return isLoggedIn();
  }

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

  @Override
  public String doAction() {
    return logoutGuiAction.doLogoutGui();
  }

  @Override
  public String getTargetViewId() {
    return null;
  }

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

  @Override
  public String getIcon() {
    return getIcons().getIconPowerOff();
  }

  @Override
  public String getStyleClass() {
    return super.getStyleClass() + "ui-menuitem--separate";
  }

  @Override
  protected List<String> getAdditionalTopicViewIds() {
    return Collections.singletonList("");
  }
}
