Project

General

Profile

Download (1.03 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2017 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.taxeditor.ui.combo;
10

    
11
import java.util.List;
12

    
13
import org.eclipse.jface.viewers.IStructuredContentProvider;
14

    
15
import eu.etaxonomy.cdm.api.service.ITermService;
16
import eu.etaxonomy.cdm.model.common.DefinedTermBase;
17
import eu.etaxonomy.cdm.model.common.TermType;
18
import eu.etaxonomy.taxeditor.store.CdmStore;
19

    
20
/**
21
 * @author pplitzner
22
 * @since Nov 24, 2017
23
 *
24
 */
25
public class TermUuidContentProvider implements IStructuredContentProvider {
26

    
27
    @Override
28
    public Object[] getElements(Object inputElement) {
29
        if(inputElement instanceof TermType){
30
            List<DefinedTermBase> terms = CdmStore.getService(ITermService.class).listByTermType((TermType) inputElement, null, null, null, null);
31
            return terms.toArray();
32
        }
33
        return null;
34
    }
35

    
36
}
(9-9/11)