commit 460cc14923f524b0e1267d824792507e6976fca6
Author: Katja Luther <k.luther@bgbm.org>
Date:   Mon May 14 11:00:06 2018 +0200

    adapt taxeditor to mediaCreated as timePeriod

diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaMetaElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaMetaElement.java
index 309a7c60b..696bd084b 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaMetaElement.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaMetaElement.java
@@ -10,13 +10,13 @@ import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.widgets.Button;
-import org.joda.time.DateTime;
 
 import eu.etaxonomy.cdm.common.CdmUtils;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.agent.AgentBase;
 import eu.etaxonomy.cdm.model.common.Language;
 import eu.etaxonomy.cdm.model.common.LanguageString;
+import eu.etaxonomy.cdm.model.common.TimePeriod;
 import eu.etaxonomy.cdm.model.media.Media;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.ImageResources;
@@ -28,7 +28,7 @@ import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.ISelectableElement;
 import eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement;
 import eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator;
-import eu.etaxonomy.taxeditor.ui.mvc.element.DateElement;
+import eu.etaxonomy.taxeditor.ui.element.TimePeriodElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
 import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
@@ -44,7 +44,7 @@ public class MediaMetaElement extends AbstractEntityCollectionElement<Media> imp
     private LanguageStringWithLabelElement text_description;
     private LanguageStringWithLabelElement text_title;
     private MediaDetailElement mediaDetailElement;
-    private DateElement mediaCreated;
+    private TimePeriodElement mediaCreated;
     private SelectionArbitrator selectionArbitrator;
 
     public MediaMetaElement(CdmFormFactory cdmFormFactory,
@@ -77,8 +77,8 @@ public class MediaMetaElement extends AbstractEntityCollectionElement<Media> imp
                 element, "Artist", null, EntitySelectionElement.ALL, style);
         addElement(selection_artist);
 
-        mediaCreated = formFactory.createDateElement(element, "Media Created", getEntity().getMediaCreated(), style, false);
-        addElement(mediaCreated.getController());
+        mediaCreated = formFactory.createTimePeriodElement(element, "Media Created", getEntity().getMediaCreated(), style);
+        addElement(mediaCreated);
         text_description = formFactory.createLanguageStringWithLabelElement(element, "Description", null, 100, true, style);
 
 
@@ -142,8 +142,8 @@ public class MediaMetaElement extends AbstractEntityCollectionElement<Media> imp
             if (getParentElement() instanceof AbstractCdmDetailSection) {
                 ((AbstractCdmDetailSection<?>) getParentElement()).updateTitle();
             }
-        } else if (eventSource == mediaCreated.getController()){
-        	DateTime date = mediaCreated.getController().getDateTime();
+        } else if (eventSource == mediaCreated){
+        	TimePeriod date = mediaCreated.getTimePeriod();
         	getEntity().setMediaCreated(date);
         }
     }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/media/MediaSpecimenGeneralDetailElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/media/MediaSpecimenGeneralDetailElement.java
index 7aa779db3..1719f78e5 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/media/MediaSpecimenGeneralDetailElement.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/media/MediaSpecimenGeneralDetailElement.java
@@ -8,8 +8,6 @@
  */
 package eu.etaxonomy.taxeditor.ui.section.occurrence.media;
 
-import org.joda.time.DateTime;
-
 import eu.etaxonomy.cdm.api.service.IVocabularyService;
 import eu.etaxonomy.cdm.model.agent.AgentBase;
 import eu.etaxonomy.cdm.model.common.DefinedTerm;
@@ -30,7 +28,7 @@ import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement;
 import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
-import eu.etaxonomy.taxeditor.ui.mvc.element.DateElement;
+import eu.etaxonomy.taxeditor.ui.element.TimePeriodElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.media.ITogglableMediaElement;
 import eu.etaxonomy.taxeditor.ui.section.media.MediaDetailElement;
@@ -48,7 +46,7 @@ public class MediaSpecimenGeneralDetailElement extends AbstractCdmDetailElement<
     private TermComboElement<DefinedTerm> comboKindOfUnit;
     private LanguageStringWithLabelElement textTitleLanguageString;
     private EntitySelectionElement<AgentBase> selectionArtist;
-    private DateElement date;
+    private TimePeriodElement date;
     private LanguageStringWithLabelElement textMethodLanguageString;
     private EntitySelectionElement<Collection> selection_collection;
     private TextWithLabelElement text_accessionNumber;
@@ -77,7 +75,7 @@ public class MediaSpecimenGeneralDetailElement extends AbstractCdmDetailElement<
                     formElement, "Prepared by", media.getArtist(), EntitySelectionElement.ALL, style);
             TimePeriod mediaCreated = entity.getMediaSpecimen().getMediaCreated();
 
-            date = formFactory.createDateElement(formElement, "Preparation Date", mediaCreated, style, true);
+            date = formFactory.createTimePeriodElement(formElement, "Preparation Date", mediaCreated, style);
             textMethodLanguageString = formFactory.createLanguageStringWithLabelElement(formElement, "Method", media.getDescription(Language.getDefaultLanguage()), style);
             selection_collection = formFactory.createSelectionElement(Collection.class,// getConversationHolder(),
                     formElement, "Collection", entity.getCollection(), EntitySelectionElement.ALL, style);
@@ -113,8 +111,8 @@ public class MediaSpecimenGeneralDetailElement extends AbstractCdmDetailElement<
         else if(eventSource==textTitleLanguageString){
             media.putTitle(textTitleLanguageString.getLanguageString());
         }
-        else if(eventSource==date.getController()){
-            DateTime dateTime = date.getController().getDateTime();
+        else if(eventSource==date){
+            TimePeriod dateTime = date.getTimePeriod();
             media.setMediaCreated(dateTime);
         }
         else if(eventSource==selectionArtist){
