minor
authorKatja Luther <k.luther@bgbm.org>
Tue, 20 Dec 2016 11:54:30 +0000 (12:54 +0100)
committerKatja Luther <k.luther@bgbm.org>
Tue, 20 Dec 2016 11:54:30 +0000 (12:54 +0100)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/DatabasePreferencesPage.java [new file with mode: 0755]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/DatabasePreferencesWizard.java [new file with mode: 0755]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/DatabaseRepairSortIndexPage.java [new file with mode: 0755]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/DatabaseRepairTitleCacheUpdatePage.java [new file with mode: 0755]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/DatabaseRepairWizard.java [new file with mode: 0755]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/PreferencesConfigurator.java [new file with mode: 0755]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/SpacerFieldEditor.java [new file with mode: 0755]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/Test.java [new file with mode: 0755]

diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/DatabasePreferencesPage.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/DatabasePreferencesPage.java
new file mode 100755 (executable)
index 0000000..2ee8d31
--- /dev/null
@@ -0,0 +1,675 @@
+// $Id$
+/**
+* Copyright (C) 2016 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.databaseAdmin.wizard;
+
+import java.util.List;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.TabFolder;
+import org.eclipse.swt.widgets.TabItem;
+
+import eu.etaxonomy.cdm.model.metadata.CdmPreference;
+import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
+import eu.etaxonomy.taxeditor.model.NomenclaturalCodeHelper;
+import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
+import eu.etaxonomy.taxeditor.preference.NameDetailsConfigurator;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+
+/**
+ * @author k.luther
+ * @date 01.11.2016
+ *
+ */
+public class DatabasePreferencesPage extends WizardPage implements IWizardPage{
+
+
+
+    CdmPreference preferedNomenclaturalCode;
+    NameDetailsConfigurator config ;
+    TabFolder tabFolder;
+   // private int maxNumOfColumns;
+    IPreferenceStore preferenceStore;
+    Composite composite;
+    boolean isSimpleDetailsViewActivated;
+    Composite child ;
+
+    private Combo nomenclaturalCodeCombo;
+
+    private Label nomenclaturalCodeLabel;
+
+    String[][] labelAndValues;
+
+    /*
+     *
+     */
+    public DatabasePreferencesPage(String pageName) {
+        super(pageName);
+        this.preferedNomenclaturalCode = PreferencesUtil.setPreferredNomenclaturalCode(null, false);
+        this.config = PreferencesUtil.setPreferredNameDetailsConfiguration( false);
+        setPreferenceStore(PreferencesUtil.getPreferenceStore());
+
+    }
+
+    protected void setPreferenceStore(IPreferenceStore store){
+        this.preferenceStore = store;
+    }
+
+//    @Override
+//    protected void createFieldEditors() {
+//        setMessage("Choose the preferences for the whole cdm store.");
+//        tabFolder = new TabFolder(getFieldEditorParent(), SWT.NONE);
+//
+//        createNomenclaturalCodeTab();
+//        createNameDetailsConfiguration();
+//
+//
+//    }
+
+
+
+//
+//    /***
+//    * Adjust the layout of the field editors so that they are properly aligned.
+//    */
+//    @Override
+//    protected void adjustGridLayout() {
+//        if (tabFolder != null){
+//            TabItem[] items = tabFolder.getItems();
+//            for (int j = 0; j < items.length; j++){
+//                GridLayout layout = ((GridLayout) ((Composite) items[j].getControl()).getLayout());
+//                layout.numColumns = this.maxNumOfColumns;
+//                layout.marginHeight = 5;
+//                layout.marginWidth = 5;
+//            }
+//        }
+//        // need to call super.adjustGridLayout() since fieldEditor.adjustForNumColumns() is protected
+//        super.adjustGridLayout();
+//
+//        // reset the main container to a single column
+//        ((GridLayout) super.getFieldEditorParent().getLayout()).numColumns = 1;
+//    }
+
+//    /***
+//    * Returns a parent composite for a field editor.
+//    * <p>
+//    * This value must not be cached since a new parent may be created each time this method called. Thus this method
+//    * must be called each time a field editor is constructed.
+//    * </p>
+//    * @return a parent
+//    */
+//    @Override
+//    protected Composite getEditorParent(){
+//        if (tabFolder == null || tabFolder.getItemCount() == 0){
+//            return super.getWizard();
+//        }
+//        return (Composite) tabFolder.getItem(tabFolder.getItemCount() - 1).getControl();
+//    }
+
+    /***
+    * Adds a tab to the page.
+    * @param text the tab label
+    */
+    public Composite addTab(String text)    {
+        if (tabFolder == null){
+            // initialize tab folder
+            if (composite == null) {
+                composite = new Composite(getShell(), SWT.NONE);
+            }
+            tabFolder = new TabFolder(composite, SWT.NONE);
+            tabFolder.setLayoutData(new GridData(GridData.FILL_BOTH));
+        }
+
+        TabItem item = new TabItem(tabFolder, SWT.NONE);
+        item.setText(text);
+
+        Composite currentTab = new Composite(tabFolder, SWT.NULL);
+        GridLayout layout = new GridLayout();
+        currentTab.setLayout(layout);
+        currentTab.setFont(composite.getFont());
+        currentTab.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+        item.setControl(currentTab);
+        return currentTab;
+    }
+
+    /**
+     * @param tabFolder
+     */
+    private void createNameDetailsConfiguration(Composite parent) {
+        if (composite == null){
+            composite = parent;
+        }
+       composite = addTab("Name Details View Configuration");
+//        TabItem tbtmNameDetailsConfiguration = new TabItem(tabFolder, SWT.NONE);
+//        Composite c2 = new Composite(tabFolder, SWT.BORDER);
+//        c2.setLayout(new GridLayout(1, true));
+//        tbtmNameDetailsConfiguration.setControl(c2);
+       // composite.setLayout(new GridLayout(1, true));
+       config = new NameDetailsConfigurator(true);
+
+      // Composite composite = new Composite(parent, SWT.NULL);
+       composite.setLayout(new GridLayout());
+
+       isSimpleDetailsViewActivated= PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION);
+       final Button activateCheckButton = new Button(composite, SWT.CHECK);
+       activateCheckButton.setText("Show only a simple name details view");
+       activateCheckButton.setSelection(isSimpleDetailsViewActivated);
+       activateCheckButton.addSelectionListener(new SelectionAdapter(){
+       @Override
+       public void widgetSelected(SelectionEvent e) {
+           isSimpleDetailsViewActivated = activateCheckButton.getSelection();
+           PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION, isSimpleDetailsViewActivated);
+           if(isSimpleDetailsViewActivated){
+               child.setVisible(true);
+               child.setEnabled(true);
+           }else{
+               child.setVisible(false);
+               child.setEnabled(false);
+           }
+        }
+        });
+
+       child = new Composite(composite, SWT.NULL);
+       child.setLayout(new GridLayout());
+       child.setVisible(isSimpleDetailsViewActivated);
+
+       final Button showTaxon = new Button(child, SWT.CHECK);
+       boolean isShowTaxon = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_TAXON);
+       showTaxon.setText("Show taxon of the name");
+       showTaxon.setSelection(isShowTaxon);
+       showTaxon.addSelectionListener(new SelectionAdapter(){
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                boolean isShowTaxon = showTaxon.getSelection();
+                PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_TAXON, isShowTaxon);
+             }
+        });
+
+       final Button showLsid = new Button(child, SWT.CHECK);
+       boolean isShowLSID = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_LSID);
+       showLsid.setText("Show Lsid of the name");
+       showLsid.setSelection(isShowLSID);
+       showLsid.addSelectionListener(new SelectionAdapter(){
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                boolean isShowLSID = showLsid.getSelection();
+                PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_LSID, isShowLSID);
+             }
+        });
+
+       final Button showNomenclaturalCode = new Button(child, SWT.CHECK);
+       boolean isShowNomenclaturalCode = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_CODE);
+       showNomenclaturalCode.setText("Show the nomenclatural code");
+       showNomenclaturalCode.setSelection(isShowNomenclaturalCode);
+       showNomenclaturalCode.addSelectionListener(new SelectionAdapter(){
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                boolean isShowNomenclaturalCode = showNomenclaturalCode.getSelection();
+                PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_CODE, isShowNomenclaturalCode);
+             }
+        });
+
+       final Button showNameCache = new Button(child, SWT.CHECK);
+       boolean isShowNameCache = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAMECACHE);
+       showNameCache.setText("Show nameCache of the name (only the scientific name without the author and year)");
+       showNameCache.setSelection(isShowNomenclaturalCode);
+       showNameCache.addSelectionListener(new SelectionAdapter(){
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                boolean isShowNameCache = showNameCache.getSelection();
+                PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAMECACHE, isShowNameCache);
+             }
+        });
+       final Button showAppendedPhrase = new Button(child, SWT.CHECK);
+       boolean isShowAppendedPhrase = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_APPENDED_PHRASE);
+       showAppendedPhrase.setText("Show appended phrase");
+       showAppendedPhrase.setSelection(isShowAppendedPhrase);
+       showAppendedPhrase.addSelectionListener(new SelectionAdapter(){
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                boolean isShowAppendedPhrase = showAppendedPhrase.getSelection();
+                PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_APPENDED_PHRASE, isShowAppendedPhrase);
+             }
+        });
+
+       final Button showRank = new Button(child, SWT.CHECK);
+       boolean isShowRank = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_RANK);
+       showRank.setText("Show rank of the name");
+       showRank.setSelection(isShowRank);
+       showRank.addSelectionListener(new SelectionAdapter(){
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                boolean isShowRank = showRank.getSelection();
+                PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_RANK, isShowRank);
+             }
+        });
+       final Button showEpithets = new Button(child, SWT.CHECK);
+       boolean isShowEpithets = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_ATOMISED_EPITHETS);
+       showEpithets.setText("Show atomised epithets");
+       showEpithets.setSelection(isShowEpithets);
+       showEpithets.addSelectionListener(new SelectionAdapter(){
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                boolean isShowEpithets = showEpithets.getSelection();
+                PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_ATOMISED_EPITHETS, isShowEpithets);
+             }
+        });
+       final Button showAuthorship = new Button(child, SWT.CHECK);
+       boolean isShowAuthorship = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP);
+       showAuthorship.setText("Show authorship section");
+       showAuthorship.setSelection(isShowAuthorship);
+       showAuthorship.addSelectionListener(new SelectionAdapter(){
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                boolean isShowAuthorship = showAuthorship.getSelection();
+                PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP, isShowAuthorship);
+             }
+        });
+
+       final Button showNomenclaturalRef = new Button(child, SWT.CHECK);
+       boolean isShowNomenclaturalRef = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_REFERENCE);
+       showNomenclaturalRef.setText("Show nomenclatural reference section");
+       showNomenclaturalRef.setSelection(isShowNomenclaturalRef);
+       showNomenclaturalRef.addSelectionListener(new SelectionAdapter(){
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                boolean isShowNomenclaturalRef = showNomenclaturalRef.getSelection();
+                PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_REFERENCE, isShowNomenclaturalRef);
+             }
+        });
+
+       final Button showNomenclaturalStatus = new Button(child, SWT.CHECK);
+       boolean isShowNomenclaturalStatus = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_STATUS);
+       showNomenclaturalStatus.setText("Show nomenclatural status section");
+       showNomenclaturalStatus.setSelection(isShowNomenclaturalStatus);
+       showNomenclaturalStatus.addSelectionListener(new SelectionAdapter(){
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                boolean isShowNomenclaturalStatus = showNomenclaturalStatus.getSelection();
+                PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_STATUS, isShowNomenclaturalStatus);
+             }
+        });
+
+       final Button showProtologue = new Button(child, SWT.CHECK);
+       boolean isShowProtologue = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_PROTOLOGUE);
+       showProtologue.setText("Show protologue section");
+       showProtologue.setSelection(isShowProtologue);
+       showProtologue.addSelectionListener(new SelectionAdapter(){
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                boolean isShowProtologue = showProtologue.getSelection();
+                PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_PROTOLOGUE, isShowProtologue);
+             }
+        });
+
+       final Button showTypeDesignation = new Button(child, SWT.CHECK);
+       boolean isShowTypeDesignation = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_TYPE_DESIGNATION);
+       showTypeDesignation.setText("Show name type designation section");
+       showTypeDesignation.setSelection(isShowTypeDesignation);
+       showTypeDesignation.addSelectionListener(new SelectionAdapter(){
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                boolean isShowTypeDesignation = showTypeDesignation.getSelection();
+                PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_TYPE_DESIGNATION, isShowTypeDesignation);
+             }
+        });
+
+
+       final Button showNameRelationship = new Button(child, SWT.CHECK);
+       boolean isShowNameRelationship = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAME_RELATIONSHIP);
+       showNameRelationship.setText("Show name relationship section");
+       showNameRelationship.setSelection(isShowNameRelationship);
+       showNameRelationship.addSelectionListener(new SelectionAdapter(){
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                boolean isShowNameRelationship = showNameRelationship.getSelection();
+                PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAME_RELATIONSHIP, isShowNameRelationship);
+             }
+        });
+
+       if(isSimpleDetailsViewActivated){
+           child.setEnabled(true);
+       }else{
+           child.setEnabled(false);
+       }
+
+
+
+       // Label emptyLabel = new Label(getFieldEditorParent(), 0);
+
+//       addField(new BooleanFieldEditor(
+//               IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION, "show simple (configurable) details", getFieldEditorParent()));
+//       addField(new SpacerFieldEditor(getFieldEditorParent()));
+//
+//       addField(new BooleanFieldEditor(
+//                IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_TAXON,
+//                "show taxon section",
+//                getFieldEditorParent()));
+//
+//       addField(new BooleanFieldEditor(
+//               IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_CACHE,
+//               "show name cache",
+//               getFieldEditorParent()));
+//
+//       addField(new BooleanFieldEditor(
+//                IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_LSID,
+//                "show LSID of the name",
+//                getFieldEditorParent()));
+//
+//
+//       addField(new BooleanFieldEditor(
+//                IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_CODE,
+//                "show nomenclatural code of the name",
+//                getFieldEditorParent()));
+//
+//
+//       addField(new BooleanFieldEditor(
+//                IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_APPENDED_PHRASE,
+//                "show appended phrase",
+//                getFieldEditorParent()));
+//
+//
+//       addField(new BooleanFieldEditor(
+//                IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_RANK,
+//                "show rank of the name",
+//                getFieldEditorParent()));
+//
+//
+//       addField(new BooleanFieldEditor(
+//                IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_ATOMISED_EPITHETS,
+//                "show atomised epithets of the name",
+//                getFieldEditorParent()));
+//
+//       addField(new BooleanFieldEditor(
+//                IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP,
+//                "show authorship section",
+//                getFieldEditorParent()));
+//
+//
+//       addField(new BooleanFieldEditor(
+//                IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_REFERENCE,
+//                "show nomenclatural reference section",
+//                getFieldEditorParent()));
+//
+//
+//       addField( new BooleanFieldEditor(
+//                IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_STATUS,
+//                "show nomenclatural status section",
+//                getFieldEditorParent()));
+//
+//
+//       addField(new BooleanFieldEditor(
+//                IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_PROTOLOGUE,
+//                "show protologue section",
+//                getFieldEditorParent()));
+//
+//
+//       addField(new BooleanFieldEditor(
+//                IPreferenceKeys.ALLOW_OVERRIDE_NAMEDETAILS,
+//                "allow to use local preference",
+//                getFieldEditorParent()));
+
+
+    }
+
+
+
+    protected IPreferenceStore doGetPreferenceStore() {
+        return PreferencesUtil.getPreferenceStore();
+    }
+
+    /**
+     * @return
+     */
+    private String[][] getLabelAndValues() {
+        List<NomenclaturalCode> supportedCodes = NomenclaturalCodeHelper
+                .getSupportedCodes();
+        labelAndValues = new String[supportedCodes.size()][2];
+        for (int i = 0; i < supportedCodes.size(); i++) {
+            labelAndValues[i][0] = NomenclaturalCodeHelper
+                    .getDescription(supportedCodes.get(i));
+            labelAndValues[i][1] = PreferencesUtil
+                    .getPreferenceKey(supportedCodes.get(i));
+        }
+        return labelAndValues;
+    }
+//    @Override
+//    public boolean performOk() {
+//       if (doGetPreferenceStore()== null){
+//           setPreferenceStore(PreferencesUtil.getPreferenceStore());
+//       }
+//
+//
+//           String value =doGetPreferenceStore().getString(IPreferenceKeys.CDM_NOMENCLATURAL_CODE_KEY);
+//           boolean allowOverride =  doGetPreferenceStore().getBoolean(IPreferenceKeys.ALLOW_OVERRIDE_NOMENCLATURAL_CODE_KEY);
+//           CdmPreference pref = CdmPreference.NewDatabaseInstance( PreferencePredicate.NomenclaturalCode, value);
+//           pref.setAllowOverride(allowOverride);
+//           ICdmApplicationConfiguration controller = CdmStore.getCurrentApplicationConfiguration();
+//           if (controller == null){
+//               return false;
+//           }
+//           IPreferenceService service = controller.getPreferenceService();
+//           service.set(pref);
+//           createNameDetailsViewConfig();
+//           value =config.toString();
+//           allowOverride = doGetPreferenceStore().getBoolean(IPreferenceKeys.ALLOW_OVERRIDE_NAMEDETAILS);
+//           pref = CdmPreference.NewDatabaseInstance( PreferencePredicate.NameDetailsView, value);
+//           pref.setAllowOverride(allowOverride);
+//           service.set(pref);
+//
+//       return true;
+//   }
+
+/**
+     *
+     */
+    void createNameDetailsViewConfig() {
+       config.setSimpleDetailsViewActivated(doGetPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION));
+       config.setAppendedPhraseActivated(doGetPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_APPENDED_PHRASE));
+       config.setAtomisedEpithetsActivated(doGetPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_ATOMISED_EPITHETS));
+       config.setAuthorshipSectionActivated(doGetPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP));
+       config.setLSIDActivated(doGetPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_LSID));
+       config.setNameCacheActivated(doGetPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_CACHE));
+       config.setNameRelationsSectionActivated(doGetPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAME_RELATIONSHIP));
+       config.setNomenclaturalCodeActived(doGetPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_CODE));
+       config.setNomenclaturalStatusSectionActivated(doGetPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_STATUS));
+       config.setNomenclaturalReferenceSectionActivated(doGetPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_REFERENCE));
+       config.setProtologueActivated(doGetPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_PROTOLOGUE));
+       config.setRankActivated(doGetPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_RANK));
+       config.setSimpleDetailsViewActivated(doGetPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION));
+       config.setTaxonSectionActivated(doGetPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_TAXON));
+       config.setTypeDesignationSectionActivated(doGetPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_TYPE_DESIGNATION));
+    }
+
+    public void createNomenclaturalCodeTab(Composite parent){
+       composite = addTab("Nomenclatural Code");
+       nomenclaturalCodeCombo = new Combo(composite, SWT.READ_ONLY);
+      List<NomenclaturalCode> supportedCodes = NomenclaturalCodeHelper
+              .getSupportedCodes();
+       for (NomenclaturalCode code: supportedCodes) {
+           nomenclaturalCodeCombo.add(NomenclaturalCodeHelper
+                   .getDescription(code));
+
+       }
+       getLabelAndValues();
+       nomenclaturalCodeCombo.addSelectionListener(new SelectionAdapter() {
+           @Override
+        public void widgetSelected(SelectionEvent evt) {
+
+               String name = nomenclaturalCodeCombo.getText();
+               String selectedPreferenceKey = null;
+               for (String[] labelAndValue: labelAndValues){
+                   if (labelAndValue[0].equals(name)){
+                       selectedPreferenceKey = labelAndValue[1];
+                   }
+               }
+
+
+               PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.CDM_NOMENCLATURAL_CODE_KEY, selectedPreferenceKey);
+
+           }
+       });
+       nomenclaturalCodeLabel = new Label(composite, SWT.READ_ONLY);
+
+
+        final Button useLocalPreference = new Button(composite, SWT.CHECK);
+        boolean isUseLocalPreference = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.ALLOW_OVERRIDE_NOMENCLATURAL_CODE_KEY);
+        useLocalPreference.setText("allow to use local preference");
+        useLocalPreference.setSelection(isUseLocalPreference);
+        useLocalPreference.addSelectionListener(new SelectionAdapter(){
+             @Override
+             public void widgetSelected(SelectionEvent e) {
+                 boolean isUseLocalPreference = useLocalPreference.getSelection();
+                 PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.ALLOW_OVERRIDE_NOMENCLATURAL_CODE_KEY, isUseLocalPreference);
+              }
+         });
+
+
+   // Label emptyLabel = new Label(getFieldEditorParent(), 0);
+
+ //   addField(new ComboFieldEditor(
+//            IPreferenceKeys.CDM_NOMENCLATURAL_CODE_KEY,
+//            "Choose which nomenclatural code you would like to use for scientific names unless otherwise specified.", getLabelAndValues(),
+//            getFieldEditorParent()));
+//
+//
+//    addField(new BooleanFieldEditor(
+//            IPreferenceKeys.ALLOW_OVERRIDE_NOMENCLATURAL_CODE_KEY,
+//            "allow to use local preference",
+//            getFieldEditorParent()));
+//    adjustGridLayout();
+
+}
+
+
+
+/**
+ * {@inheritDoc}
+ */
+@Override
+public boolean canFlipToNextPage() {
+    // TODO Auto-generated method stub
+    return false;
+}
+
+
+
+/**
+ * {@inheritDoc}
+ */
+@Override
+public String getName() {
+    // TODO Auto-generated method stub
+    return null;
+}
+
+
+
+/**
+ * {@inheritDoc}
+ */
+@Override
+public IWizardPage getNextPage() {
+    // TODO Auto-generated method stub
+    return null;
+}
+
+
+
+/**
+ * {@inheritDoc}
+ */
+@Override
+public IWizardPage getPreviousPage() {
+    // TODO Auto-generated method stub
+    return null;
+}
+
+
+
+/**
+ * {@inheritDoc}
+ */
+@Override
+public IWizard getWizard() {
+    // TODO Auto-generated method stub
+    return null;
+}
+
+
+
+/**
+ * {@inheritDoc}
+ */
+@Override
+public boolean isPageComplete() {
+
+    return true;
+}
+
+
+
+/**
+ * {@inheritDoc}
+ */
+@Override
+public void setPreviousPage(IWizardPage page) {
+    // TODO Auto-generated method stub
+
+}
+
+
+
+/**
+ * {@inheritDoc}
+ */
+@Override
+public void setWizard(IWizard newWizard) {
+    // TODO Auto-generated method stub
+
+}
+
+/**
+ * {@inheritDoc}
+ */
+@Override
+public void createControl(Composite parent) {
+    createNameDetailsConfiguration(parent);
+    createNomenclaturalCodeTab(parent);
+    setControl(parent);
+}
+
+/**
+ * @return
+ */
+public NameDetailsConfigurator getConfig() {
+
+    return config;
+}
+
+
+
+
+
+
+
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/DatabasePreferencesWizard.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/DatabasePreferencesWizard.java
new file mode 100755 (executable)
index 0000000..e7b2703
--- /dev/null
@@ -0,0 +1,85 @@
+/**
+* Copyright (C) 2016 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.databaseAdmin.wizard;
+
+import org.eclipse.jface.wizard.Wizard;
+
+import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
+import eu.etaxonomy.cdm.api.service.IPreferenceService;
+import eu.etaxonomy.cdm.model.metadata.CdmPreference;
+import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
+import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * @author k.luther
+ * @date 18.11.2016
+ *
+ */
+public class DatabasePreferencesWizard extends Wizard {
+
+
+    private final DatabasePreferencesPage preferencePage;
+
+
+    public DatabasePreferencesWizard() {
+        setWindowTitle("Database Preferences Wizard");
+
+        preferencePage = new DatabasePreferencesPage("Nomenclatural Code");
+       // preferencePage.setDescription("Choose which nomenclatural code you would like to use for scientific names unless otherwise specified.");
+       // preferencePage.init(PlatformUI.getWorkbench());
+    }
+
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean performFinish() {
+
+//       getPreferencePage().performOk();
+        String value =getPreferencePage().doGetPreferenceStore().getString(IPreferenceKeys.CDM_NOMENCLATURAL_CODE_KEY);
+
+        boolean allowOverride =  getPreferencePage().doGetPreferenceStore().getBoolean(IPreferenceKeys.ALLOW_OVERRIDE_NOMENCLATURAL_CODE_KEY);
+        CdmPreference pref = CdmPreference.NewDatabaseInstance( PreferencePredicate.NomenclaturalCode, value);
+        pref.setAllowOverride(allowOverride);
+
+        ICdmApplicationConfiguration controller = CdmStore.getCurrentApplicationConfiguration();
+        if (controller == null){
+            return false;
+        }
+        IPreferenceService service = controller.getPreferenceService();
+        service.set(pref);
+
+        getPreferencePage().createNameDetailsViewConfig();
+        value = getPreferencePage().getConfig().toString();
+        allowOverride = getPreferencePage().doGetPreferenceStore().getBoolean(IPreferenceKeys.ALLOW_OVERRIDE_NAMEDETAILS);
+        pref = CdmPreference.NewDatabaseInstance( PreferencePredicate.NameDetailsView, value);
+        pref.setAllowOverride(allowOverride);
+        service.set(pref);
+
+        return true;
+    }
+
+    /**
+     * @return the preferencePage
+     */
+    public DatabasePreferencesPage getPreferencePage() {
+        return preferencePage;
+    }
+
+    @Override
+    public void addPages() {
+        addPage(preferencePage);
+    }
+
+
+
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/DatabaseRepairSortIndexPage.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/DatabaseRepairSortIndexPage.java
new file mode 100755 (executable)
index 0000000..95fcf06
--- /dev/null
@@ -0,0 +1,100 @@
+/**
+* Copyright (C) 2016 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.databaseAdmin.wizard;
+
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+
+import eu.etaxonomy.cdm.io.common.SortIndexUpdaterConfigurator;
+import eu.etaxonomy.taxeditor.Messages;
+
+/**
+ * @author k.luther
+ * @date 06.12.2016
+ *
+ */
+public class DatabaseRepairSortIndexPage extends WizardPage {
+
+    SortIndexUpdaterConfigurator config = null;
+    /**
+     * @param pageName
+     */
+    protected DatabaseRepairSortIndexPage(String pageName, SortIndexUpdaterConfigurator config){
+        super(pageName);
+        this.config = config;
+        setMessage(Messages.DatabaseRepairPage_chooseParameter);
+    }
+
+
+
+
+
+
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void createControl(Composite parent) {
+        final Composite composite = new Composite(parent, SWT.NULL);
+
+        GridLayout gridLayout = new GridLayout();
+        composite.setLayout(gridLayout);
+
+        Button checkBoxTaxonNode = new Button(composite, SWT.CHECK);
+        checkBoxTaxonNode.setSelection(config.isDoTaxonNode());
+        checkBoxTaxonNode.setText(Messages.DatabaseRepairPage_updateTaxonNodes);
+        checkBoxTaxonNode
+                .setToolTipText(Messages.DatabaseRepairPage_toolTip_taxonNode);
+        checkBoxTaxonNode.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                config.setDoTaxonNode(!config.isDoTaxonNode());
+            }
+        });
+
+        Button checkBoxPolytomousKeyNode = new Button(composite, SWT.CHECK);
+        checkBoxPolytomousKeyNode.setSelection(config.isDoPolytomousKeyNode());
+        checkBoxPolytomousKeyNode.setText(Messages.DatabaseRepairPage_PolytomousKeyNode);
+        checkBoxPolytomousKeyNode
+        .setToolTipText(Messages.DatabaseRepairPage_toolTip_polytomousKeyNode);
+        checkBoxPolytomousKeyNode.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                config.setDoPolytomousKeyNode(!config.isDoPolytomousKeyNode());
+            }
+        });
+
+        Button checkBoxFeatureNode = new Button(composite, SWT.CHECK);
+        checkBoxFeatureNode.setSelection(config.isDoFeatureNode());
+        checkBoxFeatureNode.setText(Messages.DatabaseRepairPage_featureNodes);
+        checkBoxFeatureNode
+        .setToolTipText(Messages.DatabaseRepairPage_toolTipFeatureNodes);
+        checkBoxFeatureNode.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                config.setDoFeatureNode(!config.isDoFeatureNode());
+            }
+        });
+
+
+
+        setControl(composite);
+
+    }
+
+
+
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/DatabaseRepairTitleCacheUpdatePage.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/DatabaseRepairTitleCacheUpdatePage.java
new file mode 100755 (executable)
index 0000000..c98df8f
--- /dev/null
@@ -0,0 +1,95 @@
+/**
+* Copyright (C) 2016 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.databaseAdmin.wizard;
+
+import java.util.List;
+
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+
+import eu.etaxonomy.cdm.io.common.CacheUpdaterConfigurator;
+import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
+import eu.etaxonomy.cdm.model.name.TaxonNameBase;
+import eu.etaxonomy.cdm.model.taxon.TaxonBase;
+import eu.etaxonomy.taxeditor.Messages;
+
+/**
+ * @author k.luther
+ * @date 13.12.2016
+ *
+ */
+public class DatabaseRepairTitleCacheUpdatePage extends WizardPage {
+
+    CacheUpdaterConfigurator config;
+
+    /**
+     * @param pageName
+     * @param configTitleCache
+     */
+    protected DatabaseRepairTitleCacheUpdatePage(String pageName, CacheUpdaterConfigurator configTitleCache) {
+        super(pageName);
+        config = configTitleCache;
+
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void createControl(Composite parent) {
+        final Composite composite = new Composite(parent, SWT.NULL);
+
+        GridLayout gridLayout = new GridLayout();
+        composite.setLayout(gridLayout);
+
+        setControl(composite);
+
+        Button checkBoxZoologicalName = new Button(composite, SWT.CHECK);
+        checkBoxZoologicalName.setSelection(config.getClassList().contains(TaxonBase.class));
+        checkBoxZoologicalName.setText(Messages.DatabaseRepairPage_TaxonBase);
+        checkBoxZoologicalName
+        .setToolTipText(Messages.DatabaseRepairPage_toolTip_taxonBase);
+        checkBoxZoologicalName.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                List<Class<? extends IdentifiableEntity>> classList  = config.getClassList();
+                classList.add(TaxonBase.class);
+            }
+        });
+
+
+
+
+
+
+
+
+
+                Button checkBoxTaxonName = new Button(composite, SWT.CHECK);
+                checkBoxTaxonName.setSelection(config.getClassList().contains(TaxonNameBase.class));
+                checkBoxTaxonName.setText(Messages.DatabaseRepairPage_updateTaxonName);
+                checkBoxTaxonName
+                        .setToolTipText(Messages.DatabaseRepairPage_toolTip_TaxonName);
+                checkBoxTaxonName.addSelectionListener(new SelectionAdapter() {
+                    @Override
+                    public void widgetSelected(SelectionEvent e) {
+                        List<Class<? extends IdentifiableEntity>> classList = config.getClassList();
+                        classList.add(TaxonNameBase.class);
+                    }
+                });
+
+
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/DatabaseRepairWizard.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/DatabaseRepairWizard.java
new file mode 100755 (executable)
index 0000000..40c93eb
--- /dev/null
@@ -0,0 +1,75 @@
+/**
+* Copyright (C) 2016 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.databaseAdmin.wizard;
+
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.wizard.Wizard;
+
+import eu.etaxonomy.cdm.config.ICdmSource;
+import eu.etaxonomy.cdm.io.common.CacheUpdaterConfigurator;
+import eu.etaxonomy.cdm.io.common.SortIndexUpdaterConfigurator;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * @author k.luther
+ * @date 06.12.2016
+ *
+ */
+public class DatabaseRepairWizard extends Wizard {
+   // private final DatabaseRepairSortIndexPage repairSortIndexPage;
+    private final Test test;
+    SortIndexUpdaterConfigurator config;
+    CacheUpdaterConfigurator cacheUpdaterConfig;
+
+
+
+    public DatabaseRepairWizard() {
+        setWindowTitle("Database Repair Wizard");
+        config = SortIndexUpdaterConfigurator.NewInstance(null);
+       // repairSortIndexPage = new DatabaseRepairSortIndexPage("SortIndex Repair",config);
+        cacheUpdaterConfig = CacheUpdaterConfigurator.NewInstance(null);
+        test = new Test("Test", cacheUpdaterConfig, config);
+
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean performFinish() {
+
+            if (config == null){
+                ICdmSource source= CdmStore.getActiveCdmSource();
+                config = SortIndexUpdaterConfigurator.NewInstance(null);
+                config.setDoFeatureNode(false);
+                config.setDoPolytomousKeyNode(false);
+
+             }
+            if (config.isDoFeatureNode() || config.isDoPolytomousKeyNode() || config.isDoTaxonNode()){
+                Job updateJob = CdmStore.getImportManager().createIOServiceJob(config);
+                CdmStore.getImportManager().run(updateJob);
+            }
+            if (!cacheUpdaterConfig.getClassList().isEmpty()){
+                Job updateJob2 = CdmStore.getImportManager().createIOServiceJob(cacheUpdaterConfig);
+                CdmStore.getImportManager().run(updateJob2);
+            }
+
+
+
+        return true;
+    }
+
+    @Override
+    public void addPages() {
+       //addPage(repairSortIndexPage);
+        addPage(test);
+    }
+
+
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/PreferencesConfigurator.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/PreferencesConfigurator.java
new file mode 100755 (executable)
index 0000000..084ccb5
--- /dev/null
@@ -0,0 +1,28 @@
+/**
+* Copyright (C) 2016 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.databaseAdmin.wizard;
+
+import eu.etaxonomy.cdm.model.metadata.CdmPreference;
+import eu.etaxonomy.taxeditor.preference.NameDetailsConfigurator;
+
+/**
+ * @author k.luther
+ * @date 16.12.2016
+ *
+ */
+public class PreferencesConfigurator {
+
+    private CdmPreference nomenclaturalCodePreference;
+
+    private NameDetailsConfigurator nameDetailsConfigurator;
+
+
+
+
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/SpacerFieldEditor.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/SpacerFieldEditor.java
new file mode 100755 (executable)
index 0000000..4d0334f
--- /dev/null
@@ -0,0 +1,56 @@
+/**
+* Copyright (C) 2016 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.databaseAdmin.wizard;
+
+import org.eclipse.jface.preference.FieldEditor;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * @author k.luther
+ * @date 19.12.2016
+ *
+ */
+public class SpacerFieldEditor extends FieldEditor {
+        public SpacerFieldEditor(Composite parent) {
+            super("", "", parent);
+        }
+
+        @Override
+        protected void adjustForNumColumns(int numColumns) {
+            // do nothing
+        }
+
+        @Override
+        protected void doFillIntoGrid(Composite parent, int numColumns) {
+            getLabelControl(parent);
+        }
+
+        @Override
+        protected void doLoad() {
+            // do nothing
+        }
+
+        @Override
+        protected void doLoadDefault() {
+            // do nothing
+        }
+
+        @Override
+        protected void doStore() {
+            // do nothing
+        }
+
+        @Override
+        public int getNumberOfControls() {
+            return 0;
+        }
+
+
+
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/Test.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/Test.java
new file mode 100755 (executable)
index 0000000..db196d6
--- /dev/null
@@ -0,0 +1,153 @@
+/**
+* Copyright (C) 2016 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.databaseAdmin.wizard;
+
+import java.util.List;
+
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.TabFolder;
+import org.eclipse.swt.widgets.TabItem;
+
+import eu.etaxonomy.cdm.io.common.CacheUpdaterConfigurator;
+import eu.etaxonomy.cdm.io.common.SortIndexUpdaterConfigurator;
+import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
+import eu.etaxonomy.cdm.model.name.TaxonNameBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
+import eu.etaxonomy.cdm.model.taxon.TaxonBase;
+import eu.etaxonomy.taxeditor.Messages;
+
+/**
+ * @author k.luther
+ * @date 14.12.2016
+ *
+ */
+public class Test extends WizardPage {
+
+    CacheUpdaterConfigurator config;
+    SortIndexUpdaterConfigurator sortIndexConfig;
+    public Test(String pageName, CacheUpdaterConfigurator configTitleCache, SortIndexUpdaterConfigurator sortIndexConfig) {
+        super(pageName);
+        config = configTitleCache;
+        this.sortIndexConfig = sortIndexConfig;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void createControl(Composite parent) {
+
+
+            Composite container = new Composite(parent, SWT.NULL);
+            setControl(container);
+            container.setLayout(new FillLayout(SWT.HORIZONTAL));
+
+            TabFolder tabFolder = new TabFolder(container, SWT.NONE);
+
+            TabItem tbtmSortIndex = new TabItem(tabFolder, SWT.NONE);
+            tbtmSortIndex.setText("Sort Index");
+
+            Composite composite = new Composite(tabFolder, SWT.NONE);
+            tbtmSortIndex.setControl(composite);
+            composite.setLayout(new GridLayout(1, true));
+
+            Button checkBoxTaxonNode = new Button(composite, SWT.CHECK);
+            checkBoxTaxonNode.setSelection(sortIndexConfig.isDoTaxonNode());
+            checkBoxTaxonNode.setText(Messages.DatabaseRepairPage_updateTaxonNodes);
+            checkBoxTaxonNode
+                    .setToolTipText(Messages.DatabaseRepairPage_toolTip_taxonNode);
+            checkBoxTaxonNode.addSelectionListener(new SelectionAdapter() {
+                @Override
+                public void widgetSelected(SelectionEvent e) {
+                    sortIndexConfig.setDoTaxonNode(!sortIndexConfig.isDoTaxonNode());
+                }
+            });
+
+            Button checkBoxPolytomousKeyNode = new Button(composite, SWT.CHECK);
+            checkBoxPolytomousKeyNode.setSelection(sortIndexConfig.isDoPolytomousKeyNode());
+            checkBoxPolytomousKeyNode.setText(Messages.DatabaseRepairPage_PolytomousKeyNode);
+            checkBoxPolytomousKeyNode
+            .setToolTipText(Messages.DatabaseRepairPage_toolTip_polytomousKeyNode);
+            checkBoxPolytomousKeyNode.addSelectionListener(new SelectionAdapter() {
+                @Override
+                public void widgetSelected(SelectionEvent e) {
+                    sortIndexConfig.setDoPolytomousKeyNode(!sortIndexConfig.isDoPolytomousKeyNode());
+                }
+            });
+
+            Button checkBoxFeatureNode = new Button(composite, SWT.CHECK);
+            checkBoxFeatureNode.setSelection(sortIndexConfig.isDoFeatureNode());
+            checkBoxFeatureNode.setText(Messages.DatabaseRepairPage_featureNodes);
+            checkBoxFeatureNode
+            .setToolTipText(Messages.DatabaseRepairPage_toolTipFeatureNodes);
+            checkBoxFeatureNode.addSelectionListener(new SelectionAdapter() {
+                @Override
+                public void widgetSelected(SelectionEvent e) {
+                    sortIndexConfig.setDoFeatureNode(!sortIndexConfig.isDoFeatureNode());
+                }
+            });
+
+
+            TabItem tbtmNewItem = new TabItem(tabFolder, SWT.NONE);
+            tbtmNewItem.setText("Update Caches");
+
+            Composite composite_1 = new Composite(tabFolder, SWT.NONE);
+            tbtmNewItem.setControl(composite_1);
+            composite_1.setLayout(new GridLayout(1, false));
+
+            Button checkBoxTaxonName = new Button(composite_1, SWT.CHECK);
+            checkBoxTaxonName.setSelection(config.getClassList().contains(TaxonNameBase.class));
+            checkBoxTaxonName.setText(Messages.DatabaseRepairPage_updateTaxonName);
+            checkBoxTaxonName
+                    .setToolTipText(Messages.DatabaseRepairPage_toolTip_TaxonName);
+            checkBoxTaxonName.addSelectionListener(new SelectionAdapter() {
+                @Override
+                public void widgetSelected(SelectionEvent e) {
+                    List<Class<? extends IdentifiableEntity>> classList = config.getClassList();
+                    classList.add(TaxonNameBase.class);
+                }
+            });
+
+            Button checkBoxTaxonBase = new Button(composite_1, SWT.CHECK);
+            checkBoxTaxonBase.setSelection(config.getClassList().contains(TaxonBase.class));
+            checkBoxTaxonBase.setText(Messages.DatabaseRepairPage_TaxonBase);
+            checkBoxTaxonBase
+            .setToolTipText(Messages.DatabaseRepairPage_toolTip_taxonBase);
+            checkBoxTaxonBase.addSelectionListener(new SelectionAdapter() {
+                @Override
+                public void widgetSelected(SelectionEvent e) {
+                    List<Class<? extends IdentifiableEntity>> classList  = config.getClassList();
+                    classList.add(TaxonBase.class);
+                }
+            });
+
+            Button checkBoxReference = new Button(composite_1, SWT.CHECK);
+            checkBoxReference.setSelection(config.getClassList().contains(Reference.class));
+            checkBoxReference.setText(Messages.DatabaseRepairPage_Reference);
+            checkBoxReference
+            .setToolTipText(Messages.DatabaseRepairPage_toolTip_reference);
+            checkBoxReference.addSelectionListener(new SelectionAdapter() {
+                @Override
+                public void widgetSelected(SelectionEvent e) {
+                    List<Class<? extends IdentifiableEntity>> classList  = config.getClassList();
+                    classList.add(Reference.class);
+                }
+            });
+
+
+            tabFolder.pack();
+    }
+}