Project

General

Profile

Download (1.46 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2020 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.databaseAdmin.preferencePage;
10

    
11
import eu.etaxonomy.cdm.model.metadata.CdmPreference;
12
import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
13
import eu.etaxonomy.taxeditor.preference.DistributionDetailsViewPreference;
14
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
15

    
16
/**
17
 * @author k.luther
18
 * @since Apr 8, 2020
19
 */
20
public class DistributionDetailsViewAdminPreference extends DistributionDetailsViewPreference {
21
    @Override
22
    public void getValues(){
23
        isAdminPreference = true;
24

    
25
        prefShowIdInVoc = PreferencesUtil.getPreferenceFromDB(PreferencePredicate.NamedAreaWithIdInVoc);
26

    
27
        allowOverrideShowIdInVoc = getPrefAllowOverride(prefShowIdInVoc);
28
        isShowIdInVoc = getBooleanPrefValue(prefShowIdInVoc);
29
   }
30

    
31
    @Override
32
    public boolean performOk() {
33
        if (isApply()){
34
            prefShowIdInVoc = CdmPreference.NewTaxEditorInstance(PreferencePredicate.NamedAreaWithIdInVoc, isShowIdInVoc != null? Boolean.toString(this.isShowIdInVoc): null);
35
            prefShowIdInVoc.setAllowOverride(allowOverrideShowIdInVoc);
36
            PreferencesUtil.setPreferenceToDB(prefShowIdInVoc);
37
            setApply(false);
38
        }
39
        return true;
40
    }
41

    
42
}
(6-6/29)