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

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

import javax.inject.Inject;
import javax.inject.Named;

import de.ivu.elect.jee.presentation.menu.MenuEntry;
import de.ivu.elect.presentation.ui.AbstractPageMenuModelBuilder;

@Named(InterfacesPageMenu.COMPONENT_NAME)
public class InterfacesPageMenu extends AbstractPageMenuModelBuilder {

  private static final long serialVersionUID = 1L;

  public static final String COMPONENT_NAME = "interfacesPageMenu";

  @Inject
  private transient InterfacesStatusTestMenuItemEntry interfacesStatusTestMenuItemEntry;

  @Inject
  private transient InterfacesEmailTestMenuItemEntry interfacesEmailTestMenuItemEntry;

  @Inject
  private transient InterfacesPageMenuEntriesCollector interfacesPageMenuEntriesCollector;

  public InterfacesPageMenu() {
    super();
  }

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

    result.add(interfacesStatusTestMenuItemEntry);

    result.addAll(interfacesPageMenuEntriesCollector.collectMenuEntries());

    result.add(interfacesEmailTestMenuItemEntry);

    return result;
  }
}
