Project

General

Profile

Download (2.18 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2018 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.wizard;
10

    
11
import java.util.List;
12

    
13
import org.eclipse.swt.widgets.Button;
14
import org.eclipse.swt.widgets.Composite;
15

    
16
import eu.etaxonomy.cdm.model.metadata.CdmPreference;
17
import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
18
import eu.etaxonomy.cdm.model.term.TermType;
19
import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
20
import eu.etaxonomy.taxeditor.l10n.Messages;
21
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
22

    
23

    
24

    
25
/**
26
 * @author k.luther
27
 * @since 05.10.2018
28
 *
29
 */
30
public class AvailableDistributionStatusPage extends TermSelectionWizardPage {
31

    
32
    Button overrideButton;
33

    
34
    public AvailableDistributionStatusPage(String pageName, CdmPreference pref, boolean localPref) {
35
        super(pageName, TermType.PresenceAbsenceTerm);
36
        this.pref = pref;
37
        this.localPref = localPref;
38
    }
39

    
40
    @Override
41
    public void createControl(Composite parent) {
42
        setTitle(Messages.AvailableDistributionStatusPage_PAGE_TITLE);
43
        setDescription(Messages.AvailableDistributionStatusPage_PAGE_DESCRIPTION);
44
        if (localPref){
45
            override = PreferencesUtil.getBooleanValue(PreferencesUtil.createOverridePreferenceString(PreferencePredicate.AvailableDistributionStatus.getKey()));
46
        }
47
        overrideButton = createAllowOverrideButton(parent);
48

    
49

    
50
        super.createControl(parent);
51
        overrideButton.setSelection(override);
52
    }
53

    
54
    @Override
55
    protected String getCheckedValuesFromPreferences() {
56
       String checkedValues = null;
57
        if (localPref){
58
           checkedValues = PreferencesUtil.getStringValue(PreferencePredicate.AvailableDistributionStatus.getKey(), true);
59
        }else if(pref != null){
60
            checkedValues = pref.getValue();
61
        }
62
        return checkedValues;
63
    }
64

    
65
    @Override
66
    protected List<TermVocabularyDto> getVocabulariesFromPreference() {
67
        // TODO Auto-generated method stub
68
        return null;
69
    }
70

    
71

    
72

    
73

    
74

    
75

    
76
}
(9-9/18)