
package de.ivu.elect.presentation.menu;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

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.mandant.menu.MandantMainMenuEntry;

public class ElectBaseMainMenu implements CustomerMainMenu, Serializable {

  private static final long serialVersionUID = 1L;

  @Inject
  protected transient StartViewMenuItemEntry startViewMenuItemEntry;

  @Inject
  protected transient GebietMainMenuEntry gebietMainMenuEntry;

  @Inject
  protected transient MandantMainMenuEntry mandantMainMenuEntry;

  public ElectBaseMainMenu() {
    super();
  }

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

    result.add(startViewMenuItemEntry);
    result.addAll(mandantMainMenuEntry.getSubMenuEntries());
    result.add(gebietMainMenuEntry);

    return result;
  }
}
