
package de.ivu.elect.presentation.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.aufgabe.menu.AufgabePlaceholderMainMenuEntry;
import de.ivu.elect.presentation.entschaedigung.menu.EntschaedigungMainMenuEntry;
import de.ivu.elect.presentation.veranstaltung.menu.VeranstaltungMainMenuEntry;

@Specializes
public class ElectCommonMainMenu extends ElectBaseMainMenu {

  private static final long serialVersionUID = 1L;

  @Inject
  protected transient VeranstaltungMainMenuEntry veranstaltungMainMenuEntry;

  @Inject
  protected transient EntschaedigungMainMenuEntry entschaedigungMainMenuEntry;

  @Inject
  protected transient AufgabePlaceholderMainMenuEntry aufgabeMainMenuEntry;

  @Override
  public List<MenuEntry> getMenuEntriesSorted() {
    List<MenuEntry> result = getMenuEntriesInternal();
    result.add(aufgabeMainMenuEntry);
    return result;
  }

  public List<MenuEntry> getMenuEntriesInternal() {
    List<MenuEntry> result = new ArrayList<>(super.getMenuEntriesSorted());

    result.add(entschaedigungMainMenuEntry);
    result.add(veranstaltungMainMenuEntry);

    return result;
  }

}
