use of org.jboss.errai.databinding.client.MapPropertyType in project kie-wb-common by kiegroup.
the class MapModelBindingHelperTest method checkBindableProxy.
protected void checkBindableProxy(MapBindableProxy model) {
assertFalse(model.getBeanProperties().isEmpty());
checkSimpleTypeProperty(model.getBeanProperties().get(EMPLOYEE_NAME), String.class);
checkSimpleTypeProperty(model.getBeanProperties().get(EMPLOYEE_SURNAME), String.class);
checkSimpleTypeProperty(model.getBeanProperties().get(EMPLOYEE_AGE_BINDING), Integer.class);
checkSimpleTypeProperty(model.getBeanProperties().get(EMPLOYEE_BIRTHDAY), Date.class);
checkSimpleTypeProperty(model.getBeanProperties().get(EMPLOYEE_MARRIED), Boolean.class);
PropertyType addressPropertyType = model.getBeanProperties().get(EMPLOYEE_ADDRESS);
assertNotNull(addressPropertyType);
assertTrue(addressPropertyType instanceof MapPropertyType);
MapPropertyType address = (MapPropertyType) addressPropertyType;
checkSimpleTypeProperty(address.getPropertyTypes().get(ADDRESS_STREET), String.class);
checkSimpleTypeProperty(address.getPropertyTypes().get(ADDRESS_NUM), Integer.class);
}
use of org.jboss.errai.databinding.client.MapPropertyType in project kie-wb-common by kiegroup.
the class MapModelBindingHelper method getModeldefinitionFor.
public MapPropertyType getModeldefinitionFor(MultipleSubFormFieldDefinition subFormField, MapModelRenderingContext context, Map<String, Map<String, PropertyType>> availableModels) {
FormDefinition creationForms = context.getAvailableForms().get(subFormField.getCreationForm());
Map<String, PropertyType> modelDefinition = generateModelDefinition(creationForms, context, availableModels);
FormDefinition editionForm = context.getAvailableForms().get(subFormField.getCreationForm());
modelDefinition.putAll(generateModelDefinition(editionForm, context, availableModels));
modelDefinition.put(MapModelRenderingContext.FORM_ENGINE_OBJECT_IDX, new PropertyType(Integer.class));
modelDefinition.put(MapModelRenderingContext.FORM_ENGINE_EDITED_OBJECT, new PropertyType(Boolean.class));
return new MapPropertyType(modelDefinition);
}
Aggregations