Project

General

Profile

Download (1.19 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2019 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.dialog.configurator.wizard;
10

    
11
import java.util.ArrayList;
12
import java.util.Collection;
13

    
14
import eu.etaxonomy.cdm.api.service.IVocabularyService;
15
import eu.etaxonomy.cdm.persistence.dto.TermDto;
16
import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
17
import eu.etaxonomy.taxeditor.editor.definedterm.TermDtoContentProvider;
18
import eu.etaxonomy.taxeditor.store.CdmStore;
19

    
20
/**
21
 * @author k.luther
22
 * @since 03.12.2019
23
 */
24
public class NamedAreaTermDtoContentProvider extends TermDtoContentProvider {
25

    
26
    @Override
27
    public Collection<? extends TermDto> getChildTerms(TermVocabularyDto voc) {
28
        Collection<TermDto> children = getVocabularyToChildTermMap().get(voc);
29
        if(children==null){
30
            children = new ArrayList<>(CdmStore.getService(IVocabularyService.class).getCompleteTermHierarchy(voc));
31
            getVocabularyToChildTermMap().put(voc, children);
32
        }
33
        return children;
34
    }
35

    
36
}
(1-1/2)