
package de.ivu.elect.presentation;

import java.util.ArrayList;
import java.util.List;

import javax.enterprise.inject.Specializes;
import javax.inject.Inject;

import de.ivu.elect.business.wahl.boundary.WahlSessionSelect;
import de.ivu.elect.jee.presentation.menu.MenuEntry;
import de.ivu.elect.presentation.wahl.menu.NlWahlprozessMainMenuEntry;
import de.ivu.elect.presentation.wahl.menu.NlWahlprozessMenuItemEntry;
import de.ivu.elect.presentation.wahl.menu.NlWasExportArtefaktNachSystemExportstatusMainMenuEntry;

@Specializes
public class NlWasMainMenu extends WasMainMenu {

  private static final long serialVersionUID = 1L;

  @Inject
  private transient WahlSessionSelect wahlSessionSelect;

  @Inject
  private transient NlWahlprozessMenuItemEntry nlWahlprozessMenuItemEntry;

  @Inject
  private transient NlWahlprozessMainMenuEntry nlWahlprozessMainMenuEntry;

  @Inject
  private transient NlWasExportArtefaktNachSystemExportstatusMainMenuEntry nlWasExportArtefaktNachSystemExportstatusMainMenuEntry;

  public NlWasMainMenu() {
    super();
  }

  @Override
  public List<MenuEntry> getMenuEntriesSorted() {
    List<MenuEntry> result = new ArrayList<>();

    result.add(nlWahlprozessMenuItemEntry);
    result.add(nlWahlprozessMainMenuEntry);

    if (wahlSessionSelect.isSelected()) {
      result.add(stimmenMainMenuEntry);
      result.add(wasErgebnisMainMenuEntry);
    }

    result.add(nlWasExportArtefaktNachSystemExportstatusMainMenuEntry);
    result.add(praesentationMainMenuEntry);
    result.add(mandantMainMenuEntry);

    return result;
  }

}
