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 org
.eclipse
.swt
.SWT
;
12 import org
.eclipse
.swt
.events
.SelectionAdapter
;
13 import org
.eclipse
.swt
.events
.SelectionEvent
;
14 import org
.eclipse
.swt
.widgets
.Button
;
15 import org
.eclipse
.swt
.widgets
.Composite
;
17 import eu
.etaxonomy
.cdm
.model
.metadata
.CdmPreference
;
18 import eu
.etaxonomy
.cdm
.model
.term
.TermType
;
19 import eu
.etaxonomy
.cdm
.persistence
.dto
.AbstractTermDto
;
20 import eu
.etaxonomy
.taxeditor
.preference
.PreferencesUtil
;
28 public abstract class AbstractAdminTermSelectionWizardPage
<T
extends AbstractTermDto
> extends AbstractTermSelectionWizardPage
{
29 //private boolean localPrefExist = true;
35 protected AbstractAdminTermSelectionWizardPage(String pageName
, TermType type
, CdmPreference pref
) {
36 super(pageName
, type
);
39 this.override
= PreferencesUtil
.getBooleanValue(PreferencesUtil
.createOverridePreferenceString(pref
.getPredicate()));
41 this.override
= pref
!= null?
this.pref
.isAllowOverride(): true;
53 protected void createAllowOverrideButton(Composite parent
) {
54 final Button activateCheckButton
= new Button(parent
, SWT
.CHECK
);
56 activateCheckButton
.setText("Override");
57 activateCheckButton
.setSelection(override
);
59 activateCheckButton
.setText("Allow Override");
60 activateCheckButton
.setSelection(pref
.isAllowOverride());
65 activateCheckButton
.addSelectionListener(new SelectionAdapter(){
67 public void widgetSelected(SelectionEvent e
) {
68 pref
.setAllowOverride(activateCheckButton
.getSelection());
69 override
= activateCheckButton
.getSelection();
75 // public boolean isLocalPrefExist() {
76 // return localPrefExist;
79 // public void setLocalPrefExist(boolean localPrefExist) {
80 // this.localPrefExist = localPrefExist;
83 public CdmPreference
getPreference(){
87 public void setPreference(CdmPreference pref
){