+ if (isCommonNameReference && PreferencesUtil.getFilterCommonNameReferences()){
+ selection_reference = formFactory
+ .createCommonNameReferenceSelectionElement(formElement, "Reference",
+ null, EntitySelectionElement.ALL, style);
+ }else{
+ selection_reference = formFactory
+ .createSelectionElement(Reference.class,
+ formElement, "Reference",
+ null, EntitySelectionElement.ALL, style);
+ }
+
+ 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);
+
+ if (PreferencesUtil.getBooleanValue(PreferencePredicate.ShowIdInSource.getKey())){
+ text_idInSource = formFactory.createTextWithLabelElement(formElement, "ID in Source", null, style);
+ }
+ if (PreferencesUtil.getBooleanValue(PreferencePredicate.ShowNamespaceInSource.getKey())){
+ text_idNamespace = formFactory.createTextWithLabelElement(formElement, "ID Namespace", null, style);
+ }
+ text_originalInfo = formFactory.createTextWithLabelElement(
+ formElement, "Original Information", null, SWT.NULL);
+
+ //we only show the cdm source if it exist.
+ //It can't be set during editing as it is read only.
+ if (this.entity != null && this.entity.getCdmSource() != null) {
+ text_cdmsource = formFactory.createTextWithLabelElement(
+ formElement, "CDM Source", null, SWT.NULL);
+ ((Text) text_cdmsource.getMainControl()).setEditable(false);
+ }
+
+ if (entity != null){
+ selection_reference.setEntity(entity.getCitation());
+ text_referenceDetail.setText(entity.getCitationMicroReference());
+ text_originalInfo.setText(entity.getOriginalInfo());
+
+ ICdmTarget cdmSource = entity.getCdmSource();
+ if (cdmSource != null){
+ String source = "";
+ if(cdmSource instanceof IdentifiableEntity) {
+ source = ((IdentifiableEntity) cdmSource).getTitleCache();
+ } else if(cdmSource instanceof CdmBase) {
+ source += CdmUtils.isNotBlank(source)?"\nUUID: ":"";
+ source += ((CdmBase) cdmSource).getUuid().toString();
+ } else {
+ source = cdmSource.toString();
+ }
+ text_cdmsource.setText(source);
+ }
+ if (externalLinks != null){
+ externalLinks.setEntity(entity);
+ }
+ }