
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;

  @Inject
  private transient StrassenintragPlaceholderMenuEntry strassenintragPlaceholderMenuEntry;

  public CommonGebietMainMenuEntry() {
    super();
  }

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

    addDefaultGebietsgruppierungSubMenuEntriesSorted(result);

    addDefaultGebietGeometrieSubMenuEntriesSorted(result);

    addStrasseneintragEntries(result);
  }

  protected void addStrasseneintragEntries(List<MenuEntry> result) {
    result.addAll(strassenintragPlaceholderMenuEntry.getMenuEntriesSorted());
  }

  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);
  }
}
