Project

General

Profile

Download (1.58 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.preference.menu;
10

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

    
14
import eu.etaxonomy.cdm.model.description.Feature;
15
import eu.etaxonomy.cdm.model.term.TermType;
16
import eu.etaxonomy.taxeditor.editor.definedterm.input.TermEditorInput;
17
import eu.etaxonomy.taxeditor.l10n.Messages;
18
import eu.etaxonomy.taxeditor.store.CdmStore;
19

    
20
/**
21
 * @author k.luther
22
 * @since 14.05.2019
23
 *
24
 */
25
public class NameFeatureMenuPreference extends AbstractMenuPreferences<Feature> {
26
    /** Constant <code>PLUGIN_ID="eu.etaxonomy.taxeditor.preferences.feat"{trunked}</code> */
27
    public static final String PLUGIN_ID = "eu.etaxonomy.taxeditor.preferences.nameFeature"; //$NON-NLS-1$
28

    
29
    /**
30
     * <p>Constructor for FeatureMenuPreferences.</p>
31
     */
32
    public NameFeatureMenuPreference() {
33
        super("Name Feature Preferences", //$NON-NLS-1$
34
                Messages.FeatureMenuPreferences_display,
35
                false);
36
    }
37

    
38
    /** {@inheritDoc} */
39
    @Override
40
    protected TermType getTermType() {
41
        return TermType.Feature;
42
    }
43
    @Override
44
    protected List<Feature> getTerms(){
45
        if(CdmStore.isActive() ){
46
            List<Feature> termList = new ArrayList(TermEditorInput.getDefaultNameFeatureTree().getDistinctTerms());
47
            return termList;
48
        }
49
        return new ArrayList<>();
50
    }
51
}
(12-12/22)