
package de.ivu.elect.presentation.admin.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.replikation.menu.ReplikationStatusMenuItemEntry;

@Specializes
public class WasAdminMainMenuEntry extends CommonAdminMainMenuEntry {

  private static final long serialVersionUID = 1L;

  @Inject
  private transient ReplikationStatusMenuItemEntry replikationStatusMenuItemEntry;

  public WasAdminMainMenuEntry() {
    super();
  }

  @Override
  protected List<MenuEntry> getSubMenuEntriesSorted() {
    List<MenuEntry> result = new ArrayList<>(super.getSubMenuEntriesSorted());

    result.add(result.indexOf(systemStatusMenuItemEntry) + 1, replikationStatusMenuItemEntry);

    return result;
  }
}
