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
.swt
.SWT
;
12 import org
.eclipse
.swt
.graphics
.Color
;
13 import org
.eclipse
.swt
.widgets
.Display
;
14 import org
.eclipse
.swt
.widgets
.Label
;
16 import eu
.etaxonomy
.cdm
.model
.metadata
.PreferencePredicate
;
17 import eu
.etaxonomy
.cdm
.model
.reference
.OriginalSourceBase
;
18 import eu
.etaxonomy
.taxeditor
.preference
.PreferencesUtil
;
19 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
20 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
26 public class AdvancedNomenclaturalSourceElement
extends AdvancedSourceElement
{
32 public AdvancedNomenclaturalSourceElement(CdmFormFactory formFactory
, ICdmFormElement formElement
) {
33 super(formFactory
, formElement
);
34 // TODO Auto-generated constructor stub
38 protected void createControls(ICdmFormElement formElement
, OriginalSourceBase entity
, int style
) {
39 Display display
= Display
.getCurrent();
40 Color background
= display
.getSystemColor(SWT
.COLOR_WIDGET_BACKGROUND
);
41 text_originaleNameString
= formFactory
.createTextWithLabelElement(
42 formElement
, "Original Information", entity
!= null?entity
.getOriginalNameString():null, SWT
.NULL
);
44 text_originaleNameString
.setBackground(background
);
46 if (PreferencesUtil
.getBooleanValue(PreferencePredicate
.ShowNamespaceInSource
.getKey())){
47 text_idNamespace
= formFactory
.createTextWithLabelElement(formElement
, "ID Namespace", entity
!= null?entity
.getIdNamespace():null, style
);
48 text_idNamespace
.setBackground(background
);
50 if (PreferencesUtil
.getBooleanValue(PreferencePredicate
.ShowIdInSource
.getKey())){
51 text_idInSource
= formFactory
.createTextWithLabelElement(formElement
, "ID in Source", entity
!= null?entity
.getIdInSource():null, style
);
52 text_idInSource
.setBackground(background
);
55 Label label
= formFactory
.createEmptyCell(getLayoutComposite());