use of eu.esdihumboldt.hale.ui.codelist.service.CodeListService in project hale by halestudio.
the class CodeListImportAdvisor method handleResults.
/**
* @see IOAdvisor#handleResults(IOProvider)
*/
@Override
public void handleResults(CodeListReader provider) {
CodeList code = provider.getCodeList();
CodeListService cs = getService(CodeListService.class);
if (cs != null) {
cs.addCodeList(provider.getResourceIdentifier(), code);
}
super.handleResults(provider);
}
use of eu.esdihumboldt.hale.ui.codelist.service.CodeListService in project hale by halestudio.
the class DefaultPropertyEditor method updateCodeList.
private void updateCodeList() {
values = new ArrayList<Object>();
if (enumerationValues != null)
values.addAll(enumerationValues);
CodeListService clService = PlatformUI.getWorkbench().getService(CodeListService.class);
if (entity != null) {
codeList = clService.findCodeListByEntity(entity);
}
if (codeList == null)
codeList = clService.findCodeListByIdentifier(codeListNamespace, codeListName);
if (codeList != null) {
// other values are explicitly allowed by the enumerations
if (values.isEmpty() || otherValuesAllowed)
values.addAll(codeList.getEntries());
}
values.trimToSize();
// save combo text to restore after setting the new input
String oldValue = viewer.getCombo().getText();
viewer.setInput(values);
viewer.getCombo().setText(oldValue);
}
Aggregations