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

import java.util.List;

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

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

@Specializes
public class CommonGebietMainMenuEntry extends GebietMainMenuEntry {

  private static final long serialVersionUID = 1L;

  @Inject
  private transient GebietsgruppierungPageMenu gebietsgruppierungPageMenu;

  @Inject
  private transient GebietGeometrieImportMenuItemEntry gebietGeometrieImportMenuItemEntry;

  @Inject
  private transient GebietGeometrieExportMenuItemEntry gebietGeometrieExportMenuItemEntry;

  public CommonGebietMainMenuEntry() {
    super();
  }

  @Override
  protected void addAdditionalEntries(List<MenuEntry> result) {
    super.addAdditionalEntries(result);

    addDefaultGebietsgruppierungSubMenuEntriesSorted(result);

    addDefaultGebietGeometrieSubMenuEntriesSorted(result);
  }

  protected void addDefaultGebietsgruppierungSubMenuEntriesSorted(List<MenuEntry> result) {
    result.add(separator);
    result.addAll(gebietsgruppierungPageMenu.getMenuEntriesSorted());
  }

  protected void addDefaultGebietGeometrieSubMenuEntriesSorted(List<MenuEntry> result) {
    result.add(separator);
    result.add(gebietGeometrieImportMenuItemEntry);
    result.add(gebietGeometrieExportMenuItemEntry);
  }
}
