import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.common.TimePeriod;
import eu.etaxonomy.cdm.model.description.DescriptionElementSource;
import eu.etaxonomy.cdm.model.reference.INomenclaturalReference;
import eu.etaxonomy.cdm.model.reference.NamedSourceBase;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
+import eu.etaxonomy.taxeditor.ui.element.TimePeriodElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
import eu.etaxonomy.taxeditor.ui.section.common.ExternalLinksSection;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
protected EntitySelectionElement<Reference> selection_Ref;
protected TextWithLabelElement microReference;
+ protected TimePeriodElement accessed;
protected OriginalSourceAdvancedSection advancedSection;
protected String label = "Source";
protected CdmBase cdmEntity;
for (ICdmFormElement element: selection_Ref.getElements()){
element.setBackground(getPersistentBackground());
}
+
+ //TODO preliminary #10057
+ if (entity != null && entity.getCitation() != null && entity.getCitation().isDynamic()){
+ TimePeriod acc =entity.getAccessed(); // (entity != null? entity.getAccessed(): null);
+ accessed = formFactory.createTimePeriodElement(formElement, "Accessed", acc, style);
+ }
+
externalLinks = formFactory.createExternalLinksSection(getConversationHolder(), formElement, "Link(s)", StoreUtil.getSectionStyle(ExternalLinksSection.class, DescriptionElementSource.class.getCanonicalName()));
externalLinks.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 3));
externalLinks.setEntity(HibernateProxyHelper.deproxy(entity));
getEntity().setCitation(selection_Ref.getEntity());
}else if (eventSource.equals(microReference)){
getEntity().setCitationMicroReference(microReference.getText());
+ }else if(eventSource == accessed){
+ getEntity().setAccessed(accessed.getTimePeriod());
}
}
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.common.TimePeriod;
import eu.etaxonomy.cdm.model.description.DescriptionElementSource;
import eu.etaxonomy.cdm.model.name.TaxonName;
import eu.etaxonomy.cdm.model.reference.NamedSourceBase;
microReference = formFactory.createTextWithLabelElement(formElement, "Detail", getEntity() != null? getEntity().getCitationMicroReference(): "", style);
+ //TODO preliminary #10057
+ if (entity != null && entity.getCitation() != null && entity.getCitation().isDynamic()){
+ TimePeriod acc =entity.getAccessed(); // (entity != null? entity.getAccessed(): null);
+ accessed = formFactory.createTimePeriodElement(formElement, "Accessed", acc, style);
+ }
+
Label sep = formFactory.createLabel(formElement.getLayoutComposite(), "");
sep.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
if (this.cdmEntity instanceof Taxon){
import eu.etaxonomy.cdm.common.CdmUtils;
import eu.etaxonomy.cdm.model.common.CdmBase;
import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
+import eu.etaxonomy.cdm.model.common.TimePeriod;
import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
import eu.etaxonomy.cdm.model.reference.ICdmTarget;
import eu.etaxonomy.cdm.model.reference.OriginalSourceBase;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator;
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
+import eu.etaxonomy.taxeditor.ui.element.TimePeriodElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
import eu.etaxonomy.taxeditor.ui.section.common.ExternalLinksSection;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
protected boolean isCommonNameReference = false;
protected EntitySelectionElement<Reference> selection_reference;
protected TextWithLabelElement text_referenceDetail;
+ protected TimePeriodElement accessed;
protected EnumComboElement<OriginalSourceType> combo_origsourcetype;
protected TextWithLabelElement text_idInSource;
protected TextWithLabelElement text_idNamespace;
text_referenceDetail = formFactory.createTextWithLabelElement(
formElement, "Reference Detail", null, SWT.NULL);
+ //TODO preliminary #10057
+ if (entity != null && entity.getCitation() != null && entity.getCitation().isDynamic()){
+ TimePeriod acc =entity.getAccessed(); // (entity != null? entity.getAccessed(): null);
+ accessed = formFactory.createTimePeriodElement(formElement, "Accessed", acc, style);
+ }
+
combo_origsourcetype = formFactory
.createEnumComboElement(OriginalSourceType.class,
formElement, new OriginalSourceTypeComparator(getEntity()), style, false);
else if(eventSource == combo_origsourcetype){
getEntity().setType(combo_origsourcetype.getSelection());
}
+ else if(eventSource == accessed){
+ getEntity().setAccessed(accessed.getTimePeriod());
+ }
}
}
\ No newline at end of file