Project

General

Profile

Download (1.7 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
    /* (non-Javadoc)
39
     * @see eu.etaxonomy.taxeditor.preference.menu.AbstractMenuPreferences#getTermClass()
40
     */
41
    /** {@inheritDoc} */
42
    @Override
43
    protected TermType getTermType() {
44
        return TermType.Feature;
45
    }
46
    @Override
47
    protected List<Feature> getTerms(){
48
        if(CdmStore.isActive() ){
49
            List<Feature> termList = new ArrayList(TermEditorInput.getDefaultNameFeatureTree().getDistinctFeatures());
50
            return termList;
51
        }
52
        return new ArrayList<Feature>();
53
    }
54
}
(12-12/23)