commit 7f4db90c9a2eb63d618ddca014e6f0656e2f55f7
Author: Andreas Müller <a.mueller@bgbm.org>
Date:   Wed May 16 01:34:37 2018 +0200

    ref #7421 continue refactor verbatim date sections and elements

diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/CdmFormFactory.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/CdmFormFactory.java
index d132a9742..c8e761231 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/CdmFormFactory.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/CdmFormFactory.java
@@ -1247,9 +1247,9 @@ public class CdmFormFactory extends FormToolkit {
      * @return a {@link eu.etaxonomy.taxeditor.ui.element.TimePeriodElement}
      *         object.
      */
-    public TimePeriodElement<TimePeriod> createTimePeriodElement(ICdmFormElement parentElement, String labelString,
+    public TimePeriodElement createTimePeriodElement(ICdmFormElement parentElement, String labelString,
             TimePeriod timePeriod, int style) {
-        TimePeriodElement<TimePeriod> element = new TimePeriodElement<TimePeriod>(this, parentElement, labelString, timePeriod, style);
+        TimePeriodElement element = new TimePeriodElement(this, parentElement, labelString, timePeriod, style);
         adapt(element);
         parentElement.addElement(element);
         return element;
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/DateDetailSection.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/DateDetailSection.java
index 72fb367e3..48c4b46e6 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/DateDetailSection.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/DateDetailSection.java
@@ -10,6 +10,7 @@
 package eu.etaxonomy.taxeditor.ui.element;
 
 import eu.etaxonomy.cdm.model.common.TimePeriod;
+import eu.etaxonomy.cdm.strategy.parser.TimePeriodParser;
 
 /**
  * <p>
@@ -29,5 +30,10 @@ public class DateDetailSection extends DateDetailSectionBase<TimePeriod> {
 	protected TimePeriod newInstance(){
 		return TimePeriod.NewInstance();
 	}
+	
+	protected TimePeriod parseNewInstance() {
+		TimePeriod result = TimePeriodParser.parseString(getText_parseText().getText());
+		return result;
+	}
 
 }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/DateDetailSectionBase.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/DateDetailSectionBase.java
index c79a0c259..1602c00c6 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/DateDetailSectionBase.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/DateDetailSectionBase.java
@@ -149,11 +149,7 @@ public abstract class DateDetailSectionBase<T extends TimePeriod>
 		firePropertyChangeEvent(new CdmPropertyChangeEvent(this, null));
 	}
 
-	protected T parseNewInstance() {
-		@SuppressWarnings("unchecked")
-		T result = (T)TimePeriodParser.parseString(getText_parseText().getText());
-		return result;
-	}
+	protected abstract T parseNewInstance() ;
 
 	protected void updateTitle(){
 		String title = CdmUtils.Nz(getEntity().toString());
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/TimePeriodElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/TimePeriodElement.java
index 201b0f4ab..882bdfdd4 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/TimePeriodElement.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/TimePeriodElement.java
@@ -21,7 +21,7 @@ import eu.etaxonomy.cdm.model.common.TimePeriod;
  * @author n.hoffmann
  * @created Nov 17, 2009
  */
-public class TimePeriodElement<T extends TimePeriod>
+public class TimePeriodElement
 			extends TimePeriodElementBase<TimePeriod> {
 
     
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/VerbatimDateDetailSection.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/VerbatimDateDetailSection.java
index 3aedfe81a..a030013c6 100755
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/VerbatimDateDetailSection.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/VerbatimDateDetailSection.java
@@ -12,6 +12,7 @@ import org.eclipse.swt.widgets.Text;
 
 import eu.etaxonomy.cdm.model.common.TimePeriod;
 import eu.etaxonomy.cdm.model.common.VerbatimTimePeriod;
+import eu.etaxonomy.cdm.strategy.parser.TimePeriodParser;
 
 /**
  * @author k.luther
@@ -55,23 +56,28 @@ public class VerbatimDateDetailSection extends DateDetailSectionBase<VerbatimTim
 	protected VerbatimTimePeriod newInstance(){
 		return VerbatimTimePeriod.NewVerbatimInstance();
 	}
+    
+	protected VerbatimTimePeriod parseNewInstance() {
+		VerbatimTimePeriod result = TimePeriodParser.parseStringVerbatim(getText_parseText().getText());
+		return result;
+	}
 
-
-    /**
-     * <p>
-     * Setter for the field <code>timePeriod</code>.
-     * </p>
-     *
-     * @param timePeriod
-     *            a {@link eu.etaxonomy.cdm.model.common.TimePeriod} object.
-     */
-
-    public void setEntity(VerbatimTimePeriod timePeriod) {
-        setEntityInternally(timePeriod);
-        updateTitle();
-        getText_parseText().setText(timePeriod.toString());
-
-    }
+//
+//    /**
+//     * <p>
+//     * Setter for the field <code>timePeriod</code>.
+//     * </p>
+//     *
+//     * @param timePeriod
+//     *            a {@link eu.etaxonomy.cdm.model.common.TimePeriod} object.
+//     */
+//
+//    public void setEntity(VerbatimTimePeriod timePeriod) {
+//        setEntityInternally(timePeriod);
+//        updateTitle();
+//        getText_parseText().setText(timePeriod.toString());
+//
+//    }
     
     @Override
     protected void handleEvent(Object eventSource) {
@@ -81,7 +87,7 @@ public class VerbatimDateDetailSection extends DateDetailSectionBase<VerbatimTim
             if(entity instanceof VerbatimTimePeriod){
                 ((VerbatimTimePeriod)entity).setVerbatimDate(text_VerbatimDate.getText());
             }else{
-                VerbatimTimePeriod newEntity = VerbatimTimePeriod.NewVerbatimInstance();
+                VerbatimTimePeriod newEntity = newInstance();
                 newEntity.setEnd(entity.getEnd());
                 newEntity.setStart(entity.getStart());
                 newEntity.setFreeText(entity.getFreeText());
@@ -102,7 +108,7 @@ public class VerbatimDateDetailSection extends DateDetailSectionBase<VerbatimTim
         super.setEntityInternally(timePeriod);
         ((Text) text_VerbatimDate.getMainControl()).setSelection(super.getCursorPosition());
         text_VerbatimDate.setText(timePeriod.getVerbatimDate());
-        super.setEntity(timePeriod);
+//        super.setEntity(timePeriod);
     }
 
 }
