use of org.kie.workbench.common.screens.datamodeller.events.DataObjectFieldCreatedEvent in project kie-wb-common by kiegroup.
the class AddPropertyCommand method execute.
@Override
public void execute() {
// extra check
boolean multiple = isMultiple && !getContext().getHelper().isPrimitiveType(propertyType);
property = new ObjectPropertyImpl(propertyName, propertyType, multiple);
if (propertyLabel != null && !"".equals(propertyLabel)) {
Annotation annotation = new AnnotationImpl(getContext().getAnnotationDefinitions().get(MainDomainAnnotations.LABEL_ANNOTATION));
annotation.setValue(MainDomainAnnotations.VALUE_PARAM, propertyLabel);
property.addAnnotation(annotation);
}
dataObject.addProperty(property);
if (!property.isBaseType()) {
getContext().getHelper().dataObjectReferenced(property.getClassName(), dataObject.getClassName());
}
notifyChange(new DataObjectFieldCreatedEvent(getContext().getContextId(), getSource(), getDataObject(), property));
}
Aggregations