
package de.ivu.elect.presentation.wahl;

import java.util.List;

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

import de.ivu.elect.business.gebietsbaum.entity.Gebietsart;
import de.ivu.elect.business.wahl.entity.Wahlart;
import de.ivu.elect.jee.presentation.dynamicform.FormBuilder;
import de.ivu.elect.presentation.wahl.form.CommonWahlartViewFormBuilder;
import de.ivu.elect.presentation.wahl.form.GebietsartPickListProperty;

@Specializes
public class CommonWahlartCreateView extends WahlartCreateView {

  private static final long serialVersionUID = 1L;

  @Inject
  private transient CommonWahlartViewFormBuilder wahlartViewFormBuilder;

  private GebietsartPickListProperty gebietsartPickListProperty;

  public CommonWahlartCreateView() {
    super();
  }

  @Override
  public void addProperties(FormBuilder formBuilder, Wahlart wahlart) {
    gebietsartPickListProperty = wahlartViewFormBuilder.addPropertiesMitGebietsart(formBuilder, wahlart);
  }

  @Override
  protected List<Gebietsart> getZugeordneteGebietsarten() {
    return gebietsartPickListProperty.getZugeordneteElemente();
  }
}
