2 * Copyright (C) 2018 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
9 package eu
.etaxonomy
.taxeditor
.preference
.wizard
;
11 import java
.util
.Collection
;
12 import java
.util
.List
;
15 import org
.apache
.commons
.lang
.StringUtils
;
16 import org
.eclipse
.swt
.widgets
.Composite
;
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
;
33 public class AvailableDistributionStatusPage
extends AbstractAdminTermSelectionWizardPage
implements ICdmEntitySessionEnabled
{
37 public AvailableDistributionStatusPage(String pageName
, CdmPreference pref
, boolean localPref
) {
38 super(pageName
, TermType
.PresenceAbsenceTerm
, pref
);
39 this.localPref
= localPref
;
43 public void createControl(Composite parent
) {
44 setTitle(Messages
.AvailableDistributionStatusPage_PAGE_TITLE
);
45 setDescription(Messages
.AvailableDistributionStatusPage_PAGE_DESCRIPTION
);
47 createAllowOverrideButton(parent
);
49 super.createControl(parent
);
54 protected String
getCheckedValuesFromPreferences() {
55 String checkedValues
= null;
56 if (localPref
|| pref
== null){
57 checkedValues
= PreferencesUtil
.getStringValue(PreferencePredicate
.AvailableDistributionStatus
.getKey(), true);
58 if (StringUtils
.isBlank(checkedValues
) && pref
!= null){
59 checkedValues
= pref
.getValue();
62 checkedValues
= pref
.getValue();
68 public ICdmEntitySession
getCdmEntitySession() {
73 public <T
extends CdmBase
> Collection
<T
> getRootEntities() {
78 public Map
<Object
, List
<String
>> getPropertyPathsMap() {
83 protected List
<TermVocabularyDto
> getVocabulariesFromPreference(){