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

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

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

import de.ivu.elect.jee.presentation.menu.MenuEntry;
import de.ivu.elect.presentation.gebietsbaum.menu.GebietMainMenuEntry;
import de.ivu.elect.presentation.gruppe.menu.GruppeMainMenuEntry;
import de.ivu.elect.presentation.security.menu.NlPublicKeyEditMenuItem;
import de.ivu.elect.presentation.security.menu.NlPublicKeyImportMenuItem;
import de.ivu.elect.presentation.stimmeingabe.menu.StimmeingabePlausiKonfigurationSearchMenuItemEntry;
import de.ivu.elect.presentation.wahlvorschlag.menu.WahlvorschlagImportMenuItemEntry;
import de.ivu.elect.presentation.wahlvorschlag.menu.WahlvorschlagSearchMenuItemEntry;

@Specializes
public class NlWasWahlprozessMainMenuEntry extends NlWahlprozessMainMenuEntry{
  private static final long serialVersionUID = 1L;

  @Inject
  protected transient GebietMainMenuEntry gebietMainMenuEntry;

  @Inject
  protected transient GruppeMainMenuEntry gruppeMainMenuEntry;

  @Inject
  protected transient WahlvorschlagImportMenuItemEntry wahlvorschlagImportMenuItemEntry;

  @Inject
  private transient WahlvorschlagSearchMenuItemEntry wahlvorschlagSearchMenuItemEntry;

  @Inject
  private transient StimmeingabePlausiKonfigurationSearchMenuItemEntry stimmeingabePlausiKonfigurationSearchMenuItemEntry;


  @Inject
  private transient NlPublicKeyEditMenuItem nlPublicKeyEditMenuItem;


  @Inject
  private transient NlPublicKeyImportMenuItem nlPublicKeyImportMenuItem;

  @Override
  protected List<MenuEntry> getSubMenuEntriesSorted() {
    List<MenuEntry> subMenuEntriesSorted = new ArrayList<>(super.getSubMenuEntriesSorted());
    subMenuEntriesSorted.add(separator);
    subMenuEntriesSorted.addAll(gebietMainMenuEntry.getSubMenuEntries());
    subMenuEntriesSorted.add(separator);
    subMenuEntriesSorted.addAll(gruppeMainMenuEntry.getSubMenuEntries());
    subMenuEntriesSorted.add(separator);
    subMenuEntriesSorted.add(wahlvorschlagSearchMenuItemEntry);
    subMenuEntriesSorted.add(wahlvorschlagImportMenuItemEntry);
    subMenuEntriesSorted.add(separator);
    subMenuEntriesSorted.add(stimmeingabePlausiKonfigurationSearchMenuItemEntry);
    subMenuEntriesSorted.add(separator);
    subMenuEntriesSorted.add(nlPublicKeyEditMenuItem);
    subMenuEntriesSorted.add(nlPublicKeyImportMenuItem);

    return subMenuEntriesSorted;
  }
}
