Search in sources :

Example 6 with DatePickerFieldDefinition

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());
}
Also used : DoubleSliderDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.slider.definition.DoubleSliderDefinition) DatePickerFieldDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.datePicker.definition.DatePickerFieldDefinition) CheckBoxFieldDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.checkBox.definition.CheckBoxFieldDefinition) StringListBoxFieldDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.selectors.listBox.definition.StringListBoxFieldDefinition) TextAreaFieldDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.textArea.definition.TextAreaFieldDefinition) EnumListBoxFieldDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.selectors.listBox.definition.EnumListBoxFieldDefinition) MultipleSubFormFieldDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.relations.multipleSubform.definition.MultipleSubFormFieldDefinition) DecimalBoxFieldDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.decimalBox.definition.DecimalBoxFieldDefinition) StringRadioGroupFieldDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.selectors.radioGroup.definition.StringRadioGroupFieldDefinition) SubFormFieldDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.relations.subForm.definition.SubFormFieldDefinition) MultipleSubFormFieldDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.relations.multipleSubform.definition.MultipleSubFormFieldDefinition) TextBoxFieldDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.textBox.definition.TextBoxFieldDefinition) IntegerSliderDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.slider.definition.IntegerSliderDefinition) IntegerBoxFieldDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.integerBox.definition.IntegerBoxFieldDefinition) Test(org.junit.Test)

Example 7 with DatePickerFieldDefinition

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);
}
Also used : TextBoxFieldDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.textBox.definition.TextBoxFieldDefinition) DatePickerFieldDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.datePicker.definition.DatePickerFieldDefinition) CheckBoxFieldDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.checkBox.definition.CheckBoxFieldDefinition) FormDefinition(org.kie.workbench.common.forms.model.FormDefinition) Date(java.util.Date) Before(org.junit.Before)

Example 8 with DatePickerFieldDefinition

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;
}
Also used : SubFormFieldDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.relations.subForm.definition.SubFormFieldDefinition) Address(org.kie.workbench.common.forms.dynamic.test.model.Address) TextBoxFieldDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.textBox.definition.TextBoxFieldDefinition) DatePickerFieldDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.datePicker.definition.DatePickerFieldDefinition) CheckBoxFieldDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.checkBox.definition.CheckBoxFieldDefinition) FormDefinition(org.kie.workbench.common.forms.model.FormDefinition) Date(java.util.Date)

Aggregations

DatePickerFieldDefinition (org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.datePicker.definition.DatePickerFieldDefinition)8 Date (java.util.Date)5 TextBoxFieldDefinition (org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.textBox.definition.TextBoxFieldDefinition)5 CheckBoxFieldDefinition (org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.checkBox.definition.CheckBoxFieldDefinition)4 IntegerBoxFieldDefinition (org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.integerBox.definition.IntegerBoxFieldDefinition)4 DecimalBoxFieldDefinition (org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.decimalBox.definition.DecimalBoxFieldDefinition)3 SubFormFieldDefinition (org.kie.workbench.common.forms.fields.shared.fieldTypes.relations.subForm.definition.SubFormFieldDefinition)3 FormDefinition (org.kie.workbench.common.forms.model.FormDefinition)3 Test (org.junit.Test)2 MultipleSubFormFieldDefinition (org.kie.workbench.common.forms.fields.shared.fieldTypes.relations.multipleSubform.definition.MultipleSubFormFieldDefinition)2 Before (org.junit.Before)1 DataObjectFormModel (org.kie.workbench.common.forms.data.modeller.model.DataObjectFormModel)1 Address (org.kie.workbench.common.forms.dynamic.test.model.Address)1 EnumListBoxFieldDefinition (org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.selectors.listBox.definition.EnumListBoxFieldDefinition)1 StringListBoxFieldDefinition (org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.selectors.listBox.definition.StringListBoxFieldDefinition)1 StringRadioGroupFieldDefinition (org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.selectors.radioGroup.definition.StringRadioGroupFieldDefinition)1 DoubleSliderDefinition (org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.slider.definition.DoubleSliderDefinition)1 IntegerSliderDefinition (org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.slider.definition.IntegerSliderDefinition)1 TextAreaFieldDefinition (org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.textArea.definition.TextAreaFieldDefinition)1 Client (org.kie.workbench.common.forms.jbpm.server.service.formGeneration.model.Client)1