import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.TissueSampleGeneralDetailSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.media.MediaSpecimenGeneralDetailElement;
import eu.etaxonomy.taxeditor.ui.section.occurrence.media.MediaSpecimenGeneralDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.reference.AdvancedNomenclaturalSourceElement;
import eu.etaxonomy.taxeditor.ui.section.reference.AdvancedSourceElement;
import eu.etaxonomy.taxeditor.ui.section.reference.NomenclaturalReferenceDetailElement;
import eu.etaxonomy.taxeditor.ui.section.reference.NomenclaturalReferenceDetailSection;
return element;
}
+ public AdvancedSourceElement createAdvancedNomenclaturalSourceDetailElement(ICdmFormElement parentElement, int style){
+ AdvancedNomenclaturalSourceElement element = new AdvancedNomenclaturalSourceElement(this, parentElement);
+ addAndAdaptElement(parentElement, element);
+ return element;
+ }
+
public SingleSourceSection createSingleSourceSection(ConversationHolder conversation, ICdmFormElement parentElement, CdmBase cdmEntity, ISelectionProvider selectionProvider, String label, int style){
SingleSourceSection section = new SingleSourceSection(this, conversation, parentElement, cdmEntity, selectionProvider, style, label);
addAndAdaptSection(parentElement, section);
--- /dev/null
+/**
+* Copyright (C) 2020 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.ui.section.reference;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+
+import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
+import eu.etaxonomy.cdm.model.reference.OriginalSourceBase;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+
+/**
+ * @author k.luther
+ * @since Nov 12, 2020
+ */
+public class AdvancedNomenclaturalSourceElement extends AdvancedSourceElement {
+
+ /**
+ * @param formFactory
+ * @param formElement
+ */
+ public AdvancedNomenclaturalSourceElement(CdmFormFactory formFactory, ICdmFormElement formElement) {
+ super(formFactory, formElement);
+ // TODO Auto-generated constructor stub
+ }
+
+ @Override
+ protected void createControls(ICdmFormElement formElement, OriginalSourceBase entity, int style) {
+ Display display = Display.getCurrent();
+ Color background = display.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND);
+
+
+ if (PreferencesUtil.getBooleanValue(PreferencePredicate.ShowNamespaceInSource.getKey())){
+ text_idNamespace = formFactory.createTextWithLabelElement(formElement, "ID Namespace", entity != null?entity.getIdNamespace():null, style);
+ text_idNamespace.setBackground(background);
+ }
+ if (PreferencesUtil.getBooleanValue(PreferencePredicate.ShowIdInSource.getKey())){
+ text_idInSource = formFactory.createTextWithLabelElement(formElement, "ID in Source", entity != null?entity.getIdInSource():null, style);
+ text_idInSource.setBackground(background);
+
+ }
+
+ text_originaleNameString = formFactory.createTextWithLabelElement(
+ formElement, "Original Information", entity != null?entity.getOriginalNameString():null, SWT.NULL);
+
+ text_originaleNameString.setBackground(background);
+ Label label = formFactory.createEmptyCell(getLayoutComposite());
+ }
+
+}
*/
package eu.etaxonomy.taxeditor.ui.section.reference;
-import org.eclipse.swt.SWT;
+import org.eclipse.ui.forms.widgets.TableWrapData;
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.metadata.PreferencePredicate;
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.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.store.StoreUtil;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
protected EntitySelectionElement<Reference> selection_Ref;
protected TextWithLabelElement microReference;
-// protected OriginalSourceAdvancedSection advancedSection;
+ protected OriginalSourceAdvancedSection advancedSection;
protected String label = "Source";
protected CdmBase cdmEntity;
for (ICdmFormElement element: selection_NomRef.getElements()){
element.setBackground(getPersistentBackground());
}
- if (entity instanceof DescriptionElementSource){
- select_nameUsedInSource = formFactory.createSelectionElement(TaxonName.class, formElement, "Original spelling", entity != null? ((DescriptionElementSource)entity).getNameUsedInSource(): null, EntitySelectionElement.ALL, style);
- }
- if (PreferencesUtil.getBooleanValue(PreferencePredicate.ShowNamespaceInSource.getKey())){
- text_idNamespace = formFactory.createTextWithLabelElement(formElement, "ID Namespace", entity != null?entity.getIdNamespace():null, style);
- }
- if (PreferencesUtil.getBooleanValue(PreferencePredicate.ShowIdInSource.getKey())){
- text_idInSource = formFactory.createTextWithLabelElement(formElement, "ID in Source", entity != null?entity.getIdInSource():null, style);
- }
+ select_nameUsedInSource = formFactory.createSelectionElement(TaxonName.class, formElement, "Original spelling", entity != null? ((DescriptionElementSource)entity).getNameUsedInSource(): null, EntitySelectionElement.ALL, style);
+
- text_originaleNameString = formFactory.createTextWithLabelElement(
- formElement, "Original Information", entity != null?entity.getOriginalNameString():null, SWT.NULL);
+// if (PreferencesUtil.getBooleanValue(PreferencePredicate.ShowNamespaceInSource.getKey())){
+// text_idNamespace = formFactory.createTextWithLabelElement(formElement, "ID Namespace", entity != null?entity.getIdNamespace():null, style);
+// }
+// if (PreferencesUtil.getBooleanValue(PreferencePredicate.ShowIdInSource.getKey())){
+// text_idInSource = formFactory.createTextWithLabelElement(formElement, "ID in Source", entity != null?entity.getIdInSource():null, style);
+// }
+//
+// text_originaleNameString = formFactory.createTextWithLabelElement(
+// formElement, "Original Information", entity != null?entity.getOriginalNameString():null, SWT.NULL);
externalLinks = formFactory.createExternalLinksSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(ExternalLinksSection.class, DescriptionElementSource.class.getCanonicalName()));
externalLinks.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 3));
addControl(externalLinks);
addElement(externalLinks);
+
+ advancedSection = formFactory.createOriginalSourceAdvancedSection(getConversationHolder(), formElement, null, StoreUtil.getSectionStyle(OriginalSourceAdvancedSection.class, INomenclaturalReference.class.getCanonicalName()));
+ TableWrapData layoutData = LayoutConstants.FILL_HORIZONTALLY(2, 1);
+ layoutData.indent = 10;
+
+
+ advancedSection.setLayoutData(layoutData);
+ advancedSection.setBackground(this.getPersistentBackground());
+ advancedSection.setEntity(entity);
+ addControl(advancedSection);
+ addElement(advancedSection);
+
this.getLayoutComposite().layout();
}