2 * Copyright (C) 2020 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
9 package eu
.etaxonomy
.taxeditor
.ui
.section
.reference
;
11 import org
.eclipse
.jface
.viewers
.ISelectionProvider
;
12 import org
.eclipse
.ui
.forms
.widgets
.TableWrapLayout
;
14 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
15 import eu
.etaxonomy
.cdm
.model
.reference
.OriginalSourceBase
;
16 import eu
.etaxonomy
.taxeditor
.l10n
.Messages
;
17 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
18 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
19 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailElement
;
20 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailSection
;
26 public class OriginalSourceAdvancedSection
extends AbstractCdmDetailSection
<OriginalSourceBase
> {
28 public OriginalSourceAdvancedSection(CdmFormFactory formFactory
, ConversationHolder conversation
,
29 ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
30 super(formFactory
, conversation
, parentElement
, selectionProvider
, style
);
34 protected AbstractCdmDetailElement
<OriginalSourceBase
> createCdmDetailElement(
35 AbstractCdmDetailSection
<OriginalSourceBase
> parentElement
, int style
) {
37 if (parentElement
.getParentElement() instanceof NomenclaturalSourceElement
){
38 return getFormFactory().createAdvancedNomenclaturalSourceDetailElement(parentElement
, style
);
40 return getFormFactory().createAdvancedSourceDetailElement(parentElement
, style
);
44 public String
getHeading() {
46 return Messages
.OriginalSourceAdvancedSection_advanced
;
49 protected void createControlsByType(AbstractCdmDetailSection
<OriginalSourceBase
> formElement
, Class
<OriginalSourceBase
> entityClass
, int style
) {
50 super.createControlsByType(formElement
, entityClass
, style
);
51 int i
= this.getTextClientHeightDifference();
53 TableWrapLayout layout
= new TableWrapLayout();
55 layout
.bottomMargin
= 0;
56 layout
.numColumns
= DEFAULT_NUM_COLUMNS
;
57 getLayoutComposite().setLayout(layout
);
63 // protected ExternalLinksSection getExternalLinksElement(){
64 // return ((AdvancedSourceElement)this.getDetailElement()).getExternalLinks();