import org.eclipse.jface.viewers.ColumnLabelProvider;
import org.eclipse.jface.viewers.TreeNode;
import org.eclipse.swt.graphics.Image;
+import org.hibernate.LazyInitializationException;
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.common.DefinedTerm;
import eu.etaxonomy.cdm.model.molecular.DnaSample;
import eu.etaxonomy.cdm.model.molecular.Sequence;
import eu.etaxonomy.taxeditor.store.CdmStore;
/**
- * Label provider for the views to show {@link SpecimenOrObservationBase}s.
+ * Label provider for the views to show {@link SpecimenOrObservationBase}s.<br>
+ * <br>
+ * <b>Note:</b> If you use this label provider you need to assure that you
+ * created a {@link ConversationHolder} resp. have an open session because
+ * the labels are generated from various fields of the derivate hierarchy which
+ * are lazy loaded and could therefore throw a {@link LazyInitializationException}.
*/
public class DerivateLabelProvider extends ColumnLabelProvider {
if(gatheringEvent!=null){
label += gatheringEvent.getCountry()!=null?gatheringEvent.getCountry().getLabel()+", ":"";
label += gatheringEvent.getLocality()!=null?gatheringEvent.getLocality().getText()+", ":"";
-// label += gatheringEvent.getGatheringDate()!=null?gatheringEvent.getGatheringDate()+", ":"";
+ label += gatheringEvent.getGatheringDate()!=null?gatheringEvent.getGatheringDate()+", ":"";
label += gatheringEvent.getCollector()!=null?gatheringEvent.getCollector()+", ":"";
}
label += fieldUnit.getFieldNumber()!=null?fieldUnit.getFieldNumber():"";
label += derivedUnit.getBarcode()!=null?derivedUnit.getBarcode():"";
}
else if(derivedUnit.getRecordBasis()==SpecimenOrObservationType.TissueSample){
-
+// kindofTissue + SampleDesignation
}
}
else if(element instanceof MediaSpecimen){