package ch.openech.frontend.ech0011;

import java.util.Arrays;
import java.util.List;

import org.minimalj.frontend.form.Form;
import org.minimalj.frontend.form.element.EnumFormElement;
import org.minimalj.frontend.form.element.FormLookupFormElement;

import ch.ech.ech0021.GuardianRelationship;
import ch.ech.ech0021.TypeOfRelationship;

public class GuardianRelationshipFormElement extends FormLookupFormElement<GuardianRelationship> {
	private static final List<TypeOfRelationship> TYPES = Arrays.asList(TypeOfRelationship._7, TypeOfRelationship._8, TypeOfRelationship._9, TypeOfRelationship._10);

	public GuardianRelationshipFormElement(GuardianRelationship key, boolean editable) {
		super(key, editable);
	}

	@Override
	public Form<GuardianRelationship> createForm() {
		Form<GuardianRelationship> form = new Form<>(2);
		form.line(new EnumFormElement<TypeOfRelationship>(GuardianRelationship.$.typeOfRelationship, TYPES));
		form.line(new IdentificationFormElement(GuardianRelationship.$.partner.identification, false));
		form.line(new MailAddressFormElement(GuardianRelationship.$.partner.address, true));
//		form.line(new EnumSetFormElement<Set<Enum<?>>>(GuardianRelationship.$.partner.address, true));
		form.line(GuardianRelationship.$.guardianMeasureInfo.basedOnLawAddOn);
		form.line(GuardianRelationship.$.guardianMeasureInfo.guardianMeasureValidFrom);
		return form;
	}

}

@@ -221,26 +221,20 @@
 element.
-FormLookup
+List
 FormElem
@@ -383,18 +383,12 @@
 nds 
-FormLookup
+List
 Form
@@ -615,32 +615,37 @@
 shipFormElement(
+List%3C
 GuardianRelation
@@ -648,16 +648,17 @@
 tionship
+%3E
  key, bo
@@ -1108,107 +1108,8 @@
 ));%0A
-//%09%09form.line(new EnumSetFormElement%3CSet%3CEnum%3C?%3E%3E%3E(GuardianRelationship.$.partner.address, true));%0A
 %09%09fo
@@ -1259,16 +1259,59 @@
 dFrom);%0A
+%09%09form.line(GuardianRelationship.$.care);%0A%0A
 %09%09return

PersonForm.GuardianRelations