- implemented differentiation of the three image types (Artwork, Living Plant Photo...
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / section / occurrence / media / MediaSpecimenGeneralDetailSection.java
index 58ba06e33177c12f427325c74b729b23520231fe..b4da945659ff12b50d6ca930daaea5e924f1a99b 100644 (file)
@@ -17,6 +17,7 @@ import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
+import eu.etaxonomy.taxeditor.view.derivateSearch.DerivateLabelProvider;
 
 /**
  * @author pplitzner
@@ -47,6 +48,31 @@ public class MediaSpecimenGeneralDetailSection  extends AbstractCdmDetailSection
         return "General Media Specimen";
     }
 
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.forms.widgets.ExpandableComposite#setText(java.lang.String)
+     */
+    @Override
+    public void setText(String title) {
+        String text = null;
+        if(getEntity()!=null && getEntity().getKindOfUnit()!=null){
+            if(getEntity().getKindOfUnit().equals(DerivateLabelProvider.getArtworkTerm())){
+                text = "Artwork";
+            }
+            else if(getEntity().getKindOfUnit().equals(DerivateLabelProvider.getLivingPlantPhotoTerm())){
+                text = "Living Plant Photo";
+            }
+            else if(getEntity().getKindOfUnit().equals(DerivateLabelProvider.getSpecimenScanTerm())){
+                text = "Specimen Scan";
+            }
+        }
+        if(text!=null){
+            super.setText(text);
+        }
+        else{
+            super.setText(title);
+        }
+    }
+
     /* (non-Javadoc)
      * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
      */