Search in sources :

Example 1 with CodeListService

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);
}
Also used : CodeList(eu.esdihumboldt.hale.common.codelist.CodeList) CodeListService(eu.esdihumboldt.hale.ui.codelist.service.CodeListService)

Example 2 with CodeListService

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);
}
Also used : CodeListService(eu.esdihumboldt.hale.ui.codelist.service.CodeListService)

Aggregations

CodeListService (eu.esdihumboldt.hale.ui.codelist.service.CodeListService)2 CodeList (eu.esdihumboldt.hale.common.codelist.CodeList)1