2 * Copyright (C) 2019 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
9 package eu
.etaxonomy
.taxeditor
.preference
;
11 import java
.util
.ArrayList
;
12 import java
.util
.List
;
14 import eu
.etaxonomy
.cdm
.api
.service
.ITermCollectionService
;
15 import eu
.etaxonomy
.cdm
.model
.metadata
.PreferencePredicate
;
16 import eu
.etaxonomy
.cdm
.model
.term
.TermType
;
17 import eu
.etaxonomy
.cdm
.persistence
.dto
.TermCollectionDto
;
18 import eu
.etaxonomy
.cdm
.persistence
.dto
.TermVocabularyDto
;
19 import eu
.etaxonomy
.taxeditor
.preference
.wizard
.GeneralVocabularyPreferencePage
;
20 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
26 public class NamedAreaVocabularyPreferencePage
extends GeneralVocabularyPreferencePage
{
27 List
<TermCollectionDto
> collList
= new ArrayList
<>();
29 public NamedAreaVocabularyPreferencePage() {
30 isAdminPreference
= false;
31 setPredicate(PreferencePredicate
.AvailableDistributionAreaVocabularies
);
32 type
= TermType
.NamedArea
;
36 protected void initialiseVocabularies() {
38 List
<TermVocabularyDto
> vocs
= new ArrayList
<>();
39 collList
= CdmStore
.getService(ITermCollectionService
.class).findCollectionDtoByTermType(type
);
43 protected List
<TermCollectionDto
> getCollections() {
49 protected void setInput() {
50 treeComposite
.getViewer().getTree().deselectAll();
51 treeComposite
.getViewer().refresh();
52 List
<TermCollectionDto
> collList
= new ArrayList
<>(getCollections());
54 treeComposite
.getViewer().setInput(collList
);