2 * Copyright (C) 2019 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
.databaseAdmin
.preferencePage
;
11 import org
.eclipse
.jface
.dialogs
.MessageDialog
;
13 import eu
.etaxonomy
.cdm
.model
.metadata
.CdmPreference
;
14 import eu
.etaxonomy
.cdm
.model
.metadata
.PreferencePredicate
;
15 import eu
.etaxonomy
.taxeditor
.l10n
.Messages
;
16 import eu
.etaxonomy
.taxeditor
.preference
.NavigatorOrderEnum
;
17 import eu
.etaxonomy
.taxeditor
.preference
.OrderPreferences
;
18 import eu
.etaxonomy
.taxeditor
.preference
.PreferencesUtil
;
24 public class TaxonNodeOrderAdminPreference
extends OrderPreferences
{
28 public boolean performOk() {
30 PreferencesUtil
.setPreferenceToDB(CdmPreference
.NewTaxEditorInstance(PreferencePredicate
.TaxonNodeOrder
, this.orderActivated
!=null?
this.orderActivated
.getKey():null));
31 MessageDialog
.openInformation(getShell(), null, Messages
.OrderPreferencePage_PleaseReopenNavigator
);
39 protected void getValues(){
40 isAdminPreference
= true;
41 orderPref
= PreferencesUtil
.getPreferenceFromDB(PreferencePredicate
.TaxonNodeOrder
);
42 allowOverride
= orderPref
!= null? orderPref
.isAllowOverride():true;
43 if (orderPref
== null){
44 orderPref
= CdmPreference
.NewTaxEditorInstance(PreferencePredicate
.TaxonNodeOrder
, null);
46 orderActivated
= orderPref
.getValue() != null?NavigatorOrderEnum
.valueOf(orderPref
.getValue()): null;