use of org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.textArea.definition.TextAreaFieldDefinition in project kie-wb-common by kiegroup.
the class TextAreaFieldRendererTest method getFieldDefinition.
@Override
protected TextAreaFieldDefinition getFieldDefinition() {
TextAreaFieldDefinition textAreaFieldDefinition = new TextAreaFieldDefinition();
textAreaFieldDefinition.setName(NAME);
textAreaFieldDefinition.setBinding(NAME);
textAreaFieldDefinition.setPlaceHolder(NAME);
return textAreaFieldDefinition;
}
use of org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.textArea.definition.TextAreaFieldDefinition in project kie-wb-common by kiegroup.
the class FieldRendererManagerImplTest method testFunctionallity.
@Test
public void testFunctionallity() {
testRendererFor(new CheckBoxFieldDefinition(), CheckBoxFieldRenderer.class, 1);
testRendererFor(new DatePickerFieldDefinition(), DatePickerFieldRenderer.class, 1);
testRendererFor(new EnumListBoxFieldDefinition(), EnumListBoxFieldRenderer.class, 1);
testRendererFor(new StringListBoxFieldDefinition(), StringListBoxFieldRenderer.class, 1);
testRendererFor(new IntegerListBoxFieldDefinition(), IntegerListBoxFieldRenderer.class, 1);
testRendererFor(new StringRadioGroupFieldDefinition(), StringRadioGroupFieldRenderer.class, 1);
testRendererFor(new IntegerRadioGroupFieldDefinition(), IntegerRadioGroupFieldRenderer.class, 1);
testRendererFor(new TextAreaFieldDefinition(), TextAreaFieldRenderer.class, 1);
testRendererFor(new IntegerSliderDefinition(), SliderFieldRenderer.class, 1);
testRendererFor(new DoubleSliderDefinition(), SliderFieldRenderer.class, 2);
testRendererFor(new MultipleSubFormFieldDefinition(), MultipleSubFormFieldRenderer.class, 1);
testRendererFor(new SubFormFieldDefinition(), SubFormFieldRenderer.class, 1);
testRendererFor(new TextBoxFieldDefinition(), TextBoxFieldRenderer.class, 1);
testRendererFor(new CharacterBoxFieldDefinition(), TextBoxFieldRenderer.class, 2);
testRendererFor(new DecimalBoxFieldDefinition(), DecimalBoxFieldRenderer.class, 1);
testRendererFor(new IntegerBoxFieldDefinition(), IntegerBoxFieldRenderer.class, 1);
testUnexistingRenderer(new PictureFieldDefinition());
}
use of org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.textArea.definition.TextAreaFieldDefinition in project kie-wb-common by kiegroup.
the class FormEditorPresenterTest method testFieldProperties.
protected void testFieldProperties(String fieldId, boolean bound) {
FormDefinition form = editorHelper.getFormDefinition();
addField(editorHelper.getAvailableFields().values().stream().filter(fieldDefinition -> fieldDefinition.getBinding().equals(fieldId)).findFirst().get());
checkExpectedFields(editorHelper.getAvailableFields().size(), 1, bound);
FieldDefinition field = editorHelper.getFormDefinition().getFields().get(0);
checkFieldType(field, TextBoxFieldDefinition.class);
Collection<String> compatibleTypes = editorHelper.getCompatibleFieldTypes(field);
assertNotNull("No compatibles types found!", compatibleTypes);
assertTrue("There should exist more than one compatible types for TextBoxFieldDefinition!", compatibleTypes.size() > 1);
assertTrue("Missing TextAreaFieldDefinition as a compatible type for TextBoxFieldDefinition", compatibleTypes.contains(TextAreaFieldDefinition.FIELD_TYPE.getTypeName()));
field = editorHelper.switchToFieldType(field, TextAreaFieldDefinition.FIELD_TYPE.getTypeName());
checkFieldType(field, TextAreaFieldDefinition.class);
List<String> compatibleFields = editorHelper.getCompatibleModelFields(field);
assertNotNull("No compatibles fields found!", compatibleFields);
assertEquals("There should exist 1 compatible fields for " + field.getName() + "!", 1, compatibleFields.size());
String expectedBindingExpression = "lastName";
field = editorHelper.switchToField(field, expectedBindingExpression);
assertEquals("Wrong binding expression after switch field!", field.getBinding(), expectedBindingExpression);
}
Aggregations