- added preference which shows determination section only for FieldUnits in the...
authorPatric Plitzner <p.plitzner@bgbm.org>
Mon, 17 Feb 2014 14:48:20 +0000 (14:48 +0000)
committerPatric Plitzner <p.plitzner@bgbm.org>
Mon, 17 Feb 2014 14:48:20 +0000 (14:48 +0000)
 - added missing parameters for SingleRead DetailsView

.gitattributes
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/IPreferenceKeys.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/SpecimenOrObservationPreferences.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/TissueSampleGeneralDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewer.java

index b8ab28ceb9606d49163af7ac52160c2fae735417..55005b319ef18e92cd4049f3b0f8c6f4e8ba0af1 100644 (file)
@@ -1237,6 +1237,7 @@ eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/Nom
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PreferencePropertyTester.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PreferencesUtil.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/Resources.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/SpecimenOrObservationPreferences.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/TaxonomicEditorGeneralPreferences.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/TaxonomicPreferences.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/TypeDesignationPreferences.java -text
index 6e2c925161e997b5f692a692cc5df38f3d56b81e..27db8420b3f049bd60f6e65ee54440d1778b6df6 100644 (file)
@@ -116,4 +116,6 @@ public interface IPreferenceKeys {
        public static final String SEARCH_OPEN_RESULTS_IN_SEPARATE_WINDOWS = "eu.etaxonomy.taxeditor.navigation.search.openResultInSeparateWindows";
 
        public static final String ADD_TYPES_TO_ALL_NAMES = "eu.etaxonomy.taxeditor.store.addTypeToAllNames";
+
+    public static final String DETERMINATION_ONLY_FOR_FIELD_UNITS = "eu.etaxonomy.taxeditor.specimen.determinationOnlyOnFieldUnitLevel";
 }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/SpecimenOrObservationPreferences.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/SpecimenOrObservationPreferences.java
new file mode 100644 (file)
index 0000000..ef581b5
--- /dev/null
@@ -0,0 +1,45 @@
+// $Id$
+/**
+* Copyright (C) 2014 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.preference;
+
+import org.eclipse.jface.preference.BooleanFieldEditor;
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+/**
+ * @author pplitzner
+ * @date 13.02.2014
+ *
+ */
+public class SpecimenOrObservationPreferences extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+     */
+    @Override
+    public void init(IWorkbench workbench) {
+        setPreferenceStore(PreferencesUtil.getPreferenceStore());
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
+     */
+    @Override
+    protected void createFieldEditors() {
+
+        addField(new BooleanFieldEditor(IPreferenceKeys.DETERMINATION_ONLY_FOR_FIELD_UNITS,
+                "Taxon determination only on FieldUnit level",
+                getFieldEditorParent()));
+
+    }
+
+
+}
index 1ab7d3e7b8c0c8ae4310a857b4bef370bea8b1b5..9f145d3b7a7e6a055c97193051dc2011689ba895 100644 (file)
 package eu.etaxonomy.taxeditor.ui.section.occurrence.dna;
 
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.model.agent.AgentBase;
+import eu.etaxonomy.cdm.model.occurrence.Collection;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
+import eu.etaxonomy.taxeditor.ui.element.TimePeriodElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
+import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
 
 /**
  * @author pplitzner
@@ -21,6 +26,18 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
  */
 public class TissueSampleGeneralDetailElement extends AbstractCdmDetailElement<DerivedUnitFacade> {
 
+    //title cache
+    //sample designation
+    private TimePeriodElement datePreparation;
+    private EntitySelectionElement<AgentBase> selectionPreparedBy;
+    private TextWithLabelElement textPreservationMedium;
+    private TimePeriodElement datePreservation;
+    private EntitySelectionElement<AgentBase> selectionStoredAt;
+    private EntitySelectionElement<Collection> selectionCollection;
+    private TextWithLabelElement textAccessionNumber;
+    private TextWithLabelElement textBarcode;
+
+
     /**
      * @param formFactory
      * @param formElement
@@ -38,6 +55,14 @@ public class TissueSampleGeneralDetailElement extends AbstractCdmDetailElement<D
      */
     @Override
     protected void createControls(ICdmFormElement formElement, DerivedUnitFacade entity, int style) {
+        datePreparation = formFactory.createTimePeriodElement(formElement, "Preparation date", null, style);
+        selectionPreparedBy = formFactory.createSelectionElement(AgentBase.class, getConversationHolder(), formElement, "Prepared By", null, EntitySelectionElement.ALL, style);
+        textPreservationMedium = formFactory.createTextWithLabelElement(formElement, "Preservation medium", null, style);
+        datePreservation = formFactory.createTimePeriodElement(formElement, "Preservation date", null, style);
+        selectionStoredAt = formFactory.createSelectionElement(AgentBase.class, getConversationHolder(), formElement, "Stored at", null, EntitySelectionElement.ALL, style);
+        selectionCollection = formFactory.createSelectionElement(Collection.class, getConversationHolder(), formElement, "Collection", null, EntitySelectionElement.ALL, style);
+        textAccessionNumber = formFactory.createTextWithLabelElement(formElement, "Accession Number", null, style);
+        textBarcode = formFactory.createTextWithLabelElement(formElement, "Barcode", null, style);
 
     }
 
index 326cbe3eb1d2308ba38db7dcd9e76b24933e2f39..1c1c5f81db6e252de54391898f2ff81ff8f9c464 100644 (file)
@@ -54,6 +54,7 @@ import eu.etaxonomy.taxeditor.editor.UsageTermCollection;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
 import eu.etaxonomy.taxeditor.model.PolytomousKeyRelationship;
+import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
@@ -659,15 +660,17 @@ public class DetailsViewer extends AbstractCdmDataViewer {
 
         DerivedUnitBaseDetailSection derivedUnitBaseDetailSection = formFactory.createDerivedUnitBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
 
-        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-        DeterminationDetailSection determinationDetailSection = formFactory.createDeterminationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
-
         addPart(derivedUnitGeneralDetailSection);
         addPart(gatheringEventDetailSection);
         addPart(fieldUnitDetailSection);
         addPart(derivedUnitBaseDetailSection);
-        addPart(determinationDetailSection);
+
+        if(!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.DETERMINATION_ONLY_FOR_FIELD_UNITS)){
+            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+            DeterminationDetailSection determinationDetailSection = formFactory.createDeterminationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
+            addPart(determinationDetailSection);
+        }
+
 
     }
 
@@ -687,6 +690,12 @@ public class DetailsViewer extends AbstractCdmDataViewer {
         addPart(fielUnitGeneralDetailSection);
         addPart(gatheringEventDetailSection);
         addPart(fieldUnitDetailSection);
+
+        if(PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.DETERMINATION_ONLY_FOR_FIELD_UNITS)){
+            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+            DeterminationDetailSection determinationDetailSection = formFactory.createDeterminationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
+            addPart(determinationDetailSection);
+        }
     }
 
     private void createPreservedSpecimenSpecimenSection(RootElement parent) {