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
.menu
;
11 import java
.util
.ArrayList
;
12 import java
.util
.List
;
14 import eu
.etaxonomy
.cdm
.api
.service
.IVocabularyService
;
15 import eu
.etaxonomy
.cdm
.model
.metadata
.PreferencePredicate
;
16 import eu
.etaxonomy
.cdm
.model
.term
.TermType
;
17 import eu
.etaxonomy
.cdm
.model
.term
.VocabularyEnum
;
18 import eu
.etaxonomy
.cdm
.persistence
.dto
.TermVocabularyDto
;
19 import eu
.etaxonomy
.taxeditor
.preference
.GeneralTermPreference
;
20 import eu
.etaxonomy
.taxeditor
.preference
.PreferencesUtil
;
21 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
28 public class NameFeatureMenuPreference
extends GeneralTermPreference
{
29 /** Constant <code>PLUGIN_ID="eu.etaxonomy.taxeditor.preferences.feat"{trunked}</code> */
30 public static final String PLUGIN_ID
= "eu.etaxonomy.taxeditor.preferences.nameFeature"; //$NON-NLS-1$
33 * <p>Constructor for NameFeatureMenuPreference.</p>
35 public NameFeatureMenuPreference() {
37 setPredicate(PreferencePredicate
.NameFeatures
);
38 type
= TermType
.Feature
;
44 public boolean performOk(){
46 boolean result
= super.performOk();
48 PreferencesUtil
.createPreferredFeatureTreeForNameDescription();
56 protected void initialiseVocabularies() {
58 if (getVocabularies() != null) {
59 getVocabularies().clear();
61 List
<TermVocabularyDto
> vocs
= new ArrayList
<>();
62 vocs
.add(CdmStore
.getService(IVocabularyService
.class).findVocabularyDtoByVocabularyUuid(VocabularyEnum
.NameFeature
.getUuid()));
64 setVocabularies(vocs
);