ref #8385: better handling of distr preferences and term related preferences
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / preference / menu / FeatureMenuPreferences.java
1 /**
2 * Copyright (C) 2007 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.preference.menu;
10
11 import java.util.ArrayList;
12 import java.util.List;
13
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.editor.definedterm.input.TermEditorInput;
20 import eu.etaxonomy.taxeditor.preference.GeneralTermPreference;
21 import eu.etaxonomy.taxeditor.store.CdmStore;
22
23 /**
24 * <p>FeatureMenuPreferences class.</p>
25 *
26 * @author p.ciardelli
27 * @author n.hoffmann
28 * @created 17.09.2008
29 * @version 1.0
30 */
31 public class FeatureMenuPreferences extends GeneralTermPreference{
32
33 /** Constant <code>PLUGIN_ID="eu.etaxonomy.taxeditor.preferences.feat"{trunked}</code> */
34 public static final String PLUGIN_ID = "eu.etaxonomy.taxeditor.preferences.nameFeature"; //$NON-NLS-1$
35
36 /**
37 * <p>Constructor for FeatureMenuPreference.</p>
38 */
39 public FeatureMenuPreferences() {
40 super();
41 setLocalPref(true);
42 setPredicate(PreferencePredicate.TaxonFeatures);
43 type = TermType.Feature;
44 }
45
46
47
48 @Override
49 public boolean performOk(){
50 if (isApply()){
51 boolean result = super.performOk();
52 if (result){
53 TermEditorInput.getPreferredTaxonFeatureTree(true);
54 }
55 }
56 return true;
57
58 }
59
60 @Override
61 protected void initialiseVocabularies() {
62
63 super.initialiseVocabularies();
64 List<TermVocabularyDto> vocs = new ArrayList<>();
65 vocs.add(CdmStore.getService(IVocabularyService.class).findVocabularyDtoByVocabularyUuid(VocabularyEnum.NameFeature.getUuid()));
66 this.getVocabularies().removeAll(vocs);
67
68 }
69
70
71
72 }