add the possibility to add default biocase providers and the abcd import config to...
authorKatja Luther <k.luther@bgbm.org>
Fri, 21 Apr 2017 13:14:25 +0000 (15:14 +0200)
committerKatja Luther <k.luther@bgbm.org>
Fri, 21 Apr 2017 13:14:25 +0000 (15:14 +0200)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/DatabasePreferencesPage.java [changed mode: 0644->0755]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/DatabasePreferencesWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/ImportPreferencesWizard.java [new file with mode: 0755]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/ListComponent.java [new file with mode: 0755]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/NameDetailsViewComposite.java [new file with mode: 0755]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/OpenImportPreferenceHandler.java [new file with mode: 0755]

old mode 100644 (file)
new mode 100755 (executable)
index e6b52b3..235c7b2
@@ -26,6 +26,7 @@ import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.TabFolder;
 import org.eclipse.swt.widgets.TabItem;
 
+import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator;
 import eu.etaxonomy.cdm.model.metadata.CdmPreference;
 import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
 import eu.etaxonomy.taxeditor.l10n.Messages;
@@ -54,10 +55,18 @@ public class DatabasePreferencesPage extends WizardPage implements IWizardPage{
     IPreferenceStore preferenceStore;
     Composite composite;
     boolean isSimpleDetailsViewActivated;
+
     Composite child ;
+    NameDetailsViewComposite nameDetailsConfig;
+    protected NameDetailsViewComposite getNameDetailsConfig() {
+        return nameDetailsConfig;
+    }
+
+    String selectedPreferenceKey = null;
+
+    ListComponent biocaseProviderList;
+    Abcd206ImportConfigurator abcdImportConfigurator;
 
-    private Combo nomenclaturalCodeCombo;
-    private Label nomenclaturalCodeLabel;
 
 //    private UriWithLabelElement nomenclaturalCodeCombo;
 //    private Label nomenclaturalCodeLabel;
@@ -71,6 +80,9 @@ public class DatabasePreferencesPage extends WizardPage implements IWizardPage{
         super(pageName);
         this.preferedNomenclaturalCode = PreferencesUtil.setPreferredNomenclaturalCode(null, false);
         this.config = PreferencesUtil.setPreferredNameDetailsConfiguration( false);
+        if (config == null){
+            config = new NameDetailsConfigurator(false);
+        }
         setPreferenceStore(PreferencesUtil.getPreferenceStore());
 
     }
@@ -103,236 +115,16 @@ public class DatabasePreferencesPage extends WizardPage implements IWizardPage{
         GridLayout layout = new GridLayout();
         currentTab.setLayout(layout);
         currentTab.setFont(composite.getFont());
-        currentTab.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+       // 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(Messages.DatabasePreferencesPage_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(Messages.DatabasePreferencesPage_show_only_simple_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(Messages.DatabasePreferencesPage_show_taxon);
-       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(Messages.DatabasePreferencesPage_show_lsid);
-       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(Messages.DatabasePreferencesPage_show_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(Messages.DatabasePreferencesPage_show_namecache);
-       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(Messages.DatabasePreferencesPage_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(Messages.DatabasePreferencesPage_show_rank);
-       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(Messages.DatabasePreferencesPage_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 showAuthorshipCache = new Button(child, SWT.CHECK);
-       boolean isShowAuthorshipCache = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP_CACHE);
-       showAuthorshipCache.setText(Messages.DatabasePreferencesPage_show_authorship_cache);
-       showAuthorshipCache.setSelection(isShowAuthorshipCache);
-       showAuthorshipCache.addSelectionListener(new SelectionAdapter(){
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                boolean isShowAuthorshipCache = showAuthorshipCache.getSelection();
-                PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP_CACHE, isShowAuthorshipCache);
-             }
-        });
-
-       final Button showAuthorship = new Button(child, SWT.CHECK);
-       boolean isShowAuthorship = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP);
-       showAuthorship.setText(Messages.DatabasePreferencesPage_show_author_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(Messages.DatabasePreferencesPage_Show_nomenclatural_Ref);
-       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(Messages.DatabasePreferencesPage_Show_nomenclaturalStatus);
-       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(Messages.DatabasePreferencesPage_Show_Protologue);
-       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(Messages.DatabasePreferencesPage_Show_Type_designation);
-       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(Messages.DatabasePreferencesPage_Show_NameRelations);
-       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);
-
-
-
 
     }
 
 
 
+
     protected IPreferenceStore doGetPreferenceStore() {
         return PreferencesUtil.getPreferenceStore();
     }
@@ -354,33 +146,18 @@ public class DatabasePreferencesPage extends WizardPage implements IWizardPage{
     }
 
 
-/**
-     *
-     */
-    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(Messages.DatabasePreferencesPage_Define_Default_NomenclaturalCode);
-       nomenclaturalCodeCombo = new Combo(composite, SWT.READ_ONLY);
-      List<NomenclaturalCode> supportedCodes = NomenclaturalCodeHelper
+
+        Combo nomenclaturalCodeCombo;
+        Label nomenclaturalCodeLabel;
+
+        composite = addTab(Messages.DatabasePreferencesPage_Define_Default_NomenclaturalCode);
+        nomenclaturalCodeCombo = new Combo(composite, SWT.READ_ONLY);
+        List<NomenclaturalCode> supportedCodes = NomenclaturalCodeHelper
               .getSupportedCodes();
-       for (NomenclaturalCode code: supportedCodes) {
+        for (NomenclaturalCode code: supportedCodes) {
            nomenclaturalCodeCombo.add(NomenclaturalCodeHelper
                    .getDescription(code));
 
@@ -392,7 +169,7 @@ public class DatabasePreferencesPage extends WizardPage implements IWizardPage{
         public void widgetSelected(SelectionEvent evt) {
 
                String name = nomenclaturalCodeCombo.getText();
-               String selectedPreferenceKey = null;
+
                for (String[] labelAndValue: labelAndValues){
                    if (labelAndValue[0].equals(name)){
                        selectedPreferenceKey = labelAndValue[1];
@@ -426,52 +203,25 @@ public class DatabasePreferencesPage extends WizardPage implements IWizardPage{
 
     public void createBiocaseProviderTab(Composite parent){
         composite = addTab(Messages.DatabasePreferencesPage_Biocase_Provider);
-        nomenclaturalCodeCombo = new Combo(composite, SWT.READ_ONLY);
-       List<NomenclaturalCode> supportedCodes = NomenclaturalCodeHelper
-               .getSupportedCodes();
-        for (NomenclaturalCode code: supportedCodes) {
-            nomenclaturalCodeCombo.add(NomenclaturalCodeHelper
-                    .getDescription(code));
-
-        }
-        getLabelAndValues();
-        //get the actual nomenclatural code and set it as selection: doGetPreferenceStore().getString(IPreferenceKeys.CDM_NOMENCLATURAL_CODE_KEY);
-        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(Messages.DatabasePreferencesPage_UseLocalPreferences);
-         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);
-               }
-          });
-
+        GridLayout gridLayout = new GridLayout();
+        gridLayout.numColumns = 2;
+        composite.setLayout(gridLayout);
+        biocaseProviderList = new ListComponent(composite, SWT.SCROLL_LINE);
 
+ }
 
+    public ListComponent getBiocaseProviderList() {
+        return biocaseProviderList;
+    }
 
- }
+    public void createNameDetailsViewConfigurationTab(Composite parent, NameDetailsConfigurator config){
+        composite = parent;
+        composite = addTab(Messages.DatabasePreferencesPage_details_view_configuration);
+        GridLayout gridLayout = new GridLayout();
+        gridLayout.numColumns = 2;
+        composite.setLayout(gridLayout);
+        nameDetailsConfig = new NameDetailsViewComposite(composite, SWT.SCROLL_LINE, config);
+    }
 
 
     public void createSpecimenOrObservationTab(Composite parent){
@@ -608,10 +358,11 @@ public void setWizard(IWizard newWizard) {
  */
 @Override
 public void createControl(Composite parent) {
-    createNameDetailsConfiguration(parent);
+    createNameDetailsViewConfigurationTab(parent, config);
     createNomenclaturalCodeTab(parent);
 
     createSpecimenOrObservationTab(parent);
+    createBiocaseProviderTab(parent);
     setControl(parent);
 }
 
@@ -619,10 +370,40 @@ public void createControl(Composite parent) {
  * @return
  */
 public NameDetailsConfigurator getConfig() {
-
     return config;
 }
 
+/**
+ *
+ */
+public Abcd206ImportConfigurator getAbcdImportConfig() {
+    return abcdImportConfigurator;
+
+}
+
+/**
+ * @return
+ */
+public void createAbcdImportConfig() {
+    this.abcdImportConfigurator.setAddIndividualsAssociationsSuchAsSpecimenAndObservations(doGetPreferenceStore().getBoolean(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_ADD_INDIVIDUALS_ASSOCIATIONS_SUCH_AS_SPECIMEN_AND_OBSERVATIONS));
+    this.abcdImportConfigurator.setAddMediaAsMediaSpecimen(doGetPreferenceStore().getBoolean(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_ADD_MEDIA_AS_MEDIASPECIMEN));
+    this.abcdImportConfigurator.setAllowReuseOtherClassifications(doGetPreferenceStore().getBoolean(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_ALLOW_REUSE_OTHER_CLASSIFICATIONS));
+    //this.abcdImportConfigurator.setClassificationUuid(doGetPreferenceStore().getBoolean(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_CLASSIFICATION_UUID));
+    this.abcdImportConfigurator.setDeduplicateClassifications(doGetPreferenceStore().getBoolean(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_DEDUPLICATE_CLASSIFICATIONS));
+    this.abcdImportConfigurator.setDeduplicateReferences(doGetPreferenceStore().getBoolean(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_DEDUPLICATE_REFERENCES));
+   // this.abcdImportConfigurator.setDefaultAuthor(doGetPreferenceStore().getBoolean(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_DEFAULT_AUTHOR));
+    this.abcdImportConfigurator.setGetSiblings(doGetPreferenceStore().getBoolean(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_DO_SIBLINGS));
+    this.abcdImportConfigurator.setIgnoreAuthorship(doGetPreferenceStore().getBoolean(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_IGNORE_AUTHORSHIP));
+    this.abcdImportConfigurator.setIgnoreImportOfExistingSpecimen(doGetPreferenceStore().getBoolean(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_IGNORE_IMPORT_OF_EXISTING_SPECIMEN));
+    this.abcdImportConfigurator.setMapUnitIdToAccessionNumber(doGetPreferenceStore().getBoolean(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_MAP_UNIT_ID_TO_ACCESSION_NUMBER));
+    this.abcdImportConfigurator.setMapUnitIdToBarcode(doGetPreferenceStore().getBoolean(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_MAP_UNIT_ID_TO_BARCODE));
+    this.abcdImportConfigurator.setMapUnitIdToCatalogNumber(doGetPreferenceStore().getBoolean(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_MAP_UNIT_ID_TOCATALOG_NUMBER));
+    this.abcdImportConfigurator.setMoveNewTaxaToDefaultClassification(doGetPreferenceStore().getBoolean(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_MOVE_NEW_TAXA_TO_DEFAULT_CLASSIFICATION));
+    this.abcdImportConfigurator.setReuseExistingDescriptiveGroups(doGetPreferenceStore().getBoolean(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_REUSE_EXISTING_DESCRIPTIVE_GROUPS));
+    this.abcdImportConfigurator.setReuseExistingTaxaWhenPossible(doGetPreferenceStore().getBoolean(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_REUSE_EXISTING_TAXA_WHEN_POSSIBLE));
+
+}
+
 
 
 
index 54544acf4d37d3180eb4aef55e8acffb4da05f66..2f062e4d0ae2915e48492b7b682223070f31021c 100644 (file)
@@ -8,12 +8,15 @@
 */
 package eu.etaxonomy.taxeditor.databaseAdmin.wizard;
 
+import org.eclipse.jface.wizard.IWizardPage;
 import org.eclipse.jface.wizard.Wizard;
 
 import eu.etaxonomy.cdm.api.application.ICdmRepository;
 import eu.etaxonomy.cdm.api.service.IPreferenceService;
+import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator;
 import eu.etaxonomy.cdm.model.metadata.CdmPreference;
 import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
+import eu.etaxonomy.taxeditor.io.wizard.AbcdImportConfiguratorWizardPage;
 import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
@@ -26,14 +29,15 @@ public class DatabasePreferencesWizard extends Wizard {
 
 
     public DatabasePreferencesPage preferencePage;
+    public AbcdImportConfiguratorWizardPage configAbcdImport;
 
 
     public DatabasePreferencesWizard() {
         setWindowTitle("Database Preferences Wizard");
 
         preferencePage = new DatabasePreferencesPage("Database Preferences");
-       // preferencePage.setDescription("Choose which nomenclatural code you would like to use for scientific names unless otherwise specified.");
-       // preferencePage.init(PlatformUI.getWorkbench());
+        configAbcdImport = AbcdImportConfiguratorWizardPage.createPage(Abcd206ImportConfigurator.NewInstance(null, null));
+
     }
 
 
@@ -64,8 +68,7 @@ public class DatabasePreferencesWizard extends Wizard {
         IPreferenceService service = controller.getPreferenceService();
         service.set(pref);
 
-        getPreferencePage().createNameDetailsViewConfig();
-        value = getPreferencePage().getConfig().toString();
+        value = getPreferencePage().getNameDetailsConfig().createNameDetailsViewConfig().toString();
         allowOverride = getPreferencePage().doGetPreferenceStore().getBoolean(IPreferenceKeys.ALLOW_OVERRIDE_NAMEDETAILS);
         pref = CdmPreference.NewDatabaseInstance( PreferencePredicate.NameDetailsView, value);
         pref.setAllowOverride(allowOverride);
@@ -87,6 +90,23 @@ public class DatabasePreferencesWizard extends Wizard {
         pref.setAllowOverride(false);
         service.set(pref);
 
+        String biocaseProviderList = this.getPreferencePage().getBiocaseProviderList().createAllProviderString();
+        if (biocaseProviderList == null){
+            getPreferencePage().doGetPreferenceStore().setValue(IPreferenceKeys.BIOCASE_PROVIDER_LIST,"");
+        }else{
+            getPreferencePage().doGetPreferenceStore().setValue(IPreferenceKeys.BIOCASE_PROVIDER_LIST, biocaseProviderList);
+
+        }
+        pref = CdmPreference.NewDatabaseInstance( PreferencePredicate.BioCaseProvider, String.valueOf(biocaseProviderList));
+        pref.setAllowOverride(false);
+        service.set(pref);
+//        getPreferencePage().createAbcdImportConfig();
+//        value = getPreferencePage().getAbcdImportConfig().toString();
+//        allowOverride = getPreferencePage().doGetPreferenceStore().getBoolean(IPreferenceKeys.ALLOW_OVERRIDE_ABCD_IMPORT_CONFIG);
+//        pref = CdmPreference.NewDatabaseInstance( PreferencePredicate.AbcdImportConfig, value);
+//        pref.setAllowOverride(allowOverride);
+//        service.set(pref);
+
         return true;
     }
 
@@ -95,8 +115,16 @@ public class DatabasePreferencesWizard extends Wizard {
     @Override
     public void addPages() {
         addPage(preferencePage);
+        addPage(configAbcdImport);
     }
 
+    @Override
+    public IWizardPage getNextPage(IWizardPage currentPage) {
+       if (currentPage.equals(preferencePage)){
+           return configAbcdImport;
+       }
+       return null;
+    }
 
 
 }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/ImportPreferencesWizard.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/ImportPreferencesWizard.java
new file mode 100755 (executable)
index 0000000..4adb396
--- /dev/null
@@ -0,0 +1,39 @@
+/**
+* Copyright (C) 2017 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.io.specimen.abcd206.in.Abcd206ImportConfigurator;
+import eu.etaxonomy.taxeditor.io.wizard.AbcdImportConfiguratorWizardPage;
+
+/**
+ * @author k.luther
+ * @date 19.04.2017
+ *
+ */
+public class ImportPreferencesWizard extends Wizard {
+
+    public AbcdImportConfiguratorWizardPage configPage;
+
+    public ImportPreferencesWizard() {
+        setWindowTitle("Abcd Import Configuration Wizard");
+        configPage = AbcdImportConfiguratorWizardPage.createPreferencePage(Abcd206ImportConfigurator.NewInstance(null, null));
+
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean performFinish() {
+
+        return false;
+    }
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/ListComponent.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/ListComponent.java
new file mode 100755 (executable)
index 0000000..5ba51a1
--- /dev/null
@@ -0,0 +1,225 @@
+/**
+* Copyright (C) 2017 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.awt.Toolkit;
+import java.util.ArrayList;
+
+import javax.swing.event.DocumentEvent;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.List;
+import org.eclipse.swt.widgets.Text;
+
+import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+
+
+/**
+ * @author k.luther
+ * @date 20.04.2017
+ *
+ */
+public class ListComponent
+                      {
+    private List list;
+
+    private static final String addString = "Add";
+    private static final String removeString = "Remove";
+    private Button removeButton;
+    private Text providerURI;
+
+    public ListComponent(Composite parent, int style) {
+        list = new List(parent, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL);
+
+        java.util.List<String> providerList = new ArrayList<String>();
+        String allProviderString = PreferencesUtil.getPreferenceStore().getString(IPreferenceKeys.BIOCASE_PROVIDER_LIST);
+        //the string is structured like this: http://ww3.bgbm.org/biocase/pywrapper.cgi?dsa=DNA_Bank;http:...;
+        String[] providerArray = allProviderString.split(";");
+
+        for (String providerString : providerArray){
+            list.add(providerString);
+        }
+
+        list.setSelection(0);
+        GridData dataList = new GridData();
+        dataList.horizontalAlignment = GridData.FILL;
+        dataList.horizontalSpan = 2;
+        dataList.verticalSpan= 4;
+
+        list.setLayoutData(dataList);
+
+
+        providerURI = new Text(parent, SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION);
+        GridData dataProviderUri = new GridData();
+        dataProviderUri.horizontalAlignment = GridData.FILL;
+        dataProviderUri.horizontalSpan = 2;
+        providerURI.setLayoutData(dataProviderUri);
+
+        Button addButton = new Button(parent, SWT.NULL);
+        AddListener addListener = new AddListener(addButton);
+        addButton.setText(addString);
+        addButton.addMouseListener(addListener);
+
+        removeButton = new Button(parent, SWT.NULL);
+        removeButton.setText(removeString);
+        removeButton.addMouseListener(new RemoveListener());
+    }
+
+    class RemoveListener implements MouseListener {
+        @Override
+        public void mouseUp(MouseEvent e)  {
+            //This method can be called only if
+            //there's a valid selection
+            //so go ahead and remove whatever's selected.
+            int index = list.getSelectionIndex();
+            list.remove(index);
+
+            int size = list.getItemCount();
+
+            if (size == 0) { //Nothing's left, disable removing.
+                removeButton.setEnabled(false);
+
+            } else { //Select an index.
+                if (index == size) {
+                    //removed item in last position
+                    index--;
+                }
+
+                list.setSelection(index-1);
+
+
+            }
+        }
+        /**
+         * {@inheritDoc}
+         */
+        @Override
+        public void mouseDoubleClick(MouseEvent e) {
+            // TODO Auto-generated method stub
+
+        }
+
+
+        /**
+         * {@inheritDoc}
+         */
+        @Override
+        public void mouseDown(MouseEvent e) {
+            // TODO Auto-generated method stub
+
+        }
+    }
+
+    //This listener is shared by the text field and the add button.
+    class AddListener implements MouseListener {
+        private boolean alreadyEnabled = false;
+        private Button button;
+
+        public AddListener(Button button) {
+            this.button = button;
+        }
+
+
+        protected boolean alreadyInList(String name) {
+            return list.getData(name) != null;
+        }
+
+
+        private void enableButton() {
+            if (!alreadyEnabled) {
+                button.setEnabled(true);
+            }
+        }
+
+        private boolean handleEmptyTextField(DocumentEvent e) {
+            if (e.getDocument().getLength() <= 0) {
+                button.setEnabled(false);
+                alreadyEnabled = false;
+                return true;
+            }
+            return false;
+        }
+
+
+
+        /**
+         * {@inheritDoc}
+         */
+        @Override
+        public void mouseDoubleClick(MouseEvent e) {
+            // TODO Auto-generated method stub
+
+        }
+
+        /**
+         * {@inheritDoc}
+         */
+        @Override
+        public void mouseDown(MouseEvent e) {
+            // TODO Auto-generated method stub
+
+        }
+
+        /**
+         * {@inheritDoc}
+         */
+        @Override
+        public void mouseUp(MouseEvent e) {
+            String name = providerURI.getText();
+
+            //User didn't type in a unique name...
+            if (name.equals("") || alreadyInList(name)) {
+                Toolkit.getDefaultToolkit().beep();
+                providerURI.selectAll();
+                return;
+            }
+
+            int index = list.getSelectionIndex(); //get selected index
+            if (index == -1) { //no selection, so insert at beginning
+                index = 0;
+            } else {           //add after the selected item
+                index++;
+            }
+
+            list.add(providerURI.getText(), index);
+
+            //Select the new item
+            list.setSelection(index);
+            list.redraw();
+
+        }
+    }
+
+    protected String createAllProviderString(){
+        String allProviderString = null;
+        boolean first = true;
+        for (String item: list.getItems()){
+            if (first || allProviderString == null || allProviderString == ""){
+                allProviderString = item.trim();
+                first = false;
+            }else{
+                allProviderString +=";"+ item.trim();
+            }
+        }
+
+        return allProviderString;
+
+    }
+
+
+
+}
+
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/NameDetailsViewComposite.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/NameDetailsViewComposite.java
new file mode 100755 (executable)
index 0000000..b9d06fd
--- /dev/null
@@ -0,0 +1,320 @@
+/**
+* Copyright (C) 2017 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.IPreferenceStore;
+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.taxeditor.preference.IPreferenceKeys;
+import eu.etaxonomy.taxeditor.preference.NameDetailsConfigurator;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+
+/**
+ * @author k.luther
+ * @date 22.02.2017
+ *
+ */
+public class NameDetailsViewComposite extends Composite {
+
+    NameDetailsConfigurator config;
+    boolean isSimpleDetailsViewActivated;
+    boolean isShowTaxon;
+    boolean isShowLSID;
+    boolean isShowNomenclaturalCode;
+    boolean isShowNameCache;
+    boolean isShowAppendedPhrase;
+    boolean isShowRank;
+    boolean isShowEpithets;
+    boolean isShowAuthorshipCache;
+    boolean isShowAuthorship;
+    boolean isShowNomenclaturalRef;
+    boolean isShowNomenclaturalStatus;
+    boolean isShowProtologue;
+    boolean isShowTypeDesignation;
+    boolean isShowNameRelationship;
+    Composite child;
+
+    public NameDetailsViewComposite(Composite parent, int style, NameDetailsConfigurator config){
+
+        super(parent, style);
+//        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));
+       this.config = config;
+
+      // Composite composite = new Composite(parent, SWT.NULL);
+       this.setLayout(new GridLayout());
+
+       isSimpleDetailsViewActivated= PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION);
+       final Button activateCheckButton = new Button(this, 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();
+          //
+           if(isSimpleDetailsViewActivated){
+               child.setVisible(true);
+               child.setEnabled(true);
+           }else{
+               child.setVisible(false);
+               child.setEnabled(false);
+           }
+        }
+        });
+
+       child = new Composite(this, SWT.NULL);
+       child.setLayout(new GridLayout());
+       child.setVisible(isSimpleDetailsViewActivated);
+
+       final Button showTaxon = new Button(child, SWT.CHECK);
+       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) {
+               isShowTaxon = showTaxon.getSelection();
+
+             }
+        });
+
+       final Button showLsid = new Button(child, SWT.CHECK);
+       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) {
+                isShowLSID = showLsid.getSelection();
+
+             }
+        });
+
+       final Button showNomenclaturalCode = new Button(child, SWT.CHECK);
+       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) {
+                isShowNomenclaturalCode = showNomenclaturalCode.getSelection();
+
+             }
+        });
+
+       final Button showNameCache = new Button(child, SWT.CHECK);
+       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) {
+                isShowNameCache = showNameCache.getSelection();
+
+             }
+        });
+       final Button showAppendedPhrase = new Button(child, SWT.CHECK);
+       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) {
+                isShowAppendedPhrase = showAppendedPhrase.getSelection();
+
+             }
+        });
+
+       final Button showRank = new Button(child, SWT.CHECK);
+       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) {
+                isShowRank = showRank.getSelection();
+
+             }
+        });
+       final Button showEpithets = new Button(child, SWT.CHECK);
+       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) {
+                isShowEpithets = showEpithets.getSelection();
+
+             }
+        });
+       final Button showAuthorshipCache = new Button(child, SWT.CHECK);
+       isShowAuthorshipCache= PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP_CACHE);
+       showAuthorshipCache.setText("Show authorship cache");
+       showAuthorshipCache.setSelection(isShowAuthorshipCache);
+       showAuthorshipCache.addSelectionListener(new SelectionAdapter(){
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                isShowAuthorshipCache = showAuthorshipCache.getSelection();
+
+             }
+        });
+
+       final Button showAuthorship = new Button(child, SWT.CHECK);
+       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) {
+                isShowAuthorship = showAuthorship.getSelection();
+
+             }
+        });
+
+       final Button showNomenclaturalRef = new Button(child, SWT.CHECK);
+       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) {
+                isShowNomenclaturalRef = showNomenclaturalRef.getSelection();
+
+             }
+        });
+
+       final Button showNomenclaturalStatus = new Button(child, SWT.CHECK);
+       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) {
+                isShowNomenclaturalStatus = showNomenclaturalStatus.getSelection();
+
+             }
+        });
+
+       final Button showProtologue = new Button(child, SWT.CHECK);
+       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) {
+                isShowProtologue = showProtologue.getSelection();
+
+             }
+        });
+
+       final Button showTypeDesignation = new Button(child, SWT.CHECK);
+       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) {
+                isShowTypeDesignation = showTypeDesignation.getSelection();
+
+             }
+        });
+
+
+       final Button showNameRelationship = new Button(child, SWT.CHECK);
+       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) {
+                isShowNameRelationship = showNameRelationship.getSelection();
+
+             }
+        });
+
+       if(isSimpleDetailsViewActivated){
+           child.setEnabled(true);
+       }else{
+           child.setEnabled(false);
+       }
+
+    }
+
+    /**
+    *
+    */
+   protected NameDetailsConfigurator createNameDetailsViewConfig() {
+      saveConfigToPrefernceStore();
+
+      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));
+      return config;
+   }
+
+    /**
+     *
+     */
+    private void saveConfigToPrefernceStore() {
+        PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION,
+                isSimpleDetailsViewActivated);
+        PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_TAXON, isShowTaxon);
+        PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_LSID, isShowLSID);
+        PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_CODE,
+                isShowNomenclaturalCode);
+        PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAMECACHE,
+                isShowNameCache);
+        PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_APPENDED_PHRASE,
+                isShowAppendedPhrase);
+        PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_RANK, isShowRank);
+        PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_ATOMISED_EPITHETS,
+                isShowEpithets);
+        PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP_CACHE,
+                isShowAuthorshipCache);
+        PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP,
+                isShowAuthorship);
+        PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_REFERENCE,
+                isShowNomenclaturalRef);
+        PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_STATUS,
+                isShowNomenclaturalStatus);
+        PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_PROTOLOGUE,
+                isShowProtologue);
+        PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_TYPE_DESIGNATION,
+                isShowTypeDesignation);
+        PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAME_RELATIONSHIP,
+                isShowNameRelationship);
+
+    }
+
+    protected IPreferenceStore doGetPreferenceStore() {
+        return PreferencesUtil.getPreferenceStore();
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/OpenImportPreferenceHandler.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/OpenImportPreferenceHandler.java
new file mode 100755 (executable)
index 0000000..4035742
--- /dev/null
@@ -0,0 +1,34 @@
+/**
+* Copyright (C) 2017 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.handler;
+
+import org.eclipse.e4.core.di.annotations.Execute;
+import org.eclipse.jface.wizard.WizardDialog;
+
+import eu.etaxonomy.taxeditor.databaseAdmin.wizard.ImportPreferences;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
+
+/**
+ * @author k.luther
+ * @date 19.04.2017
+ *
+ */
+public class OpenImportPreferenceHandler {
+    @Execute
+    public Object execute(){
+        ImportPreferences importPreferencesWizard = new ImportPreferences();
+        WizardDialog dialog = new WizardDialog(AbstractUtility.getShell(),
+                importPreferencesWizard);
+
+        dialog.open();
+
+        return null;
+    }
+
+}