use of org.kie.workbench.common.screens.datamodeller.client.model.DataModelerPropertyEditorFieldInfo in project kie-wb-common by kiegroup.
the class SequenceGeneratorEditionDialog method show.
@Override
public void show() {
DataModelerPropertyEditorFieldInfo fieldInfo = (DataModelerPropertyEditorFieldInfo) property;
String sequenceName = (String) fieldInfo.getCurrentValue(SequenceGeneratorValueHandler.SEQUENCE_NAME);
String generatorName = (String) fieldInfo.getCurrentValue(SequenceGeneratorValueHandler.NAME);
Object initialValue = fieldInfo.getCurrentValue(SequenceGeneratorValueHandler.INITIAL_VALUE);
Object allocationSize = fieldInfo.getCurrentValue(SequenceGeneratorValueHandler.ALLOCATION_SIZE);
view.setSequenceName(sequenceName);
view.setGeneratorName(generatorName);
view.setInitialValue(initialValue != null ? initialValue.toString() : null);
view.clearInitialValueError();
view.setAllocationSize(allocationSize != null ? allocationSize.toString() : null);
view.clearAllocationSizeError();
view.setEnabled(!fieldInfo.isDisabled());
view.show();
}
use of org.kie.workbench.common.screens.datamodeller.client.model.DataModelerPropertyEditorFieldInfo in project kie-wb-common by kiegroup.
the class SequenceGeneratorEditionDialog method onOK.
void onOK() {
DataModelerPropertyEditorFieldInfo fieldInfo = (DataModelerPropertyEditorFieldInfo) property;
fieldInfo.clearCurrentValues();
String generatorName = view.getGeneratorName();
if (generatorName != null && !generatorName.isEmpty()) {
fieldInfo.setCurrentValue(SequenceGeneratorValueHandler.NAME, generatorName);
fieldInfo.setCurrentValue(SequenceGeneratorValueHandler.SEQUENCE_NAME, view.getSequenceName());
fieldInfo.setCurrentValue(SequenceGeneratorValueHandler.INITIAL_VALUE, getInitialValue());
fieldInfo.setCurrentValue(SequenceGeneratorValueHandler.ALLOCATION_SIZE, getAllocationSize());
}
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 JPADataObjectEditor 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 updateSequenceGeneratorField.
private void updateSequenceGeneratorField(Annotation annotation) {
clearSequenceGeneratorField();
if (annotation != null) {
SequenceGeneratorValueHandler valueHandler = new SequenceGeneratorValueHandler(annotation);
DataModelerPropertyEditorFieldInfo fieldInfo = getField(JPADataObjectFieldEditorView.SEQUENCE_GENERATOR_FIELD);
fieldInfo.setCurrentValue(SequenceGeneratorValueHandler.NAME, valueHandler.getName());
fieldInfo.setCurrentValue(SequenceGeneratorValueHandler.SEQUENCE_NAME, valueHandler.getSequenceName());
fieldInfo.setCurrentValue(SequenceGeneratorValueHandler.INITIAL_VALUE, valueHandler.getInitialValue());
fieldInfo.setCurrentValue(SequenceGeneratorValueHandler.ALLOCATION_SIZE, valueHandler.getAllocationSize());
updatePropertyEditorField(JPADataObjectFieldEditorView.SEQUENCE_GENERATOR_FIELD, annotation, valueHandler.getName());
}
}
use of org.kie.workbench.common.screens.datamodeller.client.model.DataModelerPropertyEditorFieldInfo in project kie-wb-common by kiegroup.
the class JPADataObjectFieldEditorTest method createFieldInfo.
private DataModelerPropertyEditorFieldInfo createFieldInfo(String key, Pair<String, Object>... currentValues) {
DataModelerPropertyEditorFieldInfo fieldInfo = new DataModelerPropertyEditorFieldInfo(key, "not_used", null);
if (currentValues != null) {
for (Pair<String, Object> value : currentValues) {
fieldInfo.setCurrentValue(value.getK1(), value.getK2());
}
}
fieldInfo.withKey(key);
return fieldInfo;
}
Aggregations