ref #8389: adapt term preference handling for nametypedesignation
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / preference / wizard / AvailableDistributionStatusPage.java
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.Composite;
14
15 import eu.etaxonomy.cdm.model.metadata.CdmPreference;
16 import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
17 import eu.etaxonomy.cdm.model.term.TermType;
18 import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
19 import eu.etaxonomy.taxeditor.l10n.Messages;
20 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
21
22
23
24 /**
25 * @author k.luther
26 * @since 05.10.2018
27 *
28 */
29 public class AvailableDistributionStatusPage extends AbstractAdminTermSelectionWizardPage {
30
31
32
33 public AvailableDistributionStatusPage(String pageName, CdmPreference pref, boolean localPref) {
34 super(pageName, TermType.PresenceAbsenceTerm, pref);
35 this.localPref = localPref;
36 }
37
38 @Override
39 public void createControl(Composite parent) {
40 setTitle(Messages.AvailableDistributionStatusPage_PAGE_TITLE);
41 setDescription(Messages.AvailableDistributionStatusPage_PAGE_DESCRIPTION);
42 //if (!localPref){
43 override = PreferencesUtil.getBooleanValue(PreferencesUtil.createOverridePreferenceString(PreferencePredicate.AvailableDistributionStatus.getKey()));
44 createAllowOverrideButton(parent);
45 //}
46 super.createControl(parent);
47
48 }
49
50 @Override
51 protected String getCheckedValuesFromPreferences() {
52 String checkedValues = null;
53 if (localPref){
54 checkedValues = PreferencesUtil.getStringValue(PreferencePredicate.AvailableDistributionStatus.getKey(), true);
55 }else if(pref != null){
56 checkedValues = pref.getValue();
57 }
58 return checkedValues;
59 }
60
61
62
63 /**
64 * {@inheritDoc}
65 */
66 @Override
67 protected List<TermVocabularyDto> getVocabulariesFromPreference() {
68 // TODO Auto-generated method stub
69 return null;
70 }
71
72
73 }