use of org.kie.workbench.common.screens.datamodeller.client.model.DataModelerPropertyEditorFieldInfo in project kie-wb-common by kiegroup.
the class JPADataObjectFieldEditor method updateGeneratedValueField.
private void updateGeneratedValueField(Annotation annotation) {
clearGeneratedValueField();
if (annotation != null) {
DataModelerPropertyEditorFieldInfo fieldInfo = getField(JPADataObjectFieldEditorView.GENERATED_VALUE_FIELD);
String strategy = AnnotationValueHandler.getStringValue(annotation, IdGeneratorField.STRATEGY, null);
String generator = AnnotationValueHandler.getStringValue(annotation, IdGeneratorField.GENERATOR, null);
fieldInfo.setCurrentValue(IdGeneratorField.STRATEGY, strategy);
fieldInfo.setCurrentValue(IdGeneratorField.GENERATOR, generator);
updatePropertyEditorField(JPADataObjectFieldEditorView.GENERATED_VALUE_FIELD, annotation, strategy != null ? strategy : IdGeneratorField.NOT_CONFIGURED_LABEL);
}
}
use of org.kie.workbench.common.screens.datamodeller.client.model.DataModelerPropertyEditorFieldInfo in project kie-wb-common by kiegroup.
the class JPADataObjectFieldEditor 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 IdGeneratorEditionDialog method onOK.
void onOK() {
DataModelerPropertyEditorFieldInfo fieldInfo = (DataModelerPropertyEditorFieldInfo) property;
fieldInfo.clearCurrentValues();
String strategy = view.getGeneratorType();
if (!UIUtil.NOT_SELECTED.equals(strategy)) {
fieldInfo.setCurrentValue(STRATEGY, strategy);
fieldInfo.setCurrentValue(GENERATOR, view.getGeneratorName());
}
view.hide();
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 RelationshipEditionDialog method onOK.
void onOK() {
DataModelerPropertyEditorFieldInfo fieldInfo = (DataModelerPropertyEditorFieldInfo) property;
fieldInfo.clearCurrentValues();
String relationType = view.getRelationType();
if (!relationType.equals(UIUtil.NOT_SELECTED)) {
fieldInfo.setCurrentValue(RELATION_TYPE, RelationType.valueOf(relationType));
fieldInfo.setCurrentValue(CASCADE, getCascadeTypes());
fieldInfo.setCurrentValue(FETCH, FetchMode.valueOf(view.getFetchMode()));
if (relationType.equals(RelationType.ONE_TO_ONE.name()) || relationType.equals(RelationType.MANY_TO_ONE.name())) {
fieldInfo.setCurrentValue(OPTIONAL, view.getOptional());
}
if (relationType.equals(RelationType.ONE_TO_ONE.name()) || relationType.equals(RelationType.ONE_TO_MANY.name()) || relationType.equals(RelationType.MANY_TO_MANY.name())) {
fieldInfo.setCurrentValue(MAPPED_BY, view.getMappedBy());
}
if (relationType.equals(RelationType.ONE_TO_ONE.name()) || relationType.equals(RelationType.ONE_TO_MANY.name())) {
fieldInfo.setCurrentValue(ORPHAN_REMOVAL, view.getOrphanRemoval());
}
}
view.hide();
if (okCommand != null) {
okCommand.execute();
}
}
Aggregations