use of org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.datePicker.definition.DatePickerFieldDefinition in project kie-wb-common by kiegroup.
the class FieldRendererManagerImplTest method testFunctionallity.
@Test
public void testFunctionallity() {
testRendererFor(new CheckBoxFieldDefinition());
testRendererFor(new DatePickerFieldDefinition());
testRendererFor(new EnumListBoxFieldDefinition());
testRendererFor(new StringListBoxFieldDefinition());
testRendererFor(new StringRadioGroupFieldDefinition());
testRendererFor(new TextAreaFieldDefinition());
testRendererFor(new IntegerSliderDefinition());
testRendererFor(new DoubleSliderDefinition());
testRendererFor(new MultipleSubFormFieldDefinition());
testRendererFor(new SubFormFieldDefinition());
testRendererFor(new TextBoxFieldDefinition());
testRendererFor(new DecimalBoxFieldDefinition());
testRendererFor(new IntegerBoxFieldDefinition());
}
use of org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.datePicker.definition.DatePickerFieldDefinition in project kie-wb-common by kiegroup.
the class FormLayoutTemplateGeneratorTest method init.
@Before
public void init() {
templateGenerator = getTemplateGenerator();
form = new FormDefinition();
form.setName("Test");
form.setId("Test-ID");
TextBoxFieldDefinition name = new TextBoxFieldDefinition();
name.setId("name");
name.setName("employee_name");
name.setLabel("Name");
name.setPlaceHolder("Name");
name.setBinding("name");
name.setStandaloneClassName(String.class.getName());
TextBoxFieldDefinition lastName = new TextBoxFieldDefinition();
lastName.setId("lastName");
lastName.setName("employee_lastName");
lastName.setLabel("Last Name");
lastName.setPlaceHolder("Last Name");
lastName.setBinding("lastName");
lastName.setStandaloneClassName(String.class.getName());
DatePickerFieldDefinition birthday = new DatePickerFieldDefinition();
birthday.setId("birthday");
birthday.setName("employee_birthday");
birthday.setLabel("Birthday");
birthday.setBinding("birthday");
birthday.setStandaloneClassName(Date.class.getName());
CheckBoxFieldDefinition married = new CheckBoxFieldDefinition();
married.setId("married");
married.setName("employee_married");
married.setLabel("Married");
married.setBinding("married");
married.setStandaloneClassName(Boolean.class.getName());
form.getFields().add(name);
form.getFields().add(lastName);
form.getFields().add(birthday);
form.getFields().add(married);
}
use of org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.datePicker.definition.DatePickerFieldDefinition in project kie-wb-common by kiegroup.
the class TestFormGenerator method getEmployeeForm.
public static FormDefinition getEmployeeForm() {
FormDefinition form = new FormDefinition();
form.setName("Employee");
form.setId("Employee");
TextBoxFieldDefinition name = new TextBoxFieldDefinition();
name.setId(EMPLOYEE_NAME);
name.setName(EMPLOYEE_NAME);
name.setLabel("Name");
name.setPlaceHolder("Name");
name.setBinding(EMPLOYEE_NAME);
name.setStandaloneClassName(String.class.getName());
TextBoxFieldDefinition lastName = new TextBoxFieldDefinition();
lastName.setId(EMPLOYEE_SURNAME);
lastName.setName(EMPLOYEE_SURNAME);
lastName.setLabel("Surname");
lastName.setPlaceHolder("SurName");
lastName.setBinding(EMPLOYEE_SURNAME);
lastName.setStandaloneClassName(String.class.getName());
DatePickerFieldDefinition birthday = new DatePickerFieldDefinition();
birthday.setId(EMPLOYEE_BIRTHDAY);
birthday.setName(EMPLOYEE_BIRTHDAY);
birthday.setLabel("Birthday");
birthday.setBinding(EMPLOYEE_BIRTHDAY);
birthday.setStandaloneClassName(Date.class.getName());
TextBoxFieldDefinition age = new TextBoxFieldDefinition();
age.setId(EMPLOYEE_AGE);
age.setName(EMPLOYEE_AGE);
age.setLabel("Age");
age.setPlaceHolder("Age");
age.setBinding(EMPLOYEE_AGE_BINDING);
age.setStandaloneClassName(Integer.class.getName());
CheckBoxFieldDefinition married = new CheckBoxFieldDefinition();
married.setId(EMPLOYEE_MARRIED);
married.setName(EMPLOYEE_MARRIED);
married.setLabel("Married");
married.setBinding(EMPLOYEE_MARRIED);
married.setStandaloneClassName(Boolean.class.getName());
SubFormFieldDefinition address = new SubFormFieldDefinition();
address.setId(EMPLOYEE_ADDRESS);
address.setName(EMPLOYEE_ADDRESS);
address.setLabel("Address");
address.setBinding(EMPLOYEE_ADDRESS);
address.setNestedForm("Address");
address.setStandaloneClassName(Address.class.getName());
form.getFields().add(name);
form.getFields().add(lastName);
form.getFields().add(birthday);
form.getFields().add(age);
form.getFields().add(married);
form.getFields().add(address);
form.setModel(generateModelFor(form));
return form;
}
Aggregations