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.Collection;
|
12
|
import java.util.List;
|
13
|
import java.util.Map;
|
14
|
|
15
|
import org.apache.commons.lang.StringUtils;
|
16
|
import org.eclipse.swt.widgets.Composite;
|
17
|
|
18
|
import eu.etaxonomy.cdm.model.common.CdmBase;
|
19
|
import eu.etaxonomy.cdm.model.common.TermType;
|
20
|
import eu.etaxonomy.cdm.model.metadata.CdmPreference;
|
21
|
import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
|
22
|
import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
|
23
|
import eu.etaxonomy.taxeditor.l10n.Messages;
|
24
|
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
|
25
|
import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
|
26
|
import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
|
27
|
|
28
|
/**
|
29
|
* @author k.luther
|
30
|
* @since 05.10.2018
|
31
|
*
|
32
|
*/
|
33
|
public class AvailableDistributionStatusPage extends AbstractAdminTermSelectionWizardPage implements ICdmEntitySessionEnabled{
|
34
|
|
35
|
|
36
|
|
37
|
public AvailableDistributionStatusPage(String pageName, CdmPreference pref, boolean localPref) {
|
38
|
super(pageName, TermType.PresenceAbsenceTerm, pref);
|
39
|
this.localPref = localPref;
|
40
|
}
|
41
|
|
42
|
@Override
|
43
|
public void createControl(Composite parent) {
|
44
|
setTitle(Messages.AvailableDistributionStatusPage_PAGE_TITLE);
|
45
|
setDescription(Messages.AvailableDistributionStatusPage_PAGE_DESCRIPTION);
|
46
|
//if (!localPref){
|
47
|
override = PreferencesUtil.getBooleanValue(PreferencesUtil.createOverridePreferenceString(PreferencePredicate.AvailableDistributionStatus.getKey()));
|
48
|
createAllowOverrideButton(parent);
|
49
|
//}
|
50
|
super.createControl(parent);
|
51
|
|
52
|
}
|
53
|
|
54
|
@Override
|
55
|
protected String getCheckedValuesFromPreferences() {
|
56
|
String checkedValues = null;
|
57
|
if (localPref || pref == null){
|
58
|
checkedValues = PreferencesUtil.getStringValue(PreferencePredicate.AvailableDistributionStatus.getKey(), true);
|
59
|
if (StringUtils.isBlank(checkedValues) && pref != null){
|
60
|
checkedValues = pref.getValue();
|
61
|
}
|
62
|
|
63
|
}else {
|
64
|
checkedValues = pref.getValue();
|
65
|
}
|
66
|
return checkedValues;
|
67
|
}
|
68
|
|
69
|
@Override
|
70
|
public ICdmEntitySession getCdmEntitySession() {
|
71
|
return null;
|
72
|
}
|
73
|
|
74
|
@Override
|
75
|
public <T extends CdmBase> Collection<T> getRootEntities() {
|
76
|
return null;
|
77
|
}
|
78
|
|
79
|
@Override
|
80
|
public Map<Object, List<String>> getPropertyPathsMap() {
|
81
|
return null;
|
82
|
}
|
83
|
|
84
|
@Override
|
85
|
protected List<TermVocabularyDto> getVocabulariesFromPreference(){
|
86
|
return null;
|
87
|
}
|
88
|
|
89
|
}
|