
package de.ivu.elect.presentation.kandidatur.action;

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

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

import de.ivu.elect.business.kandidatur.entity.Kandidatur;
import de.ivu.elect.jee.presentation.action.AbstractActionMenuModelBuilder;
import de.ivu.elect.jee.presentation.action.ActionEntry;

@Named(KandidaturActionMenu.COMPONENT_NAME)
public class KandidaturActionMenu extends AbstractActionMenuModelBuilder<Kandidatur> {

  private static final long serialVersionUID = 1L;

  public static final String COMPONENT_NAME = "kandidaturActionMenu";

  @Inject
  protected transient KandidaturDirektkandidaturSearchAuswaehlenAction kandidaturDirektkandidaturSearchAuswaehlenAction;

  @Inject
  protected transient KandidaturListeSearchAuswaehlenAction kandidaturListeSearchAuswaehlenAction;

  @Inject
  protected transient KandidaturListenkandidaturSearchAuswaehlenAction kandidaturListenkandidaturSearchAuswaehlenAction;

  @Inject
  protected transient KandidaturEditAction kandidaturEditAction;

  public KandidaturActionMenu() {
    super();
  }

  @Override
  // Cf. DirektkandidaturActionMenu#getActionEntriesSorted, ListenkandidaturActionMenu#getActionEntriesSorted, ListeActionMenu#getActionEntriesSorted!
  protected List<ActionEntry<Kandidatur>> getActionEntriesSorted() {
    List<ActionEntry<Kandidatur>> result = new ArrayList<>();

    result.add(kandidaturDirektkandidaturSearchAuswaehlenAction); // ELECT-10703

    result.add(kandidaturListeSearchAuswaehlenAction);
    result.add(kandidaturListenkandidaturSearchAuswaehlenAction); // ELECT-10703

    addKandidaturPersonenKonfliktAufloesenAction(result);

    addKandidaturEditAction(result);

    addKandidaturPersonenKonfliktActions(result);

    return result;
  }

  protected void addKandidaturEditAction(List<ActionEntry<Kandidatur>> result) {
    result.add(kandidaturEditAction);
  }

  protected void addKandidaturPersonenKonfliktAufloesenAction(List<ActionEntry<Kandidatur>> result) {
    // nichts zu tun
  }

  protected void addKandidaturPersonenKonfliktActions(List<ActionEntry<Kandidatur>> result) {
    // nichts zu tun
  }
}
