use of org.kie.workbench.common.screens.datamodeller.client.model.DataModelerPropertyEditorFieldInfo in project kie-wb-common by kiegroup.
the class JPADataObjectEditor method createField.
private DataModelerPropertyEditorFieldInfo createField(String label, String key, String currentStringValue, Class<?> customFieldClass, String helpHeading, String helpText) {
DataModelerPropertyEditorFieldInfo fieldInfo = propertyEditorFields.get(key);
if (fieldInfo == null) {
fieldInfo = new DataModelerPropertyEditorFieldInfo(label, currentStringValue, customFieldClass);
fieldInfo.withKey(key);
if (helpHeading != null) {
fieldInfo.withHelpInfo(helpHeading, helpText);
}
propertyEditorFields.put(key, fieldInfo);
}
return fieldInfo;
}
use of org.kie.workbench.common.screens.datamodeller.client.model.DataModelerPropertyEditorFieldInfo in project kie-wb-common by kiegroup.
the class IdGeneratorEditionDialog method okButton.
void okButton() {
// TODO add validation in order to establish if the ok operation can be performed. If validation is ok,
// then new current values can be set.
DataModelerPropertyEditorFieldInfo fieldInfo = (DataModelerPropertyEditorFieldInfo) property;
String strategy = generatorType.getValue();
strategy = "NONE".equals(strategy) ? null : strategy;
String generator = generatorName.getText();
fieldInfo.setCurrentValue("strategy", strategy);
fieldInfo.setCurrentValue("generator", generator);
super.hide();
revertChanges = Boolean.FALSE;
if (okCommand != null) {
okCommand.execute();
}
}
use of org.kie.workbench.common.screens.datamodeller.client.model.DataModelerPropertyEditorFieldInfo in project kie-wb-common by kiegroup.
the class JPADataObjectEditor method createField.
private DataModelerPropertyEditorFieldInfo createField(String label, String key, String currentStringValue, Class<?> customFieldClass, String helpHeading, String helpText, boolean readonly) {
DataModelerPropertyEditorFieldInfo fieldInfo = propertyEditorFields.get(key);
if (fieldInfo == null) {
fieldInfo = new DataModelerPropertyEditorFieldInfo(label, currentStringValue, customFieldClass);
fieldInfo.withKey(key);
if (helpHeading != null) {
fieldInfo.withHelpInfo(helpHeading, helpText);
}
propertyEditorFields.put(key, fieldInfo);
}
fieldInfo.setDisabled(readonly);
return fieldInfo;
}
use of org.kie.workbench.common.screens.datamodeller.client.model.DataModelerPropertyEditorFieldInfo in project kie-wb-common by kiegroup.
the class JPADataObjectFieldEditor method updatePropertyEditorField.
private void updatePropertyEditorField(String fieldId, Annotation currentValue, String currentStringValue) {
DataModelerPropertyEditorFieldInfo fieldInfo = propertyEditorFields.get(fieldId);
fieldInfo.setCurrentValue(currentValue);
fieldInfo.setCurrentStringValue(currentStringValue);
}
use of org.kie.workbench.common.screens.datamodeller.client.model.DataModelerPropertyEditorFieldInfo in project kie-wb-common by kiegroup.
the class JPADataObjectFieldEditor method updateRelationshipField.
private void updateRelationshipField(Annotation annotation) {
clearRelationshipField();
if (annotation != null) {
RelationshipAnnotationValueHandler valueHandler = new RelationshipAnnotationValueHandler(annotation);
DataModelerPropertyEditorFieldInfo fieldInfo = getField(JPADataObjectFieldEditorView.RELATIONSHIP_TYPE_FIELD);
fieldInfo.setCurrentValue(RelationshipAnnotationValueHandler.RELATION_TYPE, valueHandler.getRelationType());
fieldInfo.setCurrentValue(RelationshipAnnotationValueHandler.CASCADE, valueHandler.getCascade());
fieldInfo.setCurrentValue(RelationshipAnnotationValueHandler.FETCH, valueHandler.getFetch());
fieldInfo.setCurrentValue(RelationshipAnnotationValueHandler.OPTIONAL, valueHandler.getOptional());
fieldInfo.setCurrentValue(RelationshipAnnotationValueHandler.MAPPED_BY, valueHandler.getMappedBy());
fieldInfo.setCurrentValue(RelationshipAnnotationValueHandler.ORPHAN_REMOVAL, valueHandler.getOrphanRemoval());
if (valueHandler.isOneToMany()) {
fieldInfo.removeCurrentValue(RelationshipAnnotationValueHandler.OPTIONAL);
} else if (valueHandler.isManyToOne()) {
fieldInfo.removeCurrentValue(RelationshipAnnotationValueHandler.MAPPED_BY);
fieldInfo.removeCurrentValue(RelationshipAnnotationValueHandler.ORPHAN_REMOVAL);
} else if (valueHandler.isManyToMany()) {
fieldInfo.removeCurrentValue(RelationshipAnnotationValueHandler.OPTIONAL);
fieldInfo.removeCurrentValue(RelationshipAnnotationValueHandler.ORPHAN_REMOVAL);
}
updatePropertyEditorField(JPADataObjectFieldEditorView.RELATIONSHIP_TYPE_FIELD, annotation, valueHandler.getRelationType().name());
}
}
Aggregations