import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
import eu.etaxonomy.cdm.model.common.CdmBase;
import eu.etaxonomy.cdm.model.description.DescriptionElementSource;
+import eu.etaxonomy.cdm.model.name.NomenclaturalSource;
import eu.etaxonomy.cdm.model.name.TaxonName;
import eu.etaxonomy.cdm.model.reference.INomenclaturalReference;
-import eu.etaxonomy.cdm.model.reference.OriginalSourceBase;
import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.preference.Resources;
* @author k.luther
* @since Nov 11, 2020
*/
-public class NomenclaturalSourceElement extends OriginalSourceElement {
+public class NomenclaturalSourceElement extends OriginalSourceElement<NomenclaturalSource> {
private EntitySelectionElementWithAbbreviatedTitle<Reference> selection_NomRef;
protected String label = "Source";
}
@Override
- protected void createControls(ICdmFormElement formElement, OriginalSourceBase entity, int style) {
+ protected void createControls(ICdmFormElement formElement, NomenclaturalSource entity, int style) {
entity = HibernateProxyHelper.deproxy(entity);
Label sep = formFactory.createLabel(formElement.getLayoutComposite(), "");
sep.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
- select_nameUsedInSource = formFactory.createSelectionElement(TaxonName.class, formElement, "Original Spelling", entity != null? ((DescriptionElementSource)entity).getNameUsedInSource(): null, EntitySelectionElement.ALL, style);
+ select_nameUsedInSource = formFactory.createSelectionElement(TaxonName.class, formElement, "Original Spelling", entity != null? entity.getNameUsedInSource(): null, EntitySelectionElement.ALL, style);
externalLinks = formFactory.createExternalLinksSection(getConversationHolder(), formElement, "Protologue/Original Publication", StoreUtil.getSectionStyle(ExternalLinksSection.class, DescriptionElementSource.class.getCanonicalName()));
externalLinks.setEmptySectionString("No protologue yet.");
getEntity().setCitationMicroReference(microReference.getText());
}
if (eventSource.equals(select_nameUsedInSource)){
- ((DescriptionElementSource)getEntity()).setNameUsedInSource(select_nameUsedInSource.getEntity());
+ (getEntity()).setNameUsedInSource(select_nameUsedInSource.getEntity());
}
super.handleEvent(eventSource);
}
* @author k.luther
* @since Jul 1, 2020
*/
-public class OriginalSourceElement extends AbstractCdmDetailElement<OriginalSourceBase> implements IPropertyChangeListener{
+public class OriginalSourceElement<T extends OriginalSourceBase>
+ extends AbstractCdmDetailElement<T>
+ implements IPropertyChangeListener{
protected EntitySelectionElement<Reference> selection_Ref;
protected TextWithLabelElement microReference;
}
@Override
- protected void createControls(ICdmFormElement formElement, OriginalSourceBase entity, int style) {
+ protected void createControls(ICdmFormElement formElement, T entity, int style) {
selection_Ref = formFactory.createSelectionElement(Reference.class,
formElement, label, null,