use of edu.stanford.bmir.protege.web.shared.form.data.FormDataValue in project webprotege by protegeproject.
the class CollectionElementDataRepository_IT method shouldFindByCollectionIdAndElementId.
@Test
public void shouldFindByCollectionIdAndElementId() {
Map<FormElementId, FormDataValue> map = new HashMap<>();
map.put(FormElementId.get("theElement"), FormDataPrimitive.get("theValue"));
FormData formData = new FormData(map);
CollectionItemData data = new CollectionItemData(collectionId, elementId, formData);
repository.save(data);
assertThat(repository.find(collectionId, elementId), is(data));
}
use of edu.stanford.bmir.protege.web.shared.form.data.FormDataValue in project webprotege by protegeproject.
the class FormDataConverter method decodeObject.
@Override
public FormData decodeObject(DBObject fromDBObject, MappedField optionalExtraInfo) {
Map<FormElementId, FormDataValue> map = new HashMap<>();
fromDBObject.keySet().forEach(key -> {
FormDataValue value = valueConverter.decodeObject(fromDBObject.get(key), optionalExtraInfo);
map.put(FormElementId.get(key), value);
});
return new FormData(map);
}
use of edu.stanford.bmir.protege.web.shared.form.data.FormDataValue in project webprotege by protegeproject.
the class ChoiceFieldComboBoxEditor method setValue.
@Override
public void setValue(FormDataValue value) {
FormDataValue first = value.asList().get(0);
int index = 1;
for (ChoiceDescriptor descriptor : choiceDescriptors) {
if (descriptor.getValue().equals(first)) {
comboBox.setSelectedIndex(index);
break;
}
index++;
}
}
use of edu.stanford.bmir.protege.web.shared.form.data.FormDataValue in project webprotege by protegeproject.
the class ChoiceFieldSegmentedEditor method decrementSelection.
private void decrementSelection() {
if (selectedIndex - 1 > -1) {
FormDataValue choice = choices.get(selectedIndex - 1);
setSelection(choice, true);
}
}
use of edu.stanford.bmir.protege.web.shared.form.data.FormDataValue in project webprotege by protegeproject.
the class ChoiceFieldSegmentedEditor method incrementSelection.
private void incrementSelection() {
if (selectedIndex + 1 < choices.size()) {
FormDataValue choice = choices.get(selectedIndex + 1);
setSelection(choice, true);
}
}
Aggregations