ref #8562: add supplemental data subtree to ui part
authorKatja Luther <k.luther@bgbm.org>
Thu, 5 Mar 2020 09:27:02 +0000 (10:27 +0100)
committerKatja Luther <k.luther@bgbm.org>
Thu, 5 Mar 2020 09:27:02 +0000 (10:27 +0100)
eu.etaxonomy.taxeditor.store/plugin.xml
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/SupplementalDataPreferences.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/UIPreferences.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableDistributionPage.java

index abbd3f2f19b0822f56347c3221471974f62c2ceb..1603dcf345400a228b22b3222f718c28fbcf1923 100755 (executable)
          id="eu.etaxonomy.taxeditor.preferences.termEditor"
          name="%page.name.101">
    </page>
+   <page
+         category="eu.etaxonomy.taxeditor.preference.UIPreferences"
+         class="eu.etaxonomy.taxeditor.preference.SupplementalDataPreferences"
+         id="eu.etaxonomy.taxeditor.preferences.supplemental"
+         name="%view.name.3">
+   </page>
+   
    <page
          category="eu.etaxonomy.taxeditor.preferences.description"
          class="eu.etaxonomy.taxeditor.preference.menu.FeatureMenuPreferences"
           name="%page.name.60">
     </page>
     <page
-          category="eu.etaxonomy.taxeditor.preference.UIPreferences"
+          category="eu.etaxonomy.taxeditor.preferences.supplemental"
           class="eu.etaxonomy.taxeditor.preference.SupplementalDataSourcePreferences"
           id="eu.etaxonomy.taxeditor.preferences.supplementalDataSourcePreferences"
           name="%page.name.sources">
index e1050441615f6e202e99d1907034d590e1ea038e..1ba76345864eded94594f0fcd31272ba4bcb6ab3 100755 (executable)
@@ -8,23 +8,25 @@
 */
 package eu.etaxonomy.taxeditor.preference;
 
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
+import org.eclipse.jface.preference.BooleanFieldEditor;
 
-import eu.etaxonomy.taxeditor.preference.menu.CdmPreferencePage;
+import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
+import eu.etaxonomy.taxeditor.l10n.Messages;
+import eu.etaxonomy.taxeditor.preference.menu.FieldEditorPreferencePageE4;
 
 /**
  * @author k.luther
  * @since 18.01.2019
  *
  */
-public class SupplementalDataPreferences extends CdmPreferencePage {
+public class SupplementalDataPreferences extends FieldEditorPreferencePageE4 {
 
 
     @Override
-    protected Control createContents(Composite parent) {
-        noDefaultAndApplyButton();
-        return null;
-    }
+    protected void createFieldEditors() {
+       addField(new BooleanFieldEditor(PreferencesUtil.createPreferenceString(PreferencePredicate.ShowUuidAndIdInSupplementalDataView.getKey()),
+                Messages.SupplementalDataPreferences_0,
+                getFieldEditorParent()));
 
+    }
 }
index f5214b07994d3a329789b75afb3e1e729c27b57d..6d0e21a088dd4bb38ccfafc74c102e15909884a0 100755 (executable)
@@ -10,7 +10,6 @@ package eu.etaxonomy.taxeditor.preference;
 
 import org.eclipse.jface.preference.BooleanFieldEditor;
 
-import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
 import eu.etaxonomy.taxeditor.l10n.Messages;
 import eu.etaxonomy.taxeditor.preference.menu.FieldEditorPreferencePageE4;
 
@@ -21,20 +20,13 @@ import eu.etaxonomy.taxeditor.preference.menu.FieldEditorPreferencePageE4;
  */
 public class UIPreferences extends FieldEditorPreferencePageE4 {
 
-    /**
-     * {@inheritDoc}
-     */
+
     @Override
     protected void createFieldEditors() {
         addField(new BooleanFieldEditor(PreferencesUtil.createPreferenceString(
                 IPreferenceKeys.SHOULD_EXPAND_SECTION_WHEN_DATA_AVAILABLE),
                 Messages.UIPreferences_expand,
                 getFieldEditorParent()));
-
-        addField(new BooleanFieldEditor(PreferencesUtil.createPreferenceString(PreferencePredicate.ShowUuidAndIdInSupplementalDataView.getKey()),
-                Messages.SupplementalDataPreferences_0,
-                getFieldEditorParent()));
-
-    }
+     }
 
 }
index fcbe53b1646c3e4bebf5f1120c42e99cff02d079..9e756167e067783bfe882a6301e61379514313d4 100755 (executable)
@@ -121,7 +121,7 @@ public class AvailableDistributionPage extends AbstractTermSelectionWizardPage<T
             vocs = CdmStore.getService(IVocabularyService.class).findVocabularyDtoByTermType(type);
         }else{
             String vocString = PreferencesUtil.getStringValue(PreferencePredicate.AvailableDistributionAreaVocabularies.getKey());
-            if (vocString.equals("")){
+            if (vocString == null || vocString.equals("")){
                 vocs = CdmStore.getService(IVocabularyService.class).findVocabularyDtoByTermType(type);
                 return vocs;
             }