2 * Copyright (C) 2007 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
.element
;
11 import java
.util
.ArrayList
;
12 import java
.util
.Comparator
;
13 import java
.util
.HashSet
;
14 import java
.util
.List
;
18 import javax
.inject
.Inject
;
20 import org
.eclipse
.e4
.core
.contexts
.IEclipseContext
;
21 import org
.eclipse
.jface
.util
.IPropertyChangeListener
;
22 import org
.eclipse
.jface
.viewers
.ISelection
;
23 import org
.eclipse
.jface
.viewers
.ISelectionProvider
;
24 import org
.eclipse
.jface
.window
.Window
;
25 //import org.eclipse.nebula.widgets.richtext.RichTextEditor;
26 import org
.eclipse
.swt
.SWT
;
27 import org
.eclipse
.swt
.custom
.StyledText
;
28 import org
.eclipse
.swt
.events
.FocusAdapter
;
29 import org
.eclipse
.swt
.events
.FocusEvent
;
30 import org
.eclipse
.swt
.events
.FocusListener
;
31 import org
.eclipse
.swt
.events
.MouseAdapter
;
32 import org
.eclipse
.swt
.events
.MouseEvent
;
33 import org
.eclipse
.swt
.events
.MouseListener
;
34 import org
.eclipse
.swt
.events
.SelectionEvent
;
35 import org
.eclipse
.swt
.events
.SelectionListener
;
36 import org
.eclipse
.swt
.events
.TypedEvent
;
37 import org
.eclipse
.swt
.graphics
.Color
;
38 import org
.eclipse
.swt
.graphics
.Font
;
39 import org
.eclipse
.swt
.widgets
.Composite
;
40 import org
.eclipse
.swt
.widgets
.Control
;
41 import org
.eclipse
.swt
.widgets
.Display
;
42 import org
.eclipse
.swt
.widgets
.Event
;
43 import org
.eclipse
.swt
.widgets
.Label
;
44 import org
.eclipse
.ui
.forms
.IFormColors
;
45 import org
.eclipse
.ui
.forms
.events
.ExpansionAdapter
;
46 import org
.eclipse
.ui
.forms
.events
.ExpansionEvent
;
47 import org
.eclipse
.ui
.forms
.widgets
.ExpandableComposite
;
48 import org
.eclipse
.ui
.forms
.widgets
.FormToolkit
;
49 import org
.eclipse
.ui
.forms
.widgets
.Section
;
50 import org
.eclipse
.ui
.forms
.widgets
.TableWrapData
;
51 import org
.eclipse
.ui
.internal
.forms
.widgets
.FormFonts
;
52 import org
.joda
.time
.DateTime
;
53 import org
.joda
.time
.Partial
;
54 import org
.springframework
.security
.core
.GrantedAuthority
;
56 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
57 import eu
.etaxonomy
.cdm
.api
.facade
.DerivedUnitFacade
;
58 import eu
.etaxonomy
.cdm
.common
.DOI
;
59 import eu
.etaxonomy
.cdm
.common
.URI
;
60 import eu
.etaxonomy
.cdm
.hibernate
.HibernateProxyHelper
;
61 import eu
.etaxonomy
.cdm
.model
.agent
.AgentBase
;
62 import eu
.etaxonomy
.cdm
.model
.agent
.ORCID
;
63 import eu
.etaxonomy
.cdm
.model
.agent
.Person
;
64 import eu
.etaxonomy
.cdm
.model
.agent
.Team
;
65 import eu
.etaxonomy
.cdm
.model
.common
.Annotation
;
66 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
67 import eu
.etaxonomy
.cdm
.model
.common
.Credit
;
68 import eu
.etaxonomy
.cdm
.model
.common
.ExtendedTimePeriod
;
69 import eu
.etaxonomy
.cdm
.model
.common
.Extension
;
70 import eu
.etaxonomy
.cdm
.model
.common
.IdentifiableSource
;
71 import eu
.etaxonomy
.cdm
.model
.common
.Identifier
;
72 import eu
.etaxonomy
.cdm
.model
.common
.LSID
;
73 import eu
.etaxonomy
.cdm
.model
.common
.Language
;
74 import eu
.etaxonomy
.cdm
.model
.common
.LanguageString
;
75 import eu
.etaxonomy
.cdm
.model
.common
.Marker
;
76 import eu
.etaxonomy
.cdm
.model
.common
.TimePeriod
;
77 import eu
.etaxonomy
.cdm
.model
.common
.VerbatimTimePeriod
;
78 import eu
.etaxonomy
.cdm
.model
.common
.VersionableEntity
;
79 import eu
.etaxonomy
.cdm
.model
.description
.CategoricalData
;
80 import eu
.etaxonomy
.cdm
.model
.description
.CommonTaxonName
;
81 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionElementBase
;
82 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionElementSource
;
83 import eu
.etaxonomy
.cdm
.model
.description
.Distribution
;
84 import eu
.etaxonomy
.cdm
.model
.description
.Feature
;
85 import eu
.etaxonomy
.cdm
.model
.description
.FeatureState
;
86 import eu
.etaxonomy
.cdm
.model
.description
.IndividualsAssociation
;
87 import eu
.etaxonomy
.cdm
.model
.description
.KeyStatement
;
88 import eu
.etaxonomy
.cdm
.model
.description
.MeasurementUnit
;
89 import eu
.etaxonomy
.cdm
.model
.description
.PresenceAbsenceTerm
;
90 import eu
.etaxonomy
.cdm
.model
.description
.QuantitativeData
;
91 import eu
.etaxonomy
.cdm
.model
.description
.State
;
92 import eu
.etaxonomy
.cdm
.model
.description
.StateData
;
93 import eu
.etaxonomy
.cdm
.model
.description
.StatisticalMeasure
;
94 import eu
.etaxonomy
.cdm
.model
.description
.StatisticalMeasurementValue
;
95 import eu
.etaxonomy
.cdm
.model
.description
.TaxonInteraction
;
96 import eu
.etaxonomy
.cdm
.model
.description
.TemporalData
;
97 import eu
.etaxonomy
.cdm
.model
.description
.TextData
;
98 import eu
.etaxonomy
.cdm
.model
.location
.NamedArea
;
99 import eu
.etaxonomy
.cdm
.model
.location
.NamedAreaLevel
;
100 import eu
.etaxonomy
.cdm
.model
.location
.Point
;
101 import eu
.etaxonomy
.cdm
.model
.media
.ExternalLink
;
102 import eu
.etaxonomy
.cdm
.model
.media
.ImageFile
;
103 import eu
.etaxonomy
.cdm
.model
.media
.Media
;
104 import eu
.etaxonomy
.cdm
.model
.media
.MediaRepresentation
;
105 import eu
.etaxonomy
.cdm
.model
.media
.MediaRepresentationPart
;
106 import eu
.etaxonomy
.cdm
.model
.media
.Rights
;
107 import eu
.etaxonomy
.cdm
.model
.name
.NameRelationship
;
108 import eu
.etaxonomy
.cdm
.model
.name
.NameRelationshipType
;
109 import eu
.etaxonomy
.cdm
.model
.name
.NameTypeDesignation
;
110 import eu
.etaxonomy
.cdm
.model
.name
.NomenclaturalStatus
;
111 import eu
.etaxonomy
.cdm
.model
.name
.SpecimenTypeDesignation
;
112 import eu
.etaxonomy
.cdm
.model
.name
.TextualTypeDesignation
;
113 import eu
.etaxonomy
.cdm
.model
.occurrence
.DerivedUnit
;
114 import eu
.etaxonomy
.cdm
.model
.occurrence
.DeterminationEvent
;
115 import eu
.etaxonomy
.cdm
.model
.occurrence
.OccurrenceStatus
;
116 import eu
.etaxonomy
.cdm
.model
.permission
.GrantedAuthorityImpl
;
117 import eu
.etaxonomy
.cdm
.model
.permission
.Group
;
118 import eu
.etaxonomy
.cdm
.model
.permission
.User
;
119 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
120 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
121 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonNode
;
122 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonNodeAgentRelation
;
123 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonRelationshipType
;
124 import eu
.etaxonomy
.cdm
.model
.term
.DefinedTerm
;
125 import eu
.etaxonomy
.cdm
.model
.term
.DefinedTermBase
;
126 import eu
.etaxonomy
.cdm
.model
.term
.IEnumTerm
;
127 import eu
.etaxonomy
.cdm
.model
.term
.Representation
;
128 import eu
.etaxonomy
.cdm
.model
.term
.TermBase
;
129 import eu
.etaxonomy
.cdm
.model
.term
.TermTree
;
130 import eu
.etaxonomy
.cdm
.model
.term
.TermType
;
131 import eu
.etaxonomy
.cdm
.model
.term
.TermVocabulary
;
132 import eu
.etaxonomy
.cdm
.persistence
.dto
.AbstractTermDto
;
133 import eu
.etaxonomy
.cdm
.persistence
.dto
.FeatureStateDto
;
134 import eu
.etaxonomy
.cdm
.persistence
.dto
.TermDto
;
135 import eu
.etaxonomy
.cdm
.persistence
.dto
.TermVocabularyDto
;
136 import eu
.etaxonomy
.cdm
.strategy
.parser
.ParserProblem
;
137 import eu
.etaxonomy
.taxeditor
.model
.MessagingUtils
;
138 import eu
.etaxonomy
.taxeditor
.preference
.PreferencesUtil
;
139 import eu
.etaxonomy
.taxeditor
.store
.StoreUtil
;
140 import eu
.etaxonomy
.taxeditor
.ui
.combo
.EnumComboElement
;
141 import eu
.etaxonomy
.taxeditor
.ui
.combo
.InverseTermWrapper
;
142 import eu
.etaxonomy
.taxeditor
.ui
.combo
.MisappliedRelationshipComboElement
;
143 import eu
.etaxonomy
.taxeditor
.ui
.combo
.RelationshipTypeCombo
;
144 import eu
.etaxonomy
.taxeditor
.ui
.combo
.VocabularyComboElement
;
145 import eu
.etaxonomy
.taxeditor
.ui
.combo
.term
.TermComboElement
;
146 import eu
.etaxonomy
.taxeditor
.ui
.dialog
.CloneClassificationDetailElement
;
147 import eu
.etaxonomy
.taxeditor
.ui
.element
.MinMaxTextSection
.UnitType
;
148 import eu
.etaxonomy
.taxeditor
.ui
.mvc
.element
.DateElement
;
149 import eu
.etaxonomy
.taxeditor
.ui
.openurl
.IOpenUrlEnabled
;
150 import eu
.etaxonomy
.taxeditor
.ui
.openurl
.OpenUrlSelectorElement
;
151 import eu
.etaxonomy
.taxeditor
.ui
.password
.EditPasswordElement
;
152 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailElement
;
153 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailSection
;
154 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionElement
;
155 import eu
.etaxonomy
.taxeditor
.ui
.section
.EmptyElement
;
156 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.InstitutionDetailElement
;
157 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.InstitutionDetailSection
;
158 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.NomenclaturalTeamMemberElement
;
159 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailElement
;
160 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailSection
;
161 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailElement
;
162 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailSection
;
163 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamMemberElement
;
164 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamMemberSection
;
165 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamOrPersonBaseDetailSection
;
166 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.ClassificationDetailElement
;
167 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.ClassificationDetailSection
;
168 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.TaxonNodeAgentRelationCollectionElement
;
169 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.TaxonNodeAgentRelationCollectionSection
;
170 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.TaxonNodeDetailElement
;
171 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.TaxonNodeDetailSection
;
172 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ExternalLinksElement
;
173 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ExternalLinksSection
;
174 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferenceEntityDetailElement
;
175 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferencedEntityDetailSection
;
176 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.CommonNameSourceElement
;
177 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DerivedUnitElement
;
178 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescribedSpecimenSection
;
179 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailElement
;
180 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailSection
;
181 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailElement
;
182 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailSection
;
183 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementMediaSection
;
184 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceElement
;
185 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceSection
;
186 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceElement
;
187 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceSection
;
188 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.MediaDetailsSection
;
189 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ModifierElement
;
190 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ModifierSection
;
191 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageDetailElement
;
192 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageSection
;
193 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeElement
;
194 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeSection
;
195 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StateDataElement
;
196 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StateDataSection
;
197 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StatisticalMeasurementValueElement
;
198 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StatisticalMeasurementValueSection
;
199 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.AbstractDetailedDescriptionDetailElement
;
200 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.CategoricalDataDetailElement
;
201 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.CommonNameDetailElement
;
202 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.DistributionDetailElement
;
203 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.IndividualsAssociationDetailElement
;
204 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.QuantitativeDataDetailElement
;
205 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.TaxonInteractionDetailElement
;
206 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.TemporalDataDetailElement
;
207 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.TextDataDetailElement
;
208 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.CharacterDetailElement
;
209 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.CharacterDetailSection
;
210 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.CharacterDtoDetailElement
;
211 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.CharacterDtoDetailSection
;
212 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.CharacterNodeDetailElement
;
213 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.CharacterNodeDetailSection
;
214 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.CharacterNodeDtoDetailElement
;
215 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.CharacterNodeDtoDetailSection
;
216 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailElement
;
217 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailSection
;
218 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.InapplicableIfCollectionElement
;
219 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.InapplicableIfCollectionElementForDto
;
220 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.InapplicableIfEntityCollectionSection
;
221 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.InapplicableIfEntityCollectionSectionForNode
;
222 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.OnlyApplicableIfCollectionElement
;
223 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.OnlyApplicableIfCollectionElementForDto
;
224 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.OnlyApplicableIfEntityCollectionSection
;
225 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.OnlyApplicableIfEntityCollectionSectionForNode
;
226 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.TermNodeDetailElement
;
227 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.TermNodeDetailSection
;
228 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.TermTreeDetailElement
;
229 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.TermTreeDetailElementForNode
;
230 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.TermTreeDetailSection
;
231 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.TermTreeDetailSectionForNode
;
232 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityCollectionElement
;
233 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailElement
;
234 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailSection
;
235 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailElement
;
236 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailSection
;
237 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailElement
;
238 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailSection
;
239 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailElement
;
240 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailSection
;
241 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailElement
;
242 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailSection
;
243 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.ScopeRestrictionSection
;
244 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.TaxonomicScopeSection
;
245 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.ImageFileElement
;
246 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaDetailElement
;
247 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaMetaElement
;
248 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationElement
;
249 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationPartElement
;
250 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationPartSection
;
251 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationSection
;
252 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaSection
;
253 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.AuthorshipDetailElement
;
254 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.AuthorshipDetailSection
;
255 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.HybridDetailElement
;
256 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.HybridDetailSection
;
257 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameDetailElement
;
258 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameDetailSection
;
259 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailElement
;
260 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailSection
;
261 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameTypeDesignationElement
;
262 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusElement
;
263 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusSection
;
264 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailElement
;
265 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailSection
;
266 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.RuleConsideredElement
;
267 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.SpecimenTypeDesignationElement
;
268 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.TextTypeDesignationElement
;
269 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.TypeDesignationSection
;
270 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CollectingAreaDetailElement
;
271 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CollectingAreasDetailSection
;
272 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CollectionDetailElement
;
273 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CurrentDeterminationDetailSection
;
274 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitBaseDetailElement
;
275 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitBaseDetailSection
;
276 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitGeneralDetailElement
;
277 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitGeneralDetailSection
;
278 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitMediaSection
;
279 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailElement
;
280 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailSection
;
281 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationEventDetailElement
;
282 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationHistoryDetailSection
;
283 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.EmptySection
;
284 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitFacadeDetailElement
;
285 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitFacadeDetailSection
;
286 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitFacadeGeneralDetailElement
;
287 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitFacadeGeneralDetailSection
;
288 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailElement
;
289 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailSection
;
290 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GeoScopeDetailSection
;
291 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GeoScopePolyKeyDetailSection
;
292 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.OccurrenceStatusElement
;
293 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.OriginalLabelDataSection
;
294 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SourceCollectionDetailSection
;
295 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SpecimenCollectionDetailElement
;
296 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SpecimenCollectionDetailSection
;
297 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.StatusCollectionDetailSection
;
298 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.association
.DerivedUnitTypeDesignationElement
;
299 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.association
.DerivedUnitTypeDesignationSection
;
300 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.association
.TaxonAssociationDetailElement
;
301 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.association
.TaxonAssociationDetailSection
;
302 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenCurrentDeterminationDetailSection
;
303 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenDetailElement
;
304 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenDetailSection
;
305 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenGeneralDetailElement
;
306 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenGeneralDetailSection
;
307 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenSourceCollectionDetailSection
;
308 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AbstractSampleDesignationDetailSection
;
309 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationCloningDetailElement
;
310 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationCloningDetailSection
;
311 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationGelPhotoCollectionDetailSection
;
312 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationGelPhotoDetailElement
;
313 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationGeneralDetailElement
;
314 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationGeneralDetailSection
;
315 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationPrimerDetailElement
;
316 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationPrimerDetailSection
;
317 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.CurrentSampleDesignationDetailSection
;
318 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaQualityDetailElement
;
319 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaQualityDetailSection
;
320 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaSampleGeneralDetailElement
;
321 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaSampleGeneralDetailSection
;
322 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaSamplePreparationPreservationDetailElement
;
323 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaSamplePreparationPreservationSection
;
324 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.PrimerGeneralDetailElement
;
325 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SampleDesignationDetailElement
;
326 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SampleDesignationDetailSection
;
327 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SampleDesignationHistoryDetailSection
;
328 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SampleDesignationTextDetailElement
;
329 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceContigFileCollectionDetailSection
;
330 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceGeneralDetailElement
;
331 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceGeneralDetailSection
;
332 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceReferenceCollectionDetailElement
;
333 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceReferenceCollectionDetailSection
;
334 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SingleReadGeneralDetailElement
;
335 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SingleReadGeneralDetailSection
;
336 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SingleReadPherogramCollectionDetailSection
;
337 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.TissueSampleGeneralDetailElement
;
338 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.TissueSampleGeneralDetailSection
;
339 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.media
.MediaSpecimenGeneralDetailElement
;
340 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.media
.MediaSpecimenGeneralDetailSection
;
341 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.AdvancedNomenclaturalSourceElement
;
342 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.AdvancedSourceElement
;
343 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalSourceDetailElement
;
344 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalSourceDetailSection
;
345 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalSourceElement
;
346 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.OriginalSourceAdvancedSection
;
347 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.OriginalSourceElement
;
348 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailElement
;
349 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailSection
;
350 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.SecundumSourceElement
;
351 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.SingleSourceSection
;
352 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.AnnotationElement
;
353 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.AnnotationSection
;
354 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CdmBaseElement
;
355 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CdmBaseSection
;
356 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CreditElement
;
357 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CreditSection
;
358 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.ExtensionElement
;
359 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.ExtensionSection
;
360 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.HeadlineSection
;
361 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.IdentifiableSourceElement
;
362 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.MarkerElement
;
363 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.MarkerSection
;
364 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.RightsElement
;
365 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.RightsSection
;
366 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.SourceSection
;
367 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.VersionElement
;
368 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.VersionSection
;
369 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.identifier
.DerivedUnitFacadeIdentifierSection
;
370 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.identifier
.IdentifierElement
;
371 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.identifier
.IdentifierSection
;
372 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessageElement
;
373 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessagesSection
;
374 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailElement
;
375 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailSection
;
376 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonDetailElement
;
377 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonDetailSection
;
378 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonOfRelationshipElement
;
379 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailElement
;
380 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailSection
;
381 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailElement
;
382 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailSection
;
383 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailElement
;
384 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailSection
;
385 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailElement
;
386 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailSection
;
387 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.DefinedTermDetailElement
;
388 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.DefinedTermDetailSection
;
389 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.FeatureDetailElement
;
390 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.LanguageDetailElement
;
391 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.MeasurementUnitCollectionElement
;
392 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.MeasurementUnitCollectionSection
;
393 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.MeasurementUnitDtoCollectionElement
;
394 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.MeasurementUnitDtoCollectionSection
;
395 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailSection
;
396 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.PresenceAbsenceTermDetailElement
;
397 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.RecommendedModifierDtoVocabulariesElement
;
398 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.RecommendedModifierVocabulariesCollectionSection
;
399 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.RecommendedModifierVocabulariesDtoCollectionSection
;
400 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.RecommendedModifierVocabulariesElement
;
401 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.StateVocabularyCollectionElement
;
402 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.StateVocabularyCollectionSection
;
403 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.StateVocabularyDtoCollectionElement
;
404 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.StateVocabularyDtoCollectionSection
;
405 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.StatisticalMeasureCollectionElement
;
406 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.StatisticalMeasureCollectionSection
;
407 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.StatisticalMeasureDtoCollectionElement
;
408 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.StatisticalMeasureDtoCollectionSection
;
409 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermMediaSection
;
410 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailElement
;
411 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailSection
;
412 import eu
.etaxonomy
.taxeditor
.ui
.selection
.CollectorSelectionElement
;
413 import eu
.etaxonomy
.taxeditor
.ui
.selection
.CommonNameReferenceSelectionElement
;
414 import eu
.etaxonomy
.taxeditor
.ui
.selection
.EntitySelectionElement
;
415 import eu
.etaxonomy
.taxeditor
.ui
.selection
.EntitySelectionElementWithAbbreviatedTitle
;
416 import eu
.etaxonomy
.taxeditor
.ui
.selection
.EntitySelectionElementWithIdInVocabulary
;
417 import eu
.etaxonomy
.taxeditor
.ui
.selection
.TaxonNodeSelectionElement
;
418 import eu
.etaxonomy
.taxeditor
.view
.detail
.CdmSectionPart
;
421 * CdmFormFactory class.
424 * @created Feb 24, 2010
426 public class CdmFormFactory
extends FormToolkit
{
428 private BoldFontHolder2 boldFontHolder2
;
429 private MouseListener selectionMouseHandler
;
430 private FocusListener selectionFocusHandler
;
433 private IEclipseContext context
;
435 private final Set
<SelectionListener
> selectionListenerList
= new HashSet
<>();
437 private final List
<IPropertyChangeListener
> propertyChangeListeners
= new ArrayList
<>();
439 private final int orientation
= Window
.getDefaultOrientation();
440 private ISelectionProvider selectionProvider
;
442 /** Constant <code>EMPTY_SELECTION</code> */
443 public static ISelection EMPTY_SELECTION
= new ISelection() {
445 public boolean isEmpty() {
454 private class SelectionMouseHandler
extends MouseAdapter
{
456 public void mouseDown(MouseEvent e
) {
457 notifySelectionListeners(e
);
465 private class SelectionFocusHandler
extends FocusAdapter
{
467 public void focusGained(FocusEvent e
) {
468 notifySelectionListeners(e
);
472 private void notifySelectionListeners(TypedEvent e
) {
473 Event event
= new Event();
474 event
.widget
= e
.widget
;
475 SelectionEvent selectionEvent
= new SelectionEvent(event
);
477 for (SelectionListener listener
: selectionListenerList
) {
478 listener
.widgetSelected(selectionEvent
);
482 public CdmFormFactory(Display display
) {
486 public CdmFormFactory(Display display
, ISelectionProvider selectionProvider
) {
488 this.selectionProvider
= selectionProvider
;
492 private void init() {
493 boldFontHolder2
= new BoldFontHolder2();
494 selectionMouseHandler
= new SelectionMouseHandler();
495 selectionFocusHandler
= new SelectionFocusHandler();
498 public IEclipseContext
getContext() {
503 * Creates an instance initialized with the correct selectionProvider
505 * Make sure to remove the instance when the entityComposite disposes via
506 * destroySelectionArbitrator(..)
508 * @param entityElement
509 * a {@link eu.etaxonomy.taxeditor.ui.element.IEntityElement}
511 * @return a {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator}
514 public SelectionArbitrator
createSelectionArbitrator(IEntityElement entityElement
) {
515 SelectionArbitrator selectionArbitrator
= new SelectionArbitrator(entityElement
);
516 selectionArbitrator
.addSelectionProvider(selectionProvider
);
517 selectionProvider
.addSelectionChangedListener(selectionArbitrator
);
518 addSelectionListener(selectionArbitrator
);
519 return selectionArbitrator
;
524 * destroySelectionArbitrator
527 * @param selectionArbitrator
529 * {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator}
532 public void destroySelectionArbitrator(SelectionArbitrator selectionArbitrator
) {
533 if(selectionArbitrator
==null){
536 removeSelectionListener(selectionArbitrator
);
537 if (selectionProvider
!= null) {
538 selectionProvider
.removeSelectionChangedListener(selectionArbitrator
);
540 MessagingUtils
.error(this.getClass(),
541 "Tried to destroy a selection listener from this factories listeners but was null", null);
547 * Adapts the {@link AbstractCdmFormElement}:<br>
548 * - sets the {@link IPropertyChangeListener}s handled by this class
553 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement}
556 public void adapt(ICdmFormElement formElement
) {
557 formElement
.setPropertyChangeListeners(propertyChangeListeners
);
561 public void adapt(Control control
, boolean trackFocus
, boolean trackKeyboard
) {
563 control
.addFocusListener(selectionFocusHandler
);
565 super.adapt(control
, trackFocus
, trackKeyboard
);
569 public void adapt(Composite composite
) {
570 composite
.addMouseListener(selectionMouseHandler
);
572 super.adapt(composite
);
579 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
582 public void destroyElement(ICdmFormElement formElement
) {
583 // return if element was not initialized
584 if (formElement
== null) {
587 // destroy selection arbitrator, if any
588 if (formElement
instanceof ISelectableElement
) {
589 destroySelectionArbitrator(((ISelectableElement
) formElement
).getSelectionArbitrator());
591 // remove this element form its parents list of elements
592 // ICdmFormElement parentElement = formElement.getParentElement();
593 // if(parentElement != null){
594 // parentElement.removeElement(formElement);
596 // call destroy on child elements recursively
598 Set
<ICdmFormElement
> tempFormElements
= new HashSet
<>();
599 tempFormElements
.addAll(formElement
.getElements());
600 for(ICdmFormElement childElement
: tempFormElements
) {
601 destroyElement(childElement
);
603 // dispose of the controls
604 for (Control control
: formElement
.getControls()) {
605 // we added the layoutComposite of the parental element as the
606 // layout composite to this formElement
607 // but we do not want to destroy it.
608 if (control
.equals(formElement
.getLayoutComposite())) {
611 if (!control
.isDisposed()){
614 control
= null; //needed?
623 * a {@link org.eclipse.swt.widgets.Composite} object.
624 * @return a {@link org.eclipse.swt.widgets.Label} object.
626 public Label
createEmptyCell(Composite parent
) {
627 return this.createLabel(parent
, null);
631 * createMultiLanguageTextElement
633 * @param parentElement
634 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
637 * a {@link java.lang.String} object.
638 * @param multilanguageText
639 * a {@link java.util.Map} object.
645 * {@link eu.etaxonomy.taxeditor.ui.element.MultilanguageTextElement}
648 public MultilanguageTextElement
createMultiLanguageTextElement(ICdmFormElement parentElement
, String labelString
,
649 Map
<Language
, LanguageString
> multilanguageText
, int textHeight
, int style
) {
650 MultilanguageTextElement element
= new MultilanguageTextElement(this, parentElement
, labelString
,
651 multilanguageText
, textHeight
, style
);
653 parentElement
.addElement(element
);
658 * createMultiLanguageTextElement
660 * @param parentElement
661 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
664 * @param Representation
665 * a {@link eu.etaxonomy.cdm.model.term.Representation} object.
671 * {@link eu.etaxonomy.taxeditor.ui.element.RepresentationElement}
674 public RepresentationElement
createRepresentationElement(ICdmFormElement parentElement
, Representation representation
, TermBase term
,int textHeight
, int style
, boolean fillDetails
) {
675 RepresentationElement element
= new RepresentationElement(this, parentElement
, representation
, term
, textHeight
, style
, fillDetails
);
677 parentElement
.addElement(element
);
681 public RepresentationElement
createRepresentationElement(ICdmFormElement parentElement
, Representation representation
, AbstractTermDto term
,int textHeight
, int style
, boolean fillDetails
) {
682 RepresentationElement element
= new RepresentationElement(this, parentElement
, representation
, term
, textHeight
, style
, fillDetails
);
684 parentElement
.addElement(element
);
689 * createMultiLanguageTextElement
691 * @param parentElement
692 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
695 * @param Representation
696 * a {@link eu.etaxonomy.cdm.model.term.Representation} object.
702 * {@link eu.etaxonomy.taxeditor.ui.element.RepresentationElement}
705 public TranslatableRepresentationElement
createTranslatableRepresentationElement(ICdmFormElement parentElement
, Representation representation
, TermBase term
,int textHeight
, int style
, boolean fillDetails
) {
706 TranslatableRepresentationElement element
= new TranslatableRepresentationElement(this, parentElement
, representation
, term
, textHeight
, style
, fillDetails
);
708 parentElement
.addElement(element
);
712 public TranslatableRepresentationElement
createTranslatableRepresentationElementDto(ICdmFormElement parentElement
, Representation representation
, AbstractTermDto term
,int textHeight
, int style
, boolean fillDetails
) {
713 TranslatableRepresentationElement element
= new TranslatableRepresentationElement(this, parentElement
, representation
, term
, textHeight
, style
, fillDetails
);
715 parentElement
.addElement(element
);
720 public KeyStatementElement
createKeyStatementElement(ICdmFormElement parentElement
, String labelString
,
721 KeyStatement keyStatement
, int textHeight
, int style
) {
722 KeyStatementElement element
= new KeyStatementElement(this, parentElement
, labelString
, keyStatement
,
725 parentElement
.addElement(element
);
730 * Creates a text field with a label. The initial content will be the return value of the initalObject's {@link #toString()}
732 * <b>Note</b>: if initialObject is <code>null</code> then an empty string is used.
733 * @param parentElement the parent container
734 * @param labelString the label name
735 * @param initialObject the object from which the <code>toString()</code> method is called
736 * @param style {@link SWT} style constant
737 * @return the created textfield with label
739 public TextWithLabelElement
createTextWithLabelElement(ICdmFormElement parentElement
, String labelString
,
740 Object initialObject
, int style
) {
741 return createTextWithLabelElement(parentElement
, labelString
, initialObject
==null?
"":initialObject
.toString(), style
);
746 * createTextWithLabelElement
749 * @param parentElement
750 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
753 * a {@link java.lang.String} object.
755 * a {@link java.lang.String} object.
758 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
761 public TextWithLabelElement
createTextWithLabelElement(ICdmFormElement parentElement
, String labelString
,
762 String initialText
, int style
) {
763 return createTextWithLabelElement(parentElement
, labelString
, initialText
, null, style
);
769 * createTextWithLabelAndSetNullElement
771 * @param parentElement
772 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
775 * a {@link java.lang.String} object.
777 * a {@link java.lang.String} object.
778 * @param textLimit maximal number of characters allowed
781 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelAndSetNullElement}
784 public TextWithLabelAndSetNullElement
createTextWithLabelAndSetNullElement(ICdmFormElement parentElement
,
785 String labelString
, String initialText
, int style
) {
786 TextWithLabelAndSetNullElement element
= new TextWithLabelAndSetNullElement(this, parentElement
, labelString
, initialText
, style
) ;
789 parentElement
.addElement(element
);
794 * createTextWithLabelElement
796 * @param parentElement
797 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
800 * a {@link java.lang.String} object.
802 * a {@link java.lang.String} object.
803 * @param textLimit maximal number of characters allowed
806 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
809 public TextWithLabelElement
createTextWithLabelElement(ICdmFormElement parentElement
, String labelString
,
810 String initialText
, Integer textLimit
, int style
) {
811 if(initialText
==null){
815 TextWithLabelElement element
= new TextWithLabelElement(this, parentElement
, labelString
, initialText
, null,
818 parentElement
.addElement(element
);
822 public TextWithLabelElement
createMultiLineTextWithLabel(ICdmFormElement parentElement
, String labelString
,
823 int textHeight
, int style
) {
824 TextWithLabelElement element
= new TextWithLabelElement(this, parentElement
, labelString
, "", textHeight
, true, style
);
826 parentElement
.addElement(element
);
830 public LsidWithExceptionLabelElement
createLsidWithExceptionLabelElement(ICdmFormElement parentElement
, String labelString
,
831 LSID initialLsid
, int style
) {
832 LsidWithExceptionLabelElement element
= new LsidWithExceptionLabelElement(this, parentElement
, labelString
, initialLsid
, null, style
);
834 parentElement
.addElement(element
);
838 public UriWithLabelElement
createUriWithLabelElement(ICdmFormElement parentElement
, String labelString
,
839 URI initialUri
, int style
) {
840 UriWithLabelElement element
= new UriWithLabelElement(this, parentElement
, labelString
, initialUri
, null, style
);
842 parentElement
.addElement(element
);
845 public UriWithLabelElement
createUriWithLabelElement(ICdmFormElement parentElement
, String labelString
,
846 URI initialUri
,Integer textHeight
, int style
) {
847 UriWithLabelElement element
= new UriWithLabelElement(this, parentElement
, labelString
, initialUri
, textHeight
, style
);
849 parentElement
.addElement(element
);
854 public DoiWithLabelElement
createDoiWithLabelElement(ICdmFormElement parentElement
, String labelString
,
855 DOI initialDoi
, int style
) {
856 DoiWithLabelElement element
= new DoiWithLabelElement(this, parentElement
, labelString
, initialDoi
, null, style
);
858 parentElement
.addElement(element
);
861 public DoiWithLabelElement
createDoiWithLabelElement(ICdmFormElement parentElement
, String labelString
,
862 DOI initialDoi
,Integer textHeight
, int style
) {
863 DoiWithLabelElement element
= new DoiWithLabelElement(this, parentElement
, labelString
, initialDoi
, textHeight
, style
);
865 parentElement
.addElement(element
);
869 public OrcidWithLabelElement
createOrcidWithLabelElement(ICdmFormElement parentElement
, String labelString
,
870 ORCID initialDoi
, int style
) {
871 OrcidWithLabelElement element
= new OrcidWithLabelElement(this, parentElement
, labelString
, initialDoi
, null, style
);
873 parentElement
.addElement(element
);
876 public OrcidWithLabelElement
createDoiWithLabelElement(ICdmFormElement parentElement
, String labelString
,
877 ORCID initialDoi
,Integer textHeight
, int style
) {
878 OrcidWithLabelElement element
= new OrcidWithLabelElement(this, parentElement
, labelString
, initialDoi
, textHeight
, style
);
880 parentElement
.addElement(element
);
891 public OpenUrlSelectorElement
createOpenUrlSelectorElement(ICdmFormElement parentElement
, String labelString
,
892 IOpenUrlEnabled openUrlEnabled
, int style
) {
893 OpenUrlSelectorElement element
= new OpenUrlSelectorElement(this, parentElement
, labelString
, openUrlEnabled
,
896 parentElement
.addElement(element
);
900 public EditPasswordElement
createEditPasswordElement(ICdmFormElement parentElement
, String labelString
,
901 ConversationHolder conversation
, User user
, int style
) {
902 EditPasswordElement element
= new EditPasswordElement(this, parentElement
, labelString
, user
, conversation
);
904 parentElement
.addElement(element
);
908 public FloatWithLabelElement
createFloatTextWithLabelElement(
909 ICdmFormElement parentElement
, String labelString
,
910 Number initialNumber
, int style
) {
911 FloatWithLabelElement element
= new FloatWithLabelElement(this,
912 parentElement
, labelString
, initialNumber
, style
);
914 parentElement
.addElement(element
);
918 public BigDecimalWithLabelElement
createBigDecimalTextWithLabelElement(
919 ICdmFormElement parentElement
, String labelString
,
920 Number initialNumber
, int style
) {
921 BigDecimalWithLabelElement element
= new BigDecimalWithLabelElement(this,
922 parentElement
, labelString
, initialNumber
, style
);
924 parentElement
.addElement(element
);
928 public LanguageStringWithLabelElement
createLanguageStringWithLabelElement(ICdmFormElement parentElement
,
929 String labelString
, LanguageString languageString
, int style
) {
930 return createLanguageStringWithLabelElement(parentElement
, labelString
, languageString
, null, false, style
);
933 public LanguageStringWithLabelElement
createLanguageStringWithLabelElement(ICdmFormElement parentElement
,
934 String labelString
, LanguageString languageString
, Integer height
, boolean isMultiLine
, int style
) {
935 LanguageStringWithLabelElement element
= new LanguageStringWithLabelElement(this, parentElement
, labelString
,
936 languageString
, height
, isMultiLine
, style
);
938 parentElement
.addElement(element
);
942 public KeyValueViewerElement
createKeyValueViewerElement(ICdmFormElement parentElement
, String keyHeading
,
943 String valueHeading
, Map
<Object
, Object
> map
) {
944 KeyValueViewerElement element
= new KeyValueViewerElement(this, parentElement
, keyHeading
, valueHeading
, map
);
946 parentElement
.addElement(element
);
951 * @deprecated Use {@link #createDefinedTermComboElement(TermType, ICdmFormElement, String, DefinedTermBase, int)} instead
954 public <T
extends DefinedTermBase
> TermComboElement
<T
> createTermComboElement(Class
<T
> termComboType
,
955 ICdmFormElement parentElement
, String labelString
, T selection
, int style
) {
956 TermComboElement
<T
> element
= new TermComboElement
<T
>(this, parentElement
, termComboType
, labelString
, selection
, true, style
);
958 parentElement
.addElement(element
);
962 public <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
964 ICdmFormElement parentElement
,
968 Comparator
<T
> comparator
) {
969 return this.createDefinedTermComboElement(termType
, null, null, parentElement
, labelString
, selection
, true, style
, false, comparator
);
971 public <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
973 ICdmFormElement parentElement
,
977 Comparator
<T
> comparator
) {
978 return this.createDefinedTermComboElement(null, null, terms
, parentElement
, labelString
, selection
, true, style
, false, comparator
);
981 public <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
983 ICdmFormElement parentElement
,
986 boolean addEmptyElement
,
988 return this.createDefinedTermComboElement(termType
, null, null, parentElement
, labelString
, selection
, addEmptyElement
, style
, false, null);
991 public <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
993 ICdmFormElement parentElement
,
997 return this.createDefinedTermComboElement(termType
, null, null, parentElement
, labelString
, selection
, true, style
, false, null);
999 public <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElementDto(
1001 ICdmFormElement parentElement
,
1005 return this.createDefinedTermComboElement(termType
, null, null, parentElement
, labelString
, selection
, true, style
, false, null);
1008 public <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
1010 ICdmFormElement parentElement
,
1014 return this.createDefinedTermComboElement(null, null, terms
, parentElement
, labelString
, selection
, true, style
, false, null);
1017 public <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
1019 ICdmFormElement parentElement
,
1022 boolean addEmptyElement
,
1024 return this.createDefinedTermComboElement(null, null, terms
, parentElement
, labelString
, selection
, addEmptyElement
, style
, false, null);
1027 public <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
1029 ICdmFormElement parentElement
,
1032 boolean addEmptyElement
,
1034 boolean useAbbrevLabel
) {
1035 return createDefinedTermComboElement(termType
, null, null, parentElement
, labelString
, selection
, addEmptyElement
, style
, useAbbrevLabel
, null);
1038 public <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
1039 TermVocabulary
<?
> termVocabulary
,
1040 ICdmFormElement parentElement
,
1044 return this.createDefinedTermComboElement(null, termVocabulary
, null, parentElement
, labelString
, selection
, true, style
, false, null);
1047 public <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
1048 TermVocabulary
<?
> termVocabulary
,
1049 ICdmFormElement parentElement
,
1052 boolean addEmptyElement
,
1054 boolean useAbbrevLabel
) {
1055 return createDefinedTermComboElement(null, termVocabulary
, null, parentElement
, labelString
, selection
, addEmptyElement
, style
, useAbbrevLabel
, null);
1058 private <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
1060 TermVocabulary
<?
> termVocabulary
,
1062 ICdmFormElement parentElement
,
1065 boolean addEmptyElement
,
1067 boolean useAbbrevLabel
,
1068 Comparator
<T
> comparator
) {
1071 TermComboElement
<T
> element
= new TermComboElement
<T
>(this, parentElement
, termType
, labelString
, selection
, addEmptyElement
, style
, useAbbrevLabel
, comparator
);
1073 parentElement
.addElement(element
);
1076 else if(termVocabulary
!=null){
1077 TermComboElement
<T
> element
= new TermComboElement
<T
>(this, parentElement
, termVocabulary
, labelString
, selection
, addEmptyElement
, style
, useAbbrevLabel
, comparator
);
1078 // if (comparator!= null){
1079 // element.setTermComparator(comparator);
1082 parentElement
.addElement(element
);
1084 }else if (terms
!= null){
1086 TermComboElement
<T
> element
= new TermComboElement
<T
>(this, parentElement
, terms
, labelString
, selection
, addEmptyElement
, style
, useAbbrevLabel
, comparator
);
1089 parentElement
.addElement(element
);
1093 //this should never happen
1098 private <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
1100 TermVocabulary
<?
> termVocabulary
,
1102 ICdmFormElement parentElement
,
1105 boolean addEmptyElement
,
1107 boolean useAbbrevLabel
,
1108 Comparator
<T
> comparator
) {
1110 TermComboElement
<T
> element
= new TermComboElement
<T
>(this, parentElement
, termType
, labelString
, selection
, addEmptyElement
, style
, useAbbrevLabel
, comparator
);
1112 parentElement
.addElement(element
);
1117 //this should never happen
1122 public RelationshipTypeCombo
createNameRelationshipTypeCombo(ICdmFormElement parentElement
,
1125 boolean useAbbrevLabel
,
1126 Comparator
<NameRelationshipType
> comparator
) {
1128 RelationshipTypeCombo
<InverseTermWrapper
> element
= new RelationshipTypeCombo(this, parentElement
, TermType
.NameRelationshipType
, labelString
, true, style
, useAbbrevLabel
, comparator
);
1130 parentElement
.addElement(element
);
1134 public RelationshipTypeCombo
createTaxonRelationshipTypeCombo(ICdmFormElement parentElement
,
1137 boolean useAbbrevLabel
,
1138 Comparator
<TaxonRelationshipType
> comparator
) {
1140 RelationshipTypeCombo
<InverseTermWrapper
> element
= new RelationshipTypeCombo(this, parentElement
, TermType
.TaxonRelationshipType
, labelString
, true, style
, useAbbrevLabel
, comparator
);
1142 parentElement
.addElement(element
);
1146 public MisappliedRelationshipComboElement
createMisappliedRelationshipComboElement(
1147 ICdmFormElement parentElement
,
1149 TaxonRelationshipType selection
,
1151 MisappliedRelationshipComboElement combo
= new MisappliedRelationshipComboElement(this, parentElement
, labelString
, selection
, false, style
, false);
1153 parentElement
.addElement(combo
);
1157 public <T
extends IEnumTerm
<T
>> EnumComboElement
<T
> createEnumComboElement(
1158 Class
<T
> enumComboType
, ICdmFormElement parentElement
,
1159 int style
, boolean hasNullValue
) {
1160 return createEnumComboElement(enumComboType
, parentElement
, null, style
, hasNullValue
);
1162 public <T
extends IEnumTerm
<T
>> EnumComboElement
<T
> createEnumComboElement(
1163 Class
<T
> enumComboType
, ICdmFormElement parentElement
,
1165 return createEnumComboElement(enumComboType
, parentElement
, null, style
, false);
1168 public <T
extends IEnumTerm
<T
>> EnumComboElement
<T
> createEnumComboElement(
1169 Class
<T
> enumComboType
, ICdmFormElement parentElement
, Comparator
<T
> comparator
,
1170 int style
, boolean hasNullValue
) {
1171 EnumComboElement
<T
> element
= new EnumComboElement
<T
>(this, parentElement
, enumComboType
, comparator
, style
, hasNullValue
);
1173 parentElement
.addElement(element
);
1177 public <TERM
extends DefinedTermBase
<TERM
>, VOC
extends TermVocabulary
<TERM
>> VocabularyComboElement
<TERM
, VOC
> createVocabularyComboElement(
1178 TermType termType
, String label
, VOC selection
, ICdmFormElement parentElement
, int style
) {
1179 VocabularyComboElement
<TERM
, VOC
> element
= new VocabularyComboElement
<TERM
, VOC
>(this, parentElement
, termType
, label
, selection
, style
);
1181 parentElement
.addElement(element
);
1185 public <TERM
extends DefinedTermBase
<TERM
>, VOC
extends TermVocabulary
<TERM
>> VocabularyComboElement
<TERM
, VOC
> createVocabularyDtoComboElement(
1186 TermType termType
, String label
, TermVocabularyDto selection
, ICdmFormElement parentElement
, int style
) {
1187 VocabularyComboElement
<TERM
, VOC
> element
= new VocabularyComboElement
<TERM
, VOC
>(this, parentElement
, termType
, label
, selection
, style
);
1189 parentElement
.addElement(element
);
1193 public BrowserElement
createBrowserElement(ICdmFormElement parentElement
, URI imageUri
, int style
) {
1194 BrowserElement element
= new BrowserElement(this, parentElement
, imageUri
, style
);
1196 parentElement
.addElement(element
);
1200 public ImageElement
createImageElement(ICdmFormElement parentElement
, URI imageUri
, int style
) {
1201 ImageElement element
= new ImageElement(this, parentElement
, imageUri
, style
);
1203 parentElement
.addElement(element
);
1207 public TextActionElement
createTextActionElement(ICdmFormElement parentElement
, String labelString
,
1208 String buttonLabel
, String initialText
, int style
) {
1209 TextActionElement element
= new TextActionElement(this, parentElement
, labelString
, buttonLabel
, initialText
,
1212 parentElement
.addElement(element
);
1216 public CheckboxElement
createCheckbox(ICdmFormElement parentElement
, String label
, Boolean initialState
, int style
) {
1217 if(initialState
==null){
1218 initialState
= Boolean
.FALSE
;
1220 CheckboxElement element
= new CheckboxElement(this, parentElement
, label
, initialState
, style
| orientation
);
1222 parentElement
.addElement(element
);
1227 * Creates a section as a part of the form.
1229 * @return the section widget
1231 public Section
adapt(AbstractFormSection section
) {
1232 section
.setMenu(section
.getLayoutComposite().getMenu());
1233 adapt(section
, true, true);
1235 // handle focus and property change events for cdm use
1236 section
.addFocusListener(selectionFocusHandler
);
1237 section
.setPropertyChangeListeners(propertyChangeListeners
);
1239 section
.addExpansionListener(new ExpansionAdapter(){
1241 public void expansionStateChanged(ExpansionEvent e
) {
1242 super.expansionStateChanged(e
);
1243 if(section
.getEntity()!=null){
1244 PreferencesUtil
.setStringValue(StoreUtil
.getPrefKey(section
.getClass(), section
.getEntity().getClass().getCanonicalName()), e
.getState()?CdmSectionPart
.EXPANDED
:CdmSectionPart
.COLLAPSED
);
1249 if (section
.getToggle() != null) {
1250 section
.getToggle().setHoverDecorationColor(getColors().getColor(IFormColors
.TB_TOGGLE_HOVER
));
1251 section
.getToggle().setDecorationColor(getColors().getColor(IFormColors
.TB_TOGGLE
));
1254 section
.setFont(boldFontHolder2
.getBoldFont(section
.getLayoutComposite().getFont()));
1256 if ((section
.getStyle() & ExpandableComposite
.TITLE_BAR
) != 0
1257 || (section
.getStyle() & ExpandableComposite
.SHORT_TITLE_BAR
) != 0) {
1258 getColors().initializeSectionToolBarColors();
1259 section
.setTitleBarBackground(getColors().getColor(IFormColors
.TB_BG
));
1260 section
.setTitleBarBorderColor(getColors().getColor(IFormColors
.TB_BORDER
));
1262 // call setTitleBarForeground regardless as it also sets the label color
1263 section
.setTitleBarForeground(getColors().getColor(IFormColors
.TB_TOGGLE
));
1267 private class BoldFontHolder2
{
1268 private Font normalFont
;
1270 private Font boldFont
;
1272 public BoldFontHolder2() {
1275 public Font
getBoldFont(Font font
) {
1276 createBoldFont(font
);
1280 private void createBoldFont(Font font
) {
1281 if (normalFont
== null || !normalFont
.equals(font
)) {
1285 if (boldFont
== null) {
1286 boldFont
= FormFonts
.getInstance().getBoldFont(getColors().getDisplay(), normalFont
);
1290 public void dispose() {
1291 if (boldFont
!= null) {
1292 FormFonts
.getInstance().markFinished(boldFont
, getColors().getDisplay());
1299 * createToggleableTextField with relevance
1301 public ToggleableTextElement
createToggleableTextField(ICdmFormElement parentElement
, String labelString
,
1302 String initialText
, boolean initialState
, CacheRelevance relevance
, int style
) {
1304 ToggleableTextElement element
= new ToggleableTextElement(this, parentElement
, labelString
, initialText
,
1305 initialState
, relevance
, style
| orientation
);
1307 parentElement
.addElement(element
);
1312 * like {@link #createToggleableTextField(ICdmFormElement, String, String, boolean, CacheRelevance, int)}
1313 * but with predefined cache relevance == 1
1315 public ToggleableTextElement
createToggleableTextField(ICdmFormElement parentElement
, String labelString
,
1316 String initialText
, boolean initialState
, int style
) {
1317 return createToggleableTextField(parentElement
, labelString
, initialText
, initialState
, CacheRelevance
.CACHE1
, style
);
1321 * like {@link #createToggleableTextField(ICdmFormElement, String, String, boolean, CacheRelevance, int)}
1322 * but with predefined cache relevance == 1
1324 public RemovableTextElement
createRemovableTextField(ICdmFormElement parentElement
, String labelString
,
1325 String initialText
, int style
) {
1326 RemovableTextElement element
= new RemovableTextElement(this, parentElement
, labelString
, initialText
,
1327 style
| orientation
);
1330 parentElement
.addElement(element
);
1336 * createTimePeriodElement
1338 public TimePeriodElement
createTimePeriodElement(ICdmFormElement parentElement
, String labelString
,
1339 TimePeriod timePeriod
, int style
) {
1340 TimePeriodElement element
= new TimePeriodElement(this, parentElement
, labelString
, timePeriod
, style
);
1342 parentElement
.addElement(element
);
1347 * createVerbatimTimePeriodElement
1349 public VerbatimTimePeriodElement
createVerbatimTimePeriodElement(ICdmFormElement parentElement
, String labelString
,
1350 VerbatimTimePeriod timePeriod
, int style
) {
1351 VerbatimTimePeriodElement element
= new VerbatimTimePeriodElement(this, parentElement
, labelString
, timePeriod
, style
);
1353 parentElement
.addElement(element
);
1358 * createGatheringEventUnitElement
1360 public GatheringEventUnitElement
createGatheringEventUnitElement(
1361 ICdmFormElement parentElement
,
1363 DerivedUnitFacade gatheringEvent
,
1364 MinMaxTextSection
.UnitType unitType
,
1366 GatheringEventUnitElement element
= new GatheringEventUnitElement(this,
1373 parentElement
.addElement(element
);
1378 * createPointElement
1380 public PointElement
createPointElement(ICdmFormElement parentElement
, Point point
, int style
) {
1381 PointElement element
= new PointElement(this, parentElement
, point
, style
);
1383 parentElement
.addElement(element
);
1388 * Creates an empty section with the given message.<br>
1389 * If message is <code>null</code> a default message will be displayed.
1391 public EmptySection
createEmptySection(String message
, CdmFormFactory formFactory
, ICdmFormElement parentElement
, int style
) {
1392 EmptySection section
= new EmptySection(message
, formFactory
, parentElement
, style
);
1393 parentElement
.addElement(section
);
1398 public DateDetailSection
<TimePeriod
> createDateDetailSection(ICdmFormElement parentElement
, int style
) {
1399 DateDetailSection
<TimePeriod
> section
= new DateDetailSection
<TimePeriod
>(this, parentElement
, false, style
);
1400 parentElement
.addElement(section
);
1405 public DateDetailSection
<VerbatimTimePeriod
> createVerbatimDateDetailSection(ICdmFormElement parentElement
, int style
) {
1406 DateDetailSection
<VerbatimTimePeriod
> section
1407 = new DateDetailSection
<VerbatimTimePeriod
>(this, parentElement
, true, style
);
1408 parentElement
.addElement(section
);
1413 public MinMaxTextSection
createMinMaxTextSection(ICdmFormElement parentElement
, UnitType unitType
, int style
) {
1414 MinMaxTextSection section
= new MinMaxTextSection(this, parentElement
, unitType
, style
);
1415 parentElement
.addElement(section
);
1420 public PartialElement
createPartialElement(ICdmFormElement parentElement
, String labelString
, Partial partial
,
1422 PartialElement element
= new PartialElement(this, parentElement
, labelString
, style
);
1424 parentElement
.addElement(element
);
1428 public PartialElement
createPartialElement(ICdmFormElement parentElement
, String labelString
, Partial partial
, boolean showYear
,
1430 PartialElement element
= new PartialElement(this, parentElement
, labelString
, style
, showYear
);
1432 parentElement
.addElement(element
);
1436 public void addSelectionListener(SelectionListener listener
) {
1437 selectionListenerList
.add(listener
);
1440 public void removeSelectionListener(SelectionListener listener
) {
1441 if (listener
== null) {
1442 MessagingUtils
.error(this.getClass(),
1443 "Tried to remove a selection listener from this factories listeners but was null", null);
1445 selectionListenerList
.remove(listener
);
1449 public void addPropertyChangeListener(IPropertyChangeListener listener
) {
1450 if (propertyChangeListeners
.contains(listener
)) {
1453 propertyChangeListeners
.add(0, listener
);
1456 public void removePropertyChangeListener(IPropertyChangeListener listener
) {
1457 propertyChangeListeners
.remove(listener
);
1460 public List
<IPropertyChangeListener
> getPropertyChangeListeners() {
1461 return propertyChangeListeners
;
1464 public Label
createHorizontalSeparator(ICdmFormElement parentElement
, int style
) {
1465 Label separator
= this.createSeparator(parentElement
.getLayoutComposite(), SWT
.HORIZONTAL
| style
);
1466 separator
.setLayoutData(LayoutConstants
.FILL_HORIZONTALLY());
1470 public VersionElement
createVersionElement(ICdmFormElement parentElement
, VersionableEntity entity
, int style
) {
1471 VersionElement element
= new VersionElement(this, parentElement
, entity
, style
);
1473 parentElement
.addElement(element
);
1477 public CdmBaseElement
createCdmBaseElement(ICdmFormElement parentElement
, CdmBase entity
, int style
) {
1478 CdmBaseElement element
= new CdmBaseElement(this, parentElement
, entity
, style
);
1480 parentElement
.addElement(element
);
1484 public VersionSection
createVersionSection(ICdmFormElement parentElement
, int style
) {
1485 VersionSection section
= new VersionSection(this, parentElement
, style
);
1486 parentElement
.addElement(section
);
1491 public CdmBaseSection
createCdmBaseSection(ICdmFormElement parentElement
, int style
) {
1492 CdmBaseSection section
= new CdmBaseSection(this, parentElement
, style
);
1493 parentElement
.addElement(section
);
1498 public EmptyElement
createEmptyElement(ICdmFormElement parentElement
, String emptyText
) {
1499 EmptyElement element
= new EmptyElement(this, parentElement
, emptyText
, SWT
.NULL
);
1501 parentElement
.addElement(element
);
1505 public HeadlineSection
createHeadlineSection(ICdmFormElement parentElement
) {
1506 HeadlineSection section
= new HeadlineSection(this, parentElement
, SWT
.NULL
);
1507 parentElement
.addElement(section
);
1512 public ParsingMessageElement
createParsingMessageElement(ICdmFormElement parentElement
,
1513 ParserProblem parserProblem
, int style
) {
1514 ParsingMessageElement element
= new ParsingMessageElement(this, parentElement
, parserProblem
, style
);
1516 parentElement
.addElement(element
);
1520 public <T
extends DefinedTermBase
> DefinedTermDetailSection
<T
> createDefinedTermDetailSection(Class clazz
,
1521 ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
1522 @SuppressWarnings("unchecked")
1523 Class
<T
> definedTermClass
= clazz
;
1524 DefinedTermDetailSection
<T
> section
= new DefinedTermDetailSection
<>(this, definedTermClass
, parentElement
,
1525 selectionProvider
, style
);
1527 parentElement
.addElement(section
);
1532 public TermMediaSection
createTermMediaSection(
1533 ICdmFormElement parentElement
, int style
) {
1534 TermMediaSection section
= new TermMediaSection(this, parentElement
, style
);
1535 parentElement
.addElement(section
);
1540 public DerivedUnitMediaSection
createDerivedUnitMediaSection(
1541 ICdmFormElement parentElement
, int style
) {
1542 DerivedUnitMediaSection section
= new DerivedUnitMediaSection(this, parentElement
, style
);
1543 parentElement
.addElement(section
);
1548 public AbstractCdmDetailElement
createDefinedTermDetailElement(Class definedTermClass
,
1549 ICdmFormElement parentElement
, int style
) {
1550 AbstractCdmDetailElement
<?
> element
= null;
1552 if (NamedArea
.class.isAssignableFrom(definedTermClass
)) {
1553 element
= new eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement(this, parentElement
);
1554 } else if (definedTermClass
.equals(Feature
.class)) {
1555 element
= new FeatureDetailElement(this, parentElement
);
1556 } else if(definedTermClass
.equals(PresenceAbsenceTerm
.class)){
1557 element
= new PresenceAbsenceTermDetailElement(this, parentElement
);
1558 } else if(definedTermClass
.equals(Language
.class)){
1559 element
= new LanguageDetailElement(this, parentElement
);
1561 element
= new DefinedTermDetailElement
<>(this, parentElement
);
1565 parentElement
.addElement(element
);
1569 public CharacterNodeDetailSection
createCharacterNodeDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1570 CharacterNodeDetailSection section
= new CharacterNodeDetailSection(this, parentElement
, selectionProvider
, style
);
1571 addAndAdaptSection(parentElement
, section
);
1575 public CharacterNodeDtoDetailSection
createCharacterNodeDtoDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1576 CharacterNodeDtoDetailSection section
= new CharacterNodeDtoDetailSection(this, parentElement
, selectionProvider
, style
);
1577 addAndAdaptSection(parentElement
, section
);
1581 public CharacterDetailSection
createCharacterDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1582 CharacterDetailSection section
= new CharacterDetailSection(this, parentElement
, selectionProvider
, style
);
1583 addAndAdaptSection(parentElement
, section
);
1587 public CharacterDtoDetailSection
createCharacterDtoDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1588 CharacterDtoDetailSection section
= new CharacterDtoDetailSection(this, parentElement
, selectionProvider
, style
);
1589 addAndAdaptSection(parentElement
, section
);
1593 public CharacterNodeDetailElement
createCharacterNodeDetailElement(ICdmFormElement parentElement
, int style
){
1594 CharacterNodeDetailElement element
= new CharacterNodeDetailElement(this, parentElement
);
1595 addAndAdaptElement(parentElement
, element
);
1598 public CharacterNodeDtoDetailElement
createCharacterNodeDtoDetailElement(ICdmFormElement parentElement
, int style
){
1599 CharacterNodeDtoDetailElement element
= new CharacterNodeDtoDetailElement(this, parentElement
);
1600 addAndAdaptElement(parentElement
, element
);
1604 public CharacterDetailElement
createCharacterDetailElement(ICdmFormElement parentElement
, int style
){
1605 CharacterDetailElement element
= new CharacterDetailElement(this, parentElement
);
1606 addAndAdaptElement(parentElement
, element
);
1609 public CharacterDtoDetailElement
createCharacterDtoDetailElement(ICdmFormElement parentElement
, int style
){
1610 CharacterDtoDetailElement element
= new CharacterDtoDetailElement(this, parentElement
);
1611 addAndAdaptElement(parentElement
, element
);
1615 public TermTreeDetailElement
createFeatureTreeDetailElement(ICdmFormElement parentElement
, int style
){
1616 TermTreeDetailElement element
= new TermTreeDetailElement(this, parentElement
);
1617 addAndAdaptElement(parentElement
, element
);
1621 public AbstractCdmDetailElement
<TermTree
> createFeatureTreeDetailElementForTree(
1622 AbstractCdmDetailSection
<TermTree
> parentElement
, int style
) {
1623 TermTreeDetailElementForNode element
= new TermTreeDetailElementForNode(this, parentElement
);
1624 addAndAdaptElement(parentElement
, element
);
1628 public TermNodeDetailElement
createFeatureNodeDetailElement(ICdmFormElement parentElement
, int style
){
1629 TermNodeDetailElement element
= new TermNodeDetailElement(this, parentElement
);
1630 addAndAdaptElement(parentElement
, element
);
1635 //--------DetailSections---------
1636 public NameDetailSection
createNameDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1637 NameDetailSection section
= new NameDetailSection(this, parentElement
, selectionProvider
, style
);
1638 addAndAdaptSection(parentElement
, section
);
1642 public TermNodeDetailSection
createFeatureNodeDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1643 TermNodeDetailSection section
= new TermNodeDetailSection(this, parentElement
, selectionProvider
, style
);
1644 addAndAdaptSection(parentElement
, section
);
1648 public TermTreeDetailSection
createFeatureTreeDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1649 TermTreeDetailSection section
= new TermTreeDetailSection(this, parentElement
, selectionProvider
, style
);
1650 addAndAdaptSection(parentElement
, section
);
1653 public TermTreeDetailSectionForNode
createFeatureTreeDetailSectionForTree(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1654 TermTreeDetailSectionForNode section
= new TermTreeDetailSectionForNode(this, parentElement
, selectionProvider
, style
);
1655 addAndAdaptSection(parentElement
, section
);
1659 public ReferenceDetailSection
createReferenceDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1660 ReferenceDetailSection section
= new ReferenceDetailSection(this, parentElement
, selectionProvider
, style
);
1661 addAndAdaptSection(parentElement
, section
);
1665 public NomenclaturalSourceDetailSection
createNomenclaturalReferenceDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1666 NomenclaturalSourceDetailSection section
= new NomenclaturalSourceDetailSection(this, parentElement
, selectionProvider
, style
);
1667 addAndAdaptSection(parentElement
, section
);
1671 public OriginalSourceAdvancedSection
createOriginalSourceAdvancedSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1672 OriginalSourceAdvancedSection section
= new OriginalSourceAdvancedSection(this, parentElement
, selectionProvider
, style
);
1673 addAndAdaptSection(parentElement
, section
);
1677 public AdvancedSourceElement
createAdvancedSourceDetailElement(ICdmFormElement parentElement
, int style
){
1678 AdvancedSourceElement element
= new AdvancedSourceElement(this, parentElement
);
1679 addAndAdaptElement(parentElement
, element
);
1683 public AdvancedSourceElement
createAdvancedNomenclaturalSourceDetailElement(ICdmFormElement parentElement
, int style
){
1684 AdvancedNomenclaturalSourceElement element
= new AdvancedNomenclaturalSourceElement(this, parentElement
);
1685 addAndAdaptElement(parentElement
, element
);
1689 public SingleSourceSection
createSingleSourceSection(ICdmFormElement parentElement
, CdmBase cdmEntity
, ISelectionProvider selectionProvider
, String label
, int style
){
1690 SingleSourceSection section
= new SingleSourceSection(this, parentElement
, cdmEntity
, selectionProvider
, style
, label
);
1691 addAndAdaptSection(parentElement
, section
);
1695 public TaxonBaseDetailSection
createTaxonBaseDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1696 TaxonBaseDetailSection section
= new TaxonBaseDetailSection(this, parentElement
, selectionProvider
, style
);
1697 addAndAdaptSection(parentElement
, section
);
1701 public AuthorshipDetailSection
createAuthorshipDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1702 AuthorshipDetailSection section
= new AuthorshipDetailSection(this, parentElement
, selectionProvider
, style
);
1703 addAndAdaptSection(parentElement
, section
);
1707 public TeamOrPersonBaseDetailSection
createTeamOrPersonBaseDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1708 TeamOrPersonBaseDetailSection section
= new TeamOrPersonBaseDetailSection(this, parentElement
, selectionProvider
, style
);
1709 addAndAdaptSection(parentElement
, section
);
1713 public TeamDetailSection
createTeamDetailSection(ICdmFormElement parentElement
, int style
){
1714 TeamDetailSection section
= new TeamDetailSection(this, parentElement
, null, style
);
1715 addAndAdaptSection(parentElement
, section
);
1719 public PersonDetailSection
createPersonDetailSection(ICdmFormElement parentElement
, int style
){
1720 PersonDetailSection section
= new PersonDetailSection(this, parentElement
, null, style
);
1721 addAndAdaptSection(parentElement
, section
);
1725 public DescriptionDetailSection
createDescriptionDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1726 DescriptionDetailSection section
= new DescriptionDetailSection(this, parentElement
, selectionProvider
, style
);
1727 addAndAdaptSection(parentElement
, section
);
1731 public DescriptionElementDetailSection
createDescriptionElementDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1732 DescriptionElementDetailSection section
= new DescriptionElementDetailSection(this, parentElement
, selectionProvider
, style
);
1733 addAndAdaptSection(parentElement
, section
);
1737 public ParsingMessagesSection
createParsingMessagesSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1738 ParsingMessagesSection section
= new ParsingMessagesSection(this, parentElement
, selectionProvider
, style
);
1739 addAndAdaptSection(parentElement
, section
);
1745 public NonViralNameDetailSection
createNonViralNameDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, boolean nameChoosable
, int style
){
1746 NonViralNameDetailSection section
= new NonViralNameDetailSection(this, parentElement
, selectionProvider
, nameChoosable
, style
);
1747 addAndAdaptSection(parentElement
, section
);
1751 public MediaDetailsSection
createMediaDetailsSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1752 MediaDetailsSection section
= new MediaDetailsSection(this, parentElement
, selectionProvider
, style
);
1753 addAndAdaptSection(parentElement
, section
);
1757 public FieldUnitFacadeDetailSection
createFieldUnitFacadeDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1758 FieldUnitFacadeDetailSection section
= new FieldUnitFacadeDetailSection(this, parentElement
, selectionProvider
, style
);
1759 addAndAdaptSection(parentElement
, section
);
1763 public GatheringEventDetailSection
createGatheringEventDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1764 GatheringEventDetailSection section
= new GatheringEventDetailSection(this, parentElement
, selectionProvider
, style
);
1765 addAndAdaptSection(parentElement
, section
);
1769 public DerivedUnitBaseDetailSection
createDerivedUnitBaseDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1770 DerivedUnitBaseDetailSection section
= new DerivedUnitBaseDetailSection(this, parentElement
, selectionProvider
, style
);
1771 addAndAdaptSection(parentElement
, section
);
1775 public DerivedUnitTypeDesignationSection
createDerivedUnitTypeDesignationSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1776 DerivedUnitTypeDesignationSection section
= new DerivedUnitTypeDesignationSection(this, parentElement
, style
);
1777 addAndAdaptSection(parentElement
, section
);
1781 public TaxonAssociationDetailSection
createTaxonAssociationDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1782 TaxonAssociationDetailSection section
= new TaxonAssociationDetailSection(this, parentElement
, selectionProvider
, style
);
1783 addAndAdaptSection(parentElement
, section
);
1787 public OriginalLabelDataSection
createOriginalLabelDataSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1788 OriginalLabelDataSection section
= new OriginalLabelDataSection(this, parentElement
, selectionProvider
, style
);
1789 addAndAdaptSection(parentElement
, section
);
1793 public NaturalLanguageSection
createNaturalLanguageSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1794 NaturalLanguageSection section
= new NaturalLanguageSection(this, parentElement
, selectionProvider
, style
);
1795 addAndAdaptSection(parentElement
, section
);
1799 public FeatureDistributionDetailSection
createFeatureDistributionDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1800 FeatureDistributionDetailSection section
= new FeatureDistributionDetailSection(this, parentElement
, selectionProvider
, style
);
1801 addAndAdaptSection(parentElement
, section
);
1805 public ClassificationDetailSection
createClassificationDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1806 ClassificationDetailSection section
= new ClassificationDetailSection(this, parentElement
, selectionProvider
, style
);
1807 addAndAdaptSection(parentElement
, section
);
1811 public TaxonNodeDetailSection
createTaxonNodeDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1812 TaxonNodeDetailSection section
= new TaxonNodeDetailSection(this, parentElement
, selectionProvider
, style
);
1813 addAndAdaptSection(parentElement
, section
);
1817 public PolytomousKeyDetailSection
createPolytomousKeyDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1818 PolytomousKeyDetailSection section
= new PolytomousKeyDetailSection(this, parentElement
, selectionProvider
, style
);
1819 addAndAdaptSection(parentElement
, section
);
1823 public PolytomousKeyNodeDetailSection
createPolytomousKeyNodeDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1824 PolytomousKeyNodeDetailSection section
= new PolytomousKeyNodeDetailSection(this, parentElement
, selectionProvider
, style
);
1825 addAndAdaptSection(parentElement
, section
);
1829 public InstitutionDetailSection
createInstitutionDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1830 InstitutionDetailSection section
= new InstitutionDetailSection(this, parentElement
, selectionProvider
, style
);
1831 addAndAdaptSection(parentElement
, section
);
1835 public FieldUnitFacadeGeneralDetailSection
createFieldUnitFacadeGeneralDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1836 FieldUnitFacadeGeneralDetailSection section
= new FieldUnitFacadeGeneralDetailSection(this, parentElement
, selectionProvider
, style
);
1837 addAndAdaptSection(parentElement
, section
);
1841 public DerivedUnitGeneralDetailSection
createDerivedUnitGeneralDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1842 DerivedUnitGeneralDetailSection section
= new DerivedUnitGeneralDetailSection(this, parentElement
, selectionProvider
, style
);
1843 addAndAdaptSection(parentElement
, section
);
1847 public PreservedSpecimenGeneralDetailSection
createPreservedSpecimenGeneralDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1848 PreservedSpecimenGeneralDetailSection section
= new PreservedSpecimenGeneralDetailSection(this, parentElement
, selectionProvider
, style
);
1849 addAndAdaptSection(parentElement
, section
);
1853 public TissueSampleGeneralDetailSection
createTissueSampleGeneralDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1854 TissueSampleGeneralDetailSection section
= new TissueSampleGeneralDetailSection(this, parentElement
, selectionProvider
, style
);
1855 addAndAdaptSection(parentElement
, section
);
1859 public DnaSampleGeneralDetailSection
createDnaSampleGeneralDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1860 DnaSampleGeneralDetailSection section
= new DnaSampleGeneralDetailSection(this, parentElement
, selectionProvider
, style
);
1861 addAndAdaptSection(parentElement
, section
);
1865 public DnaSamplePreparationPreservationSection
createDnaSamplePreparationPreservationSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1866 DnaSamplePreparationPreservationSection section
= new DnaSamplePreparationPreservationSection(this, parentElement
, selectionProvider
, style
);
1867 addAndAdaptSection(parentElement
, section
);
1871 public DnaQualityDetailSection
createDnaQualityDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1872 DnaQualityDetailSection section
= new DnaQualityDetailSection(this, parentElement
, selectionProvider
, style
);
1873 addAndAdaptSection(parentElement
, section
);
1877 public SequenceGeneralDetailSection
createSequenceGeneralDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1878 SequenceGeneralDetailSection section
= new SequenceGeneralDetailSection(this, parentElement
, selectionProvider
, style
);
1879 addAndAdaptSection(parentElement
, section
);
1883 public SequenceContigFileCollectionDetailSection
createSequenceContigFileCollectionDetailSection(ICdmFormElement parentElement
, int style
){
1884 SequenceContigFileCollectionDetailSection section
= new SequenceContigFileCollectionDetailSection(this, parentElement
, style
);
1885 addAndAdaptSection(parentElement
, section
);
1889 public SingleReadPherogramCollectionDetailSection
createSingleReadPherogramCollectionDetailSection(ICdmFormElement parentElement
, int style
){
1890 SingleReadPherogramCollectionDetailSection section
= new SingleReadPherogramCollectionDetailSection(this, parentElement
, style
);
1891 addAndAdaptSection(parentElement
, section
);
1895 public SequenceReferenceCollectionDetailSection
createSequenceReferenceCollectionDetailSection(ICdmFormElement parentElement
, int style
){
1896 SequenceReferenceCollectionDetailSection section
= new SequenceReferenceCollectionDetailSection(this, parentElement
, style
);
1897 addAndAdaptSection(parentElement
, section
);
1901 public SingleReadGeneralDetailSection
createSingleReadGeneralDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1902 SingleReadGeneralDetailSection section
= new SingleReadGeneralDetailSection(this, parentElement
, selectionProvider
, style
);
1903 addAndAdaptSection(parentElement
, section
);
1907 public AmplificationGeneralDetailSection
createAmplificationGeneralDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1908 AmplificationGeneralDetailSection section
= new AmplificationGeneralDetailSection(this, parentElement
, selectionProvider
, style
);
1909 addAndAdaptSection(parentElement
, section
);
1913 public AmplificationPrimerDetailSection
createAmplificationPrimerDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1914 AmplificationPrimerDetailSection section
= new AmplificationPrimerDetailSection(this, parentElement
, selectionProvider
, style
);
1915 addAndAdaptSection(parentElement
, section
);
1919 public AmplificationCloningDetailSection
createAmplificationCloningDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1920 AmplificationCloningDetailSection section
= new AmplificationCloningDetailSection(this, parentElement
, selectionProvider
, style
);
1921 addAndAdaptSection(parentElement
, section
);
1925 public AmplificationGelPhotoCollectionDetailSection
createAmplificationGelPhotoCollectionDetailSection(ICdmFormElement parentElement
, int style
){
1926 AmplificationGelPhotoCollectionDetailSection section
= new AmplificationGelPhotoCollectionDetailSection(this, parentElement
, style
);
1927 addAndAdaptSection(parentElement
, section
);
1931 public MediaSpecimenGeneralDetailSection
createMediaSpecimenGeneralDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1932 MediaSpecimenGeneralDetailSection section
= new MediaSpecimenGeneralDetailSection(this, parentElement
, selectionProvider
, style
);
1933 addAndAdaptSection(parentElement
, section
);
1937 public HybridDetailSection
createHybridDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1938 HybridDetailSection section
= new HybridDetailSection(this, parentElement
, selectionProvider
, style
);
1939 addAndAdaptSection(parentElement
, section
);
1943 public UserDetailSection
createUserDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1944 UserDetailSection section
= new UserDetailSection(this, parentElement
, selectionProvider
, style
);
1945 addAndAdaptSection(parentElement
, section
);
1949 public GroupDetailSection
createGroupDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1950 GroupDetailSection section
= new GroupDetailSection(this, parentElement
, selectionProvider
, style
);
1951 addAndAdaptSection(parentElement
, section
);
1955 public DeterminationDetailSection
createDeterminationDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1956 DeterminationDetailSection section
= new DeterminationDetailSection(this, parentElement
, selectionProvider
, style
);
1957 addAndAdaptSection(parentElement
, section
);
1961 public SampleDesignationDetailSection
createSampleDesignationDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1962 SampleDesignationDetailSection section
= new SampleDesignationDetailSection(this, parentElement
, selectionProvider
, style
);
1963 addAndAdaptSection(parentElement
, section
);
1967 public TaxonRelationshipDetailSection
createTaxonRelationshipDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1968 TaxonRelationshipDetailSection section
= new TaxonRelationshipDetailSection(this, parentElement
, selectionProvider
, style
, true);
1969 addAndAdaptSection(parentElement
, section
);
1973 public ReferencedEntityDetailSection
createReferencedEntityDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1974 ReferencedEntityDetailSection section
= new ReferencedEntityDetailSection(this, parentElement
, selectionProvider
, style
);
1975 addAndAdaptSection(parentElement
, section
);
1979 public TermVocabularyDetailSection
createTermVocabularyDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1980 TermVocabularyDetailSection section
= new TermVocabularyDetailSection(this, parentElement
, selectionProvider
, style
);
1981 addAndAdaptSection(parentElement
, section
);
1985 public GatheringEventDetailSection
createGatheringSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1986 GatheringEventDetailSection section
= new GatheringEventDetailSection(this, parentElement
, selectionProvider
, style
);
1987 addAndAdaptSection(parentElement
, section
);
1991 public NamedAreaDetailSection
createNamedAreaDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1992 NamedAreaDetailSection section
= new NamedAreaDetailSection(this, parentElement
, selectionProvider
, style
);
1993 addAndAdaptSection(parentElement
, section
);
1997 public UseRecordDetailSection
createUseRecordDetailSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1998 UseRecordDetailSection section
= new UseRecordDetailSection(this, parentElement
, selectionProvider
, style
);
1999 addAndAdaptSection(parentElement
, section
);
2003 private void addAndAdaptSection(ICdmFormElement parentElement
, AbstractFormSection
<?
> section
) {
2004 parentElement
.addElement(section
);
2008 //--------DetailElements------------
2010 public UseRecordDetailElement
createUseRecordDetailElement(ICdmFormElement parentElement
){
2011 UseRecordDetailElement element
= new UseRecordDetailElement(this, parentElement
);
2012 addAndAdaptElement(parentElement
, element
);
2016 public DefinedTermDetailElement
<NamedAreaLevel
> createNamedAreaLevelElement(ICdmFormElement parentElement
){
2017 DefinedTermDetailElement
<NamedAreaLevel
> element
= new DefinedTermDetailElement
<NamedAreaLevel
>(this, parentElement
);
2018 addAndAdaptElement(parentElement
, element
);
2022 public eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement
createNamedAreaDetailElement(ICdmFormElement parentElement
){
2023 eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement element
= new eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement(this, parentElement
);
2024 addAndAdaptElement(parentElement
, element
);
2028 public TermVocabularyDetailElement
createTermVocabularyDetailElement(ICdmFormElement parentElement
){
2029 TermVocabularyDetailElement element
= new TermVocabularyDetailElement(this, parentElement
);
2030 addAndAdaptElement(parentElement
, element
);
2034 public ReferenceEntityDetailElement
createReferenceEntityDetailElement(ICdmFormElement parentElement
){
2035 ReferenceEntityDetailElement element
= new ReferenceEntityDetailElement(this, parentElement
);
2036 addAndAdaptElement(parentElement
, element
);
2039 public OriginalSourceElement
createOriginalSourceElement(ICdmFormElement parentElement
, CdmBase cdmEntity
, String label
){
2040 OriginalSourceElement
<?
> element
= new OriginalSourceElement
<>(this, parentElement
, cdmEntity
, label
);
2041 addAndAdaptElement(parentElement
, element
);
2045 public SecundumSourceElement
createSecundumSourceElement(ICdmFormElement parentElement
, CdmBase cdmEntity
, String label
){
2046 SecundumSourceElement element
= new SecundumSourceElement(this, parentElement
, cdmEntity
, label
);
2047 addAndAdaptElement(parentElement
, element
);
2050 public NomenclaturalSourceElement
createNomenclaturalSourceElement(ICdmFormElement parentElement
, CdmBase cdmEntity
, String label
){
2051 NomenclaturalSourceElement element
= new NomenclaturalSourceElement(this, parentElement
, cdmEntity
, label
);
2052 addAndAdaptElement(parentElement
, element
);
2056 public TaxonRelationshipDetailElement
createTaxonRelationshipDetailElement(ICdmFormElement parentElement
){
2057 TaxonRelationshipDetailElement element
= new TaxonRelationshipDetailElement(this, parentElement
);
2058 addAndAdaptElement(parentElement
, element
);
2062 public GrantedAuthorityDetailElement
createGrantedAuthorityDetailElement(ICdmFormElement parentElement
){
2063 GrantedAuthorityDetailElement element
= new GrantedAuthorityDetailElement(this, parentElement
);
2064 addAndAdaptElement(parentElement
, element
);
2068 public GroupDetailElement
createGroupDetailElement(ICdmFormElement parentElement
){
2069 GroupDetailElement element
= new GroupDetailElement(this, parentElement
);
2070 addAndAdaptElement(parentElement
, element
);
2074 public UserDetailElement
createUserDetailElement(ICdmFormElement parentElement
){
2075 UserDetailElement element
= new UserDetailElement(this, parentElement
);
2076 addAndAdaptElement(parentElement
, element
);
2080 public HybridDetailElement
createHybridDetailElement(ICdmFormElement parentElement
){
2081 HybridDetailElement element
= new HybridDetailElement(this, parentElement
);
2082 addAndAdaptElement(parentElement
, element
);
2086 public InstitutionDetailElement
createInstitutionDetailElement(ICdmFormElement parentElement
){
2087 InstitutionDetailElement element
= new InstitutionDetailElement(this, parentElement
);
2088 addAndAdaptElement(parentElement
, element
);
2092 public PolytomousKeyNodeDetailElement
createPolytomousKeyNodeDetailElement(ICdmFormElement parentElement
){
2093 PolytomousKeyNodeDetailElement element
= new PolytomousKeyNodeDetailElement(this, parentElement
);
2094 addAndAdaptElement(parentElement
, element
);
2098 public PolytomousKeyDetailElement
createPolytomousKeyDetailElement(ICdmFormElement parentElement
){
2099 PolytomousKeyDetailElement element
= new PolytomousKeyDetailElement(this, parentElement
);
2100 addAndAdaptElement(parentElement
, element
);
2104 public CollectionDetailElement
createCollectionDetailElement(ICdmFormElement parentElement
){
2105 CollectionDetailElement element
= new CollectionDetailElement(this, parentElement
);
2106 addAndAdaptElement(parentElement
, element
);
2110 public TaxonNodeAgentRelationCollectionSection
createTaxonNodeAgentRelationCollectionElement(ICdmFormElement parentElement
, int style
){
2111 TaxonNodeAgentRelationCollectionSection element
= new TaxonNodeAgentRelationCollectionSection(this, parentElement
, style
);
2113 parentElement
.addElement(element
);
2118 public TaxonNodeDetailElement
createTaxonNodeDetailElement(ICdmFormElement parentElement
, boolean createNew
){
2119 TaxonNodeDetailElement element
= new TaxonNodeDetailElement(this, parentElement
, createNew
);
2120 addAndAdaptElement(parentElement
, element
);
2124 public ClassificationDetailElement
createClassificationDetailElement(ICdmFormElement parentElement
){
2125 ClassificationDetailElement element
= new ClassificationDetailElement(this, parentElement
);
2126 addAndAdaptElement(parentElement
, element
);
2130 public CloneClassificationDetailElement
createCloneClassificationDetailElement(ICdmFormElement parentElement
){
2131 CloneClassificationDetailElement element
= new CloneClassificationDetailElement(this, parentElement
);
2132 addAndAdaptElement(parentElement
, element
);
2136 public FeatureDistributionDetailElement
createFeatureDistributionDetailElement(ICdmFormElement parentElement
){
2137 FeatureDistributionDetailElement element
= new FeatureDistributionDetailElement(this, parentElement
);
2138 addAndAdaptElement(parentElement
, element
);
2142 public NaturalLanguageDetailElement
createNaturalLanguageDetailElement(ICdmFormElement parentElement
){
2143 NaturalLanguageDetailElement element
= new NaturalLanguageDetailElement(this, parentElement
);
2144 addAndAdaptElement(parentElement
, element
);
2148 public NonViralNameDetailElement
createNonViralNameDetailElement(ICdmFormElement parentElement
){
2149 NonViralNameDetailElement element
= new NonViralNameDetailElement(this, parentElement
);
2150 addAndAdaptElement(parentElement
, element
);
2154 public DescriptionElementDetailElement
createDescriptionElementDetailElement(ICdmFormElement parentElement
, int style
){
2155 DescriptionElementDetailElement element
= new DescriptionElementDetailElement(this, parentElement
, style
);
2156 addAndAdaptElement(parentElement
, element
);
2160 public DescriptionDetailElement
createDescriptionDetailElement(ICdmFormElement parentElement
, int style
){
2161 DescriptionDetailElement element
= new DescriptionDetailElement(this, parentElement
, style
);
2162 addAndAdaptElement(parentElement
, element
);
2166 public PersonDetailElement
createPersonDetailElement(ICdmFormElement parentElement
, int style
){
2167 PersonDetailElement element
= new PersonDetailElement(this, parentElement
, style
);
2168 addAndAdaptElement(parentElement
, element
);
2172 public TeamDetailElement
createTeamDetailElement(ICdmFormElement parentElement
, int style
, boolean isNomenclatural
, boolean isCollectorTeam
){
2173 TeamDetailElement element
= new TeamDetailElement(this, parentElement
, style
, isNomenclatural
, isCollectorTeam
);
2174 addAndAdaptElement(parentElement
, element
);
2178 public AuthorshipDetailElement
createAuthorshipDetailElement(ICdmFormElement parentElement
, int style
){
2179 AuthorshipDetailElement element
= new AuthorshipDetailElement(this, parentElement
, style
);
2180 addAndAdaptElement(parentElement
, element
);
2184 public TaxonBaseDetailElement
createTaxonBaseDetailElement(ICdmFormElement parentElement
, int style
){
2185 TaxonBaseDetailElement element
= new TaxonBaseDetailElement(this, parentElement
, style
);
2186 addAndAdaptElement(parentElement
, element
);
2190 public NameDetailElement
createNameDetailElement(ICdmFormElement parentElement
, int style
){
2191 NameDetailElement element
= new NameDetailElement(this, parentElement
, style
);
2192 addAndAdaptElement(parentElement
, element
);
2196 public ReferenceDetailElement
createReferenceDetailElement(ICdmFormElement parentElement
, int style
){
2197 ReferenceDetailElement element
= new ReferenceDetailElement(this, parentElement
, style
);
2198 addAndAdaptElement(parentElement
, element
);
2201 public ReferenceDetailElement
createNomenclaturalReferenceDetailElement(ICdmFormElement parentElement
, int style
){
2202 ReferenceDetailElement element
= new ReferenceDetailElement(this, parentElement
, true, style
);
2203 addAndAdaptElement(parentElement
, element
);
2207 public NomenclaturalSourceDetailElement
createNomenclaturalSourceDetailElement(ICdmFormElement parentElement
, int style
){
2208 NomenclaturalSourceDetailElement element
= new NomenclaturalSourceDetailElement(this, parentElement
, style
);
2209 addAndAdaptElement(parentElement
, element
);
2214 public FieldUnitFacadeGeneralDetailElement
createFieldUnitFacadeGeneralDetailElement(ICdmFormElement parentElement
){
2215 FieldUnitFacadeGeneralDetailElement element
= new FieldUnitFacadeGeneralDetailElement(this, parentElement
);
2216 addAndAdaptElement(parentElement
, element
);
2220 public DerivedUnitGeneralDetailElement
createDerivedUnitGeneralDetailElement(ICdmFormElement parentElement
){
2221 DerivedUnitGeneralDetailElement element
= new DerivedUnitGeneralDetailElement(this, parentElement
);
2222 addAndAdaptElement(parentElement
, element
);
2226 public TaxonAssociationDetailElement
createTaxonAssociationDetailElement(ICdmFormElement parentElement
){
2227 TaxonAssociationDetailElement element
= new TaxonAssociationDetailElement(this, parentElement
);
2228 addAndAdaptElement(parentElement
, element
);
2232 public PreservedSpecimenGeneralDetailElement
createPreservedSpecimenGeneralDetailElement(ICdmFormElement parentElement
){
2233 PreservedSpecimenGeneralDetailElement element
= new PreservedSpecimenGeneralDetailElement(this, parentElement
);
2234 addAndAdaptElement(parentElement
, element
);
2238 public TissueSampleGeneralDetailElement
createTissueSampleGeneralDetailElement(ICdmFormElement parentElement
){
2239 TissueSampleGeneralDetailElement element
= new TissueSampleGeneralDetailElement(this, parentElement
);
2240 addAndAdaptElement(parentElement
, element
);
2244 public DnaSampleGeneralDetailElement
createDnaSampleGeneralDetailElement(ICdmFormElement parentElement
){
2245 DnaSampleGeneralDetailElement element
= new DnaSampleGeneralDetailElement(this, parentElement
);
2246 addAndAdaptElement(parentElement
, element
);
2250 public DnaSamplePreparationPreservationDetailElement
createDnaSamplePreparationPreservationDetailElement(ICdmFormElement parentElement
){
2251 DnaSamplePreparationPreservationDetailElement element
= new DnaSamplePreparationPreservationDetailElement(this, parentElement
);
2252 addAndAdaptElement(parentElement
, element
);
2256 public DnaQualityDetailElement
createDnaQualityDetailElement(ICdmFormElement parentElement
){
2257 DnaQualityDetailElement element
= new DnaQualityDetailElement(this, parentElement
);
2258 addAndAdaptElement(parentElement
, element
);
2262 public SequenceGeneralDetailElement
createSequenceGeneralDetailElement(ICdmFormElement parentElement
){
2263 SequenceGeneralDetailElement element
= new SequenceGeneralDetailElement(this, parentElement
);
2264 addAndAdaptElement(parentElement
, element
);
2268 public SingleReadGeneralDetailElement
createSingleReadGeneralDetailElement(ICdmFormElement parentElement
){
2269 SingleReadGeneralDetailElement element
= new SingleReadGeneralDetailElement(this, parentElement
);
2270 addAndAdaptElement(parentElement
, element
);
2274 public PrimerGeneralDetailElement
createPrimerGeneralDetailElement(ICdmFormElement parentElement
){
2275 PrimerGeneralDetailElement element
= new PrimerGeneralDetailElement(this, parentElement
);
2276 addAndAdaptElement(parentElement
, element
);
2280 public AmplificationGeneralDetailElement
createAmplificationGeneralDetailElement(ICdmFormElement parentElement
){
2281 AmplificationGeneralDetailElement element
= new AmplificationGeneralDetailElement(this, parentElement
);
2282 addAndAdaptElement(parentElement
, element
);
2286 public AmplificationPrimerDetailElement
createAmplificationPrimerDetailElement(ICdmFormElement parentElement
){
2287 AmplificationPrimerDetailElement element
= new AmplificationPrimerDetailElement(this, parentElement
);
2288 addAndAdaptElement(parentElement
, element
);
2292 public AmplificationCloningDetailElement
createAmplificationCloningDetailElement(ICdmFormElement parentElement
){
2293 AmplificationCloningDetailElement element
= new AmplificationCloningDetailElement(this, parentElement
);
2294 addAndAdaptElement(parentElement
, element
);
2298 public AmplificationGelPhotoDetailElement
createAmplificationGelPhotoDetailElement(ICdmFormElement parentElement
){
2299 AmplificationGelPhotoDetailElement element
= new AmplificationGelPhotoDetailElement(this, parentElement
);
2300 addAndAdaptElement(parentElement
, element
);
2304 public MediaSpecimenGeneralDetailElement
createMediaSpecimenGeneralDetailElement(ICdmFormElement parentElement
){
2305 MediaSpecimenGeneralDetailElement element
= new MediaSpecimenGeneralDetailElement(this, parentElement
);
2306 addAndAdaptElement(parentElement
, element
);
2310 public MediaDetailElement
createMediaDetailElement(ICdmFormElement parentElement
){
2311 MediaDetailElement mediaDetailElement
= new MediaDetailElement(this, parentElement
);
2312 addAndAdaptElement(parentElement
, mediaDetailElement
);
2313 return mediaDetailElement
;
2316 public GatheringEventDetailElement
createGatheringEventDetailElement(ICdmFormElement parentElement
) {
2317 GatheringEventDetailElement element
= new GatheringEventDetailElement(this, parentElement
);
2318 addAndAdaptElement(parentElement
, element
);
2322 public FieldUnitFacadeDetailElement
createFieldUnitFacadeDetailElement(ICdmFormElement parentElement
) {
2323 FieldUnitFacadeDetailElement element
= new FieldUnitFacadeDetailElement(this, parentElement
);
2324 addAndAdaptElement(parentElement
, element
);
2328 public DerivedUnitBaseDetailElement
createDerivedUnitBaseDetailElement(ICdmFormElement parentElement
) {
2329 DerivedUnitBaseDetailElement element
= new DerivedUnitBaseDetailElement(this, parentElement
);
2330 addAndAdaptElement(parentElement
, element
);
2334 public OriginalLabelDataElement
createOriginalLabelDataElement(ICdmFormElement parentElement
) {
2335 OriginalLabelDataElement element
= new OriginalLabelDataElement(this, parentElement
);
2336 addAndAdaptElement(parentElement
, element
);
2340 public PreservedSpecimenDetailElement
createPreservedSpecimenDetailElement(ICdmFormElement parentElement
) {
2341 PreservedSpecimenDetailElement element
= new PreservedSpecimenDetailElement(this, parentElement
);
2342 addAndAdaptElement(parentElement
, element
);
2346 public DeterminationDetailElement
createDeterminationDetailElement(ICdmFormElement parentElement
) {
2347 DeterminationDetailElement element
= new DeterminationDetailElement(this, parentElement
);
2348 addAndAdaptElement(parentElement
, element
);
2352 public SampleDesignationDetailElement
createSampleDesignationDetailElement(ICdmFormElement parentElement
) {
2353 SampleDesignationDetailElement element
= new SampleDesignationDetailElement(this, parentElement
);
2354 addAndAdaptElement(parentElement
, element
);
2358 private void addAndAdaptElement(ICdmFormElement parentElement
, AbstractCdmDetailElement
<?
> element
) {
2360 parentElement
.addElement(element
);
2363 //--------EntityCollectionSection----------
2364 public TeamMemberSection
createTeamMemberSection(ICdmFormElement parentElement
, int style
, boolean isNomenclatural
, boolean isCollector
){
2365 TeamMemberSection section
= new TeamMemberSection(this, parentElement
, style
, isNomenclatural
, isCollector
);
2366 addAndAdaptSection(parentElement
, section
);
2370 public InapplicableIfEntityCollectionSection
createInapplicableIfEntityCollectionSection(ICdmFormElement parentElement
, int style
){
2371 InapplicableIfEntityCollectionSection section
= new InapplicableIfEntityCollectionSection(this, parentElement
, style
);
2372 addAndAdaptSection(parentElement
, section
);
2376 public OnlyApplicableIfEntityCollectionSection
createOnlyApplicableIfEntityCollectionSection(ICdmFormElement parentElement
, int style
){
2377 OnlyApplicableIfEntityCollectionSection section
= new OnlyApplicableIfEntityCollectionSection(this, parentElement
, style
);
2378 addAndAdaptSection(parentElement
, section
);
2382 public InapplicableIfEntityCollectionSectionForNode
createInapplicableIfEntityCollectionSectionForNode(ICdmFormElement parentElement
, int style
){
2383 InapplicableIfEntityCollectionSectionForNode section
= new InapplicableIfEntityCollectionSectionForNode(this, parentElement
, style
);
2384 addAndAdaptSection(parentElement
, section
);
2388 public OnlyApplicableIfEntityCollectionSectionForNode
createOnlyApplicableIfEntityCollectionSectionForNode(ICdmFormElement parentElement
, int style
){
2389 OnlyApplicableIfEntityCollectionSectionForNode section
= new OnlyApplicableIfEntityCollectionSectionForNode(this, parentElement
, style
);
2390 addAndAdaptSection(parentElement
, section
);
2394 public AnnotationSection
createAnnotationSection(ICdmFormElement parentElement
, int style
){
2395 AnnotationSection section
= new AnnotationSection(this, parentElement
, style
);
2396 addAndAdaptSection(parentElement
, section
);
2400 public CreditSection
createCreditSection(ICdmFormElement parentElement
, int style
){
2401 CreditSection section
= new CreditSection(this, parentElement
, style
);
2402 addAndAdaptSection(parentElement
, section
);
2405 public DescriptionElementSourceSection
createDescriptionElementSourceSection(ICdmFormElement parentElement
, int style
){
2406 DescriptionElementSourceSection section
= new DescriptionElementSourceSection(this, parentElement
, style
);
2407 addAndAdaptSection(parentElement
, section
);
2410 public DescriptionElementSourceSection
createDescriptionElementSourceSection(ICdmFormElement parentElement
, Reference defaultSource
, int style
){
2411 DescriptionElementSourceSection section
= new DescriptionElementSourceSection(this, parentElement
, defaultSource
, style
);
2412 addAndAdaptSection(parentElement
, section
);
2416 public ExtensionSection
createExtensionSection(ICdmFormElement parentElement
, int style
){
2417 ExtensionSection section
= new ExtensionSection(this, parentElement
, style
);
2418 addAndAdaptSection(parentElement
, section
);
2422 public MarkerSection
createMarkerSection(ICdmFormElement parentElement
, int style
){
2423 MarkerSection section
= new MarkerSection(this, parentElement
, style
);
2424 addAndAdaptSection(parentElement
, section
);
2428 public MediaSection
createMediaSection(ICdmFormElement parentElement
, int style
){
2429 MediaSection section
= new MediaSection(this, parentElement
, style
);
2430 addAndAdaptSection(parentElement
, section
);
2434 public DescriptionElementMediaSection
createDescriptionElementMediaSection(ICdmFormElement parentElement
, int style
){
2435 DescriptionElementMediaSection section
= new DescriptionElementMediaSection(this, parentElement
, style
);
2436 addAndAdaptSection(parentElement
, section
);
2440 public MediaRepresentationSection
createMediaRepresentationSection(ICdmFormElement parentElement
, int style
){
2441 MediaRepresentationSection section
= new MediaRepresentationSection(this, parentElement
, style
);
2442 addAndAdaptSection(parentElement
, section
);
2446 public MediaRepresentationPartSection
createMediaRepresentationPartSection(ICdmFormElement parentElement
, int style
){
2447 MediaRepresentationPartSection section
= new MediaRepresentationPartSection(this, parentElement
, style
);
2448 addAndAdaptSection(parentElement
, section
);
2452 public ModifierSection
createModifierSection(ICdmFormElement parentElement
, int style
){
2453 ModifierSection section
= new ModifierSection(this, parentElement
, style
);
2454 addAndAdaptSection(parentElement
, section
);
2458 public NomenclaturalStatusSection
createNomenclaturalStatusSection(ICdmFormElement parentElement
, int style
){
2459 NomenclaturalStatusSection section
= new NomenclaturalStatusSection(this, parentElement
, style
);
2460 addAndAdaptSection(parentElement
, section
);
2464 public NameRelationshipDetailSection
createNameRelationshipDetailSection(ICdmFormElement parentElement
, int style
){
2465 NameRelationshipDetailSection section
= new NameRelationshipDetailSection(this, parentElement
, style
);
2466 addAndAdaptSection(parentElement
, section
);
2470 public ExternalLinksSection
createExternalLinksSection(ICdmFormElement parentElement
, int style
){
2471 ExternalLinksSection section
= new ExternalLinksSection(this, parentElement
, style
);
2472 addAndAdaptSection(parentElement
, section
);
2476 public ExternalLinksSection
createExternalLinksSection(ICdmFormElement parentElement
, String label
, int style
){
2477 ExternalLinksSection section
= new ExternalLinksSection(this, parentElement
, true, label
, style
);
2478 addAndAdaptSection(parentElement
, section
);
2482 public ExternalLinksSection
createExternalLinksSection(ICdmFormElement parentElement
, String label
, boolean isWithTypeAndDesc
, int style
){
2483 ExternalLinksSection section
= new ExternalLinksSection(this, parentElement
, isWithTypeAndDesc
, label
, style
);
2484 addAndAdaptSection(parentElement
, section
);
2488 public RightsSection
createRightsSection(ICdmFormElement parentElement
, int style
){
2489 RightsSection section
= new RightsSection(this, parentElement
, style
);
2491 addAndAdaptSection(parentElement
, section
);
2495 public SourceSection
createSourceSection(ICdmFormElement parentElement
, int style
){
2496 SourceSection section
= new SourceSection(this, parentElement
, style
);
2497 addAndAdaptSection(parentElement
, section
);
2501 public ScopeSection
createScopeSection(ICdmFormElement parentElement
, int style
){
2502 ScopeSection section
= new ScopeSection(this, parentElement
, style
);
2503 addAndAdaptSection(parentElement
, section
);
2507 public DescriptionSourceSection
createDescriptionSourceSection(ICdmFormElement parentElement
, int style
){
2508 DescriptionSourceSection section
= new DescriptionSourceSection(this, parentElement
, style
);
2509 addAndAdaptSection(parentElement
, section
);
2513 public TypeDesignationSection
createTypeDesignationSection(ICdmFormElement parentElement
, int style
){
2514 TypeDesignationSection section
= new TypeDesignationSection(this, parentElement
, style
);
2515 addAndAdaptSection(parentElement
, section
);
2519 public StateDataSection
createStateDataSection(ICdmFormElement parentElement
, int style
){
2520 StateDataSection section
= new StateDataSection(this, parentElement
, style
);
2521 addAndAdaptSection(parentElement
, section
);
2525 public StatisticalMeasurementValueSection
createStatisticalMeasurementValueSection(ICdmFormElement parentElement
, int style
){
2526 StatisticalMeasurementValueSection section
= new StatisticalMeasurementValueSection(this, parentElement
, style
);
2527 addAndAdaptSection(parentElement
, section
);
2531 public DescribedSpecimenSection
createDescribedSpecimenSection(ICdmFormElement parentElement
, int style
){
2532 DescribedSpecimenSection section
= new DescribedSpecimenSection(this, parentElement
, style
);
2533 addAndAdaptSection(parentElement
, section
);
2537 public StateVocabularyCollectionSection
createStateVocabulariesSection(ICdmFormElement parentElement
, int style
){
2538 StateVocabularyCollectionSection section
= new StateVocabularyCollectionSection(this, parentElement
, style
);
2539 addAndAdaptSection(parentElement
, section
);
2543 public StateVocabularyDtoCollectionSection
createStateVocabulariesDtoSection(ICdmFormElement parentElement
, int style
){
2544 StateVocabularyDtoCollectionSection section
= new StateVocabularyDtoCollectionSection(this, parentElement
, style
);
2545 addAndAdaptSection(parentElement
, section
);
2549 public RecommendedModifierVocabulariesCollectionSection
createRecommendedModifierVocabulariesCollectionSection(ICdmFormElement parentElement
, int style
){
2550 RecommendedModifierVocabulariesCollectionSection section
= new RecommendedModifierVocabulariesCollectionSection(this, parentElement
, style
);
2551 addAndAdaptSection(parentElement
, section
);
2554 public RecommendedModifierVocabulariesDtoCollectionSection
createRecommendedModifierVocabulariesDtoCollectionSection(ICdmFormElement parentElement
, int style
){
2555 RecommendedModifierVocabulariesDtoCollectionSection section
= new RecommendedModifierVocabulariesDtoCollectionSection(this, parentElement
, style
);
2556 addAndAdaptSection(parentElement
, section
);
2560 public MeasurementUnitCollectionSection
createMeasurementUnitCollectionSection(ICdmFormElement parentElement
, int style
){
2561 MeasurementUnitCollectionSection section
= new MeasurementUnitCollectionSection(this, parentElement
, style
);
2562 addAndAdaptSection(parentElement
, section
);
2566 public MeasurementUnitDtoCollectionSection
createMeasurementUnitDtoCollectionSection(ICdmFormElement parentElement
, int style
){
2567 MeasurementUnitDtoCollectionSection section
= new MeasurementUnitDtoCollectionSection(this, parentElement
, style
);
2568 addAndAdaptSection(parentElement
, section
);
2571 public StatisticalMeasureCollectionSection
createStatisticalMeasureCollectionSection(ICdmFormElement parentElement
, int style
){
2572 StatisticalMeasureCollectionSection section
= new StatisticalMeasureCollectionSection(this, parentElement
, style
);
2573 addAndAdaptSection(parentElement
, section
);
2577 public StatisticalMeasureDtoCollectionSection
createStatisticalMeasureDtoCollectionSection(ICdmFormElement parentElement
, int style
){
2578 StatisticalMeasureDtoCollectionSection section
= new StatisticalMeasureDtoCollectionSection(this, parentElement
, style
);
2579 addAndAdaptSection(parentElement
, section
);
2583 public CollectingAreasDetailSection
createCollectingAreasDetailSection(ICdmFormElement parentElement
, int style
){
2584 CollectingAreasDetailSection section
= new CollectingAreasDetailSection(this, parentElement
, style
);
2585 addAndAdaptSection(parentElement
, section
);
2589 public GeoScopeDetailSection
createGeoScopeDetailSection(ICdmFormElement parentElement
, int style
){
2590 GeoScopeDetailSection section
= new GeoScopeDetailSection(this, parentElement
, style
);
2591 addAndAdaptSection(parentElement
, section
);
2595 public GeoScopePolyKeyDetailSection
createGeoScopePolyKeyDetailSection(ICdmFormElement parentElement
, int style
){
2596 GeoScopePolyKeyDetailSection section
= new GeoScopePolyKeyDetailSection(this, parentElement
, style
);
2597 addAndAdaptSection(parentElement
, section
);
2601 public IdentifierSection
createIdentifierDetailSection(ICdmFormElement parentElement
, int style
){
2602 IdentifierSection section
= new IdentifierSection(this, parentElement
, style
);
2603 addAndAdaptSection(parentElement
, section
);
2607 public DerivedUnitFacadeIdentifierSection
createDerivedUnitFacadeIdentifierSection(ICdmFormElement parentElement
, int style
){
2608 DerivedUnitFacadeIdentifierSection section
= new DerivedUnitFacadeIdentifierSection(this, parentElement
, style
);
2609 addAndAdaptSection(parentElement
, section
);
2613 public CurrentSampleDesignationDetailSection
createCurrentSampleDesignationDetailSection(ICdmFormElement parentElement
, int style
){
2614 CurrentSampleDesignationDetailSection section
= new CurrentSampleDesignationDetailSection(this, parentElement
, style
);
2615 addAndAdaptSection(parentElement
, section
);
2619 public CurrentDeterminationDetailSection
createCurrentDeterminationDetailSection(ICdmFormElement parentElement
, int style
){
2620 CurrentDeterminationDetailSection section
= new CurrentDeterminationDetailSection(this, parentElement
, style
);
2621 addAndAdaptSection(parentElement
, section
);
2625 public PreservedSpecimenCurrentDeterminationDetailSection
createPreservedSpecimenCurrentDeterminationDetailSection(ICdmFormElement parentElement
, int style
){
2626 PreservedSpecimenCurrentDeterminationDetailSection section
= new PreservedSpecimenCurrentDeterminationDetailSection(this, parentElement
, style
);
2627 addAndAdaptSection(parentElement
, section
);
2631 public SampleDesignationHistoryDetailSection
createSampleDesignationHistoryDetailSection(ICdmFormElement parentElement
, int style
){
2632 SampleDesignationHistoryDetailSection section
= new SampleDesignationHistoryDetailSection(this, parentElement
, style
);
2633 addAndAdaptSection(parentElement
, section
);
2637 public DeterminationHistoryDetailSection
createDeterminationHistoryDetailSection(ICdmFormElement parentElement
, int style
){
2638 DeterminationHistoryDetailSection section
= new DeterminationHistoryDetailSection(this, parentElement
, style
);
2639 addAndAdaptSection(parentElement
, section
);
2643 public SpecimenCollectionDetailSection
createSpecimenCollectionDetailSection(ICdmFormElement parentElement
, int style
){
2644 SpecimenCollectionDetailSection section
= new SpecimenCollectionDetailSection(this, parentElement
, style
);
2645 addAndAdaptSection(parentElement
, section
);
2649 public PreservedSpecimenSourceCollectionDetailSection
createPreservedSpecimenSourceCollectionDetailSection(ICdmFormElement parentElement
, int style
){
2650 PreservedSpecimenSourceCollectionDetailSection section
= new PreservedSpecimenSourceCollectionDetailSection(this, parentElement
, style
);
2651 addAndAdaptSection(parentElement
, section
);
2655 public SourceCollectionDetailSection
createSourceCollectionDetailSection(ICdmFormElement parentElement
, int style
){
2656 SourceCollectionDetailSection section
= new SourceCollectionDetailSection(this, parentElement
, style
);
2657 addAndAdaptSection(parentElement
, section
);
2661 public StatusCollectionDetailSection
createStatusCollectionDetailSection(ICdmFormElement parentElement
, int style
){
2662 StatusCollectionDetailSection section
= new StatusCollectionDetailSection(this, parentElement
, style
);
2663 addAndAdaptSection(parentElement
, section
);
2667 public ScopeRestrictionSection
createScopeRestrictionSection(ICdmFormElement parentElement
, int style
){
2668 ScopeRestrictionSection section
= new ScopeRestrictionSection(this, parentElement
, style
);
2669 addAndAdaptSection(parentElement
, section
);
2673 public MemberDetailSection
createMemberDetailSection(ICdmFormElement parentElement
, int style
){
2674 MemberDetailSection section
= new MemberDetailSection(this, parentElement
, style
);
2675 addAndAdaptSection(parentElement
, section
);
2679 public GrantedAuthorityDetailSection
createGrantedAuthorityDetailSection(ICdmFormElement parentElement
, int style
){
2680 GrantedAuthorityDetailSection section
= new GrantedAuthorityDetailSection(this, parentElement
, style
);
2681 addAndAdaptSection(parentElement
, section
);
2685 public GroupsByUserDetailSection
createGroupsByUserDetailSection(ICdmFormElement parentElement
, int style
){
2686 GroupsByUserDetailSection section
= new GroupsByUserDetailSection(this, parentElement
, style
);
2687 addAndAdaptSection(parentElement
, section
);
2691 public TaxonomicScopeSection
createTaxonomicScopeSection(ICdmFormElement parentElement
, int style
){
2692 TaxonomicScopeSection section
= new TaxonomicScopeSection(this, parentElement
, style
);
2693 addAndAdaptSection(parentElement
, section
);
2697 public AbstractEntityCollectionElement
createEntityCollectionElement(AbstractFormSection parentElement
,
2698 Object versionableEntity
, SelectionListener removeListener
, Color backgroundColor
, int style
) {
2699 AbstractEntityCollectionElement
<?
> element
= null;
2701 Object entity
= HibernateProxyHelper
.deproxy(versionableEntity
);
2703 if (entity
instanceof Annotation
) {
2704 element
= new AnnotationElement(this, parentElement
, (Annotation
) entity
, removeListener
, style
);
2705 }else if (entity
instanceof Person
) {
2706 boolean isNomenclatural
= false;
2707 if (parentElement
instanceof TeamMemberSection
){
2708 isNomenclatural
= ((TeamMemberSection
) parentElement
).isNomenclaturalTeam();
2710 if (isNomenclatural
){
2711 element
= new NomenclaturalTeamMemberElement(this, parentElement
, (Person
) entity
, removeListener
, style
);
2713 element
= new TeamMemberElement(this, parentElement
, (Person
) entity
, removeListener
, style
);
2715 } else if (entity
instanceof Credit
) {
2716 element
= new CreditElement(this, parentElement
, (Credit
) entity
, removeListener
, style
);
2717 } else if (entity
instanceof Extension
) {
2718 element
= new ExtensionElement(this, parentElement
, (Extension
) entity
, removeListener
, style
);
2719 } else if (entity
instanceof ExternalLink
) {
2720 boolean isAdvanced
= true;
2721 if(parentElement
instanceof ExternalLinksSection
){
2722 isAdvanced
= ((ExternalLinksSection
)parentElement
).isAdvanced();
2724 element
= new ExternalLinksElement(this, parentElement
, (ExternalLink
) entity
, isAdvanced
, removeListener
, style
);
2725 } else if (entity
instanceof Marker
) {
2726 element
= new MarkerElement(this, parentElement
, (Marker
) entity
, removeListener
, style
);
2727 } else if (entity
instanceof TaxonNodeAgentRelation
) {
2728 element
= new TaxonNodeAgentRelationCollectionElement(this, parentElement
, (TaxonNodeAgentRelation
) entity
, removeListener
, backgroundColor
, style
);
2729 }else if (entity
instanceof Media
) {
2730 element
= new MediaMetaElement(this, parentElement
, (Media
) entity
, removeListener
, style
);
2731 } else if (entity
instanceof MediaRepresentation
) {
2732 element
= new MediaRepresentationElement(this, parentElement
, (MediaRepresentation
) entity
, removeListener
,
2734 } else if (entity
instanceof ImageFile
) {
2735 element
= new ImageFileElement(this, parentElement
, (ImageFile
) entity
, removeListener
, style
);
2736 } else if (entity
instanceof MediaRepresentationPart
) {
2737 element
= new MediaRepresentationPartElement
<>(this, parentElement
, (MediaRepresentationPart
) entity
,
2738 removeListener
, style
);
2739 } else if (entity
instanceof NomenclaturalStatus
) {
2740 element
= new NomenclaturalStatusElement(this, parentElement
, (NomenclaturalStatus
) entity
, removeListener
,
2742 } else if (entity
instanceof Rights
) {
2743 element
= new RightsElement(this, parentElement
, (Rights
) entity
, removeListener
, style
);
2744 } else if (entity
instanceof DescriptionElementSource
&& parentElement
.getEntity() instanceof CommonTaxonName
) {
2745 element
= new CommonNameSourceElement(this, parentElement
, (DescriptionElementSource
) entity
,
2746 removeListener
, style
);
2747 } else if (entity
instanceof DescriptionElementSource
&& parentElement
.getEntity() instanceof Distribution
) {
2748 Composite parent
= null;
2749 if (parentElement
instanceof DescriptionElementSourceSection
){
2750 parent
= ((DescriptionElementSourceSection
)parentElement
).getParent();
2752 element
= new DescriptionElementSourceElement(this, parentElement
, (DescriptionElementSource
) entity
,
2753 removeListener
, style
, false);
2754 } else if (entity
instanceof DescriptionElementSource
) {
2755 element
= new DescriptionElementSourceElement(this, parentElement
, (DescriptionElementSource
) entity
,
2756 removeListener
, style
, false);
2757 }else if (entity
instanceof TaxonNodeAgentRelation
) {
2758 element
= new TaxonNodeAgentRelationCollectionElement(this, parentElement
, (TaxonNodeAgentRelation
) entity
,
2759 removeListener
,backgroundColor
, style
);
2760 }else if (entity
instanceof IdentifiableSource
&& parentElement
.getEntity() instanceof DescriptionElementBase
) {
2761 element
= new IdentifiableSourceElement(this, parentElement
, (IdentifiableSource
) entity
, removeListener
,
2763 } else if (entity
instanceof IdentifiableSource
) {
2764 element
= new IdentifiableSourceElement(this, parentElement
, (IdentifiableSource
) entity
, removeListener
,
2766 } else if (entity
instanceof DefinedTerm
) {
2767 switch(((DefinedTerm
)entity
).getTermType()) {
2769 element
= new ScopeElement(this,
2771 (DefinedTerm
) entity
,
2776 element
= new ModifierElement(this,
2778 (DefinedTerm
) entity
,
2786 } else if (entity
instanceof Reference
) {
2787 if(parentElement
instanceof SequenceReferenceCollectionDetailSection
){
2788 element
= new SequenceReferenceCollectionDetailElement(this, parentElement
, (Reference
) entity
, removeListener
, style
);
2791 element
= new DescriptionSourceElement(this, parentElement
, (Reference
) entity
, removeListener
, style
);
2793 } else if (entity
instanceof NameTypeDesignation
) {
2794 element
= new NameTypeDesignationElement(this, parentElement
, (NameTypeDesignation
) entity
, removeListener
,
2796 } else if (entity
instanceof TextualTypeDesignation
) {
2797 element
= new TextTypeDesignationElement(this, parentElement
, (TextualTypeDesignation
) entity
, removeListener
,
2799 } else if (entity
instanceof NameRelationship
) {
2800 element
= new NameRelationshipDetailElement(this, parentElement
, (NameRelationship
) entity
, removeListener
,
2802 } else if (entity
instanceof SpecimenTypeDesignation
) {
2803 if(parentElement
instanceof DerivedUnitTypeDesignationSection
){
2804 element
= new DerivedUnitTypeDesignationElement(this, parentElement
, (SpecimenTypeDesignation
) entity
,
2805 removeListener
, style
);
2808 element
= new SpecimenTypeDesignationElement(this, parentElement
, (SpecimenTypeDesignation
) entity
,
2809 removeListener
, style
);
2811 } else if (entity
instanceof StateData
) {
2812 element
= new StateDataElement(this, parentElement
, (StateData
) entity
, removeListener
, style
);
2813 } else if (entity
instanceof StatisticalMeasurementValue
) {
2814 element
= new StatisticalMeasurementValueElement(this, parentElement
, (StatisticalMeasurementValue
) entity
,
2815 removeListener
, style
);
2816 } else if (entity
instanceof DerivedUnit
) {
2817 switch(((DerivedUnit
)entity
).getRecordBasis()) {
2818 case LivingSpecimen
:
2819 case PreservedSpecimen
:
2821 element
= new SpecimenCollectionDetailElement(this,
2823 (DerivedUnit
) entity
,
2828 element
= new DerivedUnitElement(this,
2830 (DerivedUnit
) entity
,
2834 } else if (entity
instanceof NamedArea
) {
2835 element
= new CollectingAreaDetailElement(this, parentElement
, (NamedArea
) entity
, removeListener
, style
);
2836 } else if (entity
instanceof DeterminationEvent
) {
2837 element
= new DeterminationEventDetailElement(this, parentElement
, (DeterminationEvent
) entity
, removeListener
, style
);
2838 } else if (entity
instanceof User
) {
2839 element
= new MemberDetailElement(this, parentElement
, (User
) entity
, removeListener
, style
);
2840 } else if (entity
instanceof GrantedAuthority
) {
2841 element
= new GrantedAuthorityCollectionElement(this, parentElement
, (GrantedAuthorityImpl
) entity
, ((Group
)parentElement
.getEntity()),
2842 removeListener
, style
);
2843 } else if (entity
instanceof Group
) {
2844 element
= new GroupsByUserDetailElement(this, parentElement
, (Group
) entity
, removeListener
, style
);
2845 } else if (entity
instanceof Taxon
) {
2846 element
= new TaxonDetailElement(this, parentElement
, (Taxon
) entity
, removeListener
, style
);
2847 } else if (entity
instanceof DescriptionElementBase
) {
2848 // this is the special case for protologs, maybe we can do this
2849 // differently when API improves
2850 DescriptionElementBase descriptionElement
= (DescriptionElementBase
) entity
;
2851 // if (descriptionElement.getFeature().equals(Feature.PROTOLOGUE())) {
2852 // element = new ProtologueElement(this, parentElement, descriptionElement, removeListener, style);
2854 } else if (entity
instanceof Identifier
) {
2855 if(parentElement
instanceof AbstractSampleDesignationDetailSection
){
2856 element
= new SampleDesignationTextDetailElement(this, parentElement
, (Identifier
) entity
, removeListener
, backgroundColor
, style
);
2859 element
= new IdentifierElement(this, parentElement
, (Identifier
) entity
, removeListener
, style
);
2861 } else if (entity
instanceof TermVocabulary
) {
2862 TermVocabulary
<?
> termVocabulary
= (TermVocabulary
<?
>)entity
;
2863 switch (termVocabulary
.getTermType()) {
2865 element
= new StateVocabularyCollectionElement(this, parentElement
, (TermVocabulary
<State
>) entity
, removeListener
, backgroundColor
, style
);
2868 element
= new RecommendedModifierVocabulariesElement(this, parentElement
, (TermVocabulary
<DefinedTerm
>) entity
, removeListener
, backgroundColor
, style
);
2873 }else if (entity
instanceof TermVocabularyDto
) {
2874 TermVocabularyDto termVocabulary
= (TermVocabularyDto
)entity
;
2875 switch (termVocabulary
.getTermType()) {
2877 element
= new StateVocabularyDtoCollectionElement(this, parentElement
, termVocabulary
, removeListener
, backgroundColor
, style
);
2880 element
= new RecommendedModifierDtoVocabulariesElement(this, parentElement
, termVocabulary
, removeListener
, backgroundColor
, style
);
2885 }else if (entity
instanceof MeasurementUnit
) {
2886 element
= new MeasurementUnitCollectionElement(this, parentElement
, (MeasurementUnit
) entity
, removeListener
, backgroundColor
, style
);
2887 }else if (entity
instanceof TermDto
) {
2888 if(((TermDto
)entity
).getTermType().equals(TermType
.MeasurementUnit
)){
2889 element
= new MeasurementUnitDtoCollectionElement(this, parentElement
, (TermDto
) entity
, removeListener
, backgroundColor
, style
);
2890 }else if (((TermDto
)entity
).getTermType().equals(TermType
.StatisticalMeasure
)){
2891 element
= new StatisticalMeasureDtoCollectionElement(this, parentElement
, (TermDto
) entity
, removeListener
, backgroundColor
, style
);
2893 }else if (entity
instanceof StatisticalMeasure
) {
2894 element
= new StatisticalMeasureCollectionElement(this, parentElement
, (StatisticalMeasure
) entity
, removeListener
, backgroundColor
, style
);
2895 } else if (entity
instanceof FeatureState
&& parentElement
instanceof InapplicableIfEntityCollectionSection
) {
2896 element
= new InapplicableIfCollectionElement(this, parentElement
, (FeatureState
) entity
, removeListener
, backgroundColor
, style
);
2897 } else if (entity
instanceof FeatureState
&& parentElement
instanceof OnlyApplicableIfEntityCollectionSection
) {
2898 element
= new OnlyApplicableIfCollectionElement(this, parentElement
, (FeatureState
) entity
, removeListener
, backgroundColor
, style
);
2899 } else if (entity
instanceof FeatureState
&& parentElement
instanceof InapplicableIfEntityCollectionSectionForNode
) {
2900 element
= new InapplicableIfCollectionElement(this, parentElement
, (FeatureState
) entity
, removeListener
, backgroundColor
, style
);
2901 } else if (entity
instanceof FeatureState
&& parentElement
instanceof OnlyApplicableIfEntityCollectionSectionForNode
) {
2902 element
= new OnlyApplicableIfCollectionElement(this, parentElement
, (FeatureState
) entity
, removeListener
, backgroundColor
, style
);
2903 } else if (entity
instanceof FeatureStateDto
&& parentElement
instanceof InapplicableIfEntityCollectionSection
) {
2904 element
= new InapplicableIfCollectionElementForDto(this, parentElement
, (FeatureStateDto
) entity
, removeListener
, backgroundColor
, style
);
2905 } else if (entity
instanceof FeatureStateDto
&& parentElement
instanceof OnlyApplicableIfEntityCollectionSection
) {
2906 element
= new OnlyApplicableIfCollectionElementForDto(this, parentElement
, (FeatureStateDto
) entity
, removeListener
, backgroundColor
, style
);
2907 }else if (entity
instanceof OccurrenceStatus
) {
2908 element
= new OccurrenceStatusElement(this, parentElement
, (OccurrenceStatus
)entity
, removeListener
, style
);
2911 //check for parent section when entity is null
2912 //this happens when AbstractUnboundEntityCollectionSection is used
2914 if(parentElement
instanceof ScopeSection
|| parentElement
instanceof ScopeRestrictionSection
){
2915 element
= new ScopeElement(this,
2917 (DefinedTerm
) entity
,
2921 else if(parentElement
instanceof ModifierSection
){
2922 element
= new ModifierElement(this,
2924 (DefinedTerm
) entity
,
2931 if (element
== null) {
2932 MessagingUtils
.messageDialog(
2933 String
.format("Error when creating section %s",
2934 parentElement
.getClass().getSimpleName()),
2936 String
.format("Could not generate collection element for entity of class %s."
2937 + " Looks like the case is not yet handled. Check implementation.\n"
2938 + "Entity: %s", entity
.getClass(), entity
.toString()), null);
2942 if (backgroundColor
!= null && !backgroundColor
.isDisposed()) {
2943 element
.setPersistentBackground(backgroundColor
);
2946 parentElement
.addElement(element
);
2954 * Creates a selection element for the given type T.
2957 * <strong>Selection elements not handled by this method:</strong>
2959 * <li>{@link TaxonNodeSelectionElement} see
2960 * {@link #createTaxonNodeSelectionElement(ICdmFormElement, String, TaxonNode, int, int)}
2962 * <li>{@link NomenclaturalAuthorTeamSelectionElement} see
2963 * {@link #createNomenclaturalAuthorTeamSelectionElement(ICdmFormElement, String, Team, int, int)}
2968 public <T
extends CdmBase
> EntitySelectionElement
<T
> createSelectionElement(Class
<T
> clazz
,
2969 ICdmFormElement parentElement
, String labelString
, T selection
, int mode
,
2970 int style
, Integer limit
) {
2971 EntitySelectionElement
<T
> element
= new EntitySelectionElement
<T
>(this,
2972 parentElement
, clazz
,
2973 labelString
, selection
, mode
, style
, limit
);
2975 parentElement
.addElement(element
);
2979 public <T
extends CdmBase
> EntitySelectionElement
<T
> createSelectionElement(Class
<T
> clazz
,
2980 ICdmFormElement parentElement
, String labelString
, T selection
, int mode
,
2981 int style
, boolean filterElement
) {
2982 EntitySelectionElement
<T
> element
= new EntitySelectionElement
<T
>(this, //conversation,
2983 parentElement
, clazz
,
2984 labelString
, selection
, mode
, style
, filterElement
);
2986 parentElement
.addElement(element
);
2990 public <T
extends CdmBase
> EntitySelectionElement
<T
> createSelectionElement(Class
<T
> clazz
,
2991 ICdmFormElement parentElement
, String labelString
, T selection
, int mode
,
2993 EntitySelectionElement
<T
> element
= new EntitySelectionElement
<T
>(this,
2994 parentElement
, clazz
,
2995 labelString
, selection
, mode
, style
);
2997 parentElement
.addElement(element
);
3001 public CollectorSelectionElement
createCollectorSelectionElement(ICdmFormElement parentElement
, String labelString
, AgentBase selection
, int mode
,
3003 CollectorSelectionElement element
= new CollectorSelectionElement(this, parentElement
,
3004 labelString
, selection
, mode
, style
);
3006 parentElement
.addElement(element
);
3010 public CollectorSelectionElement
createCollectorSelectionElement(ICdmFormElement parentElement
, String labelString
, AgentBase team
, Person member
, int mode
,
3012 CollectorSelectionElement element
= new CollectorSelectionElement(this, parentElement
,
3013 labelString
, team
, member
, mode
, style
);
3015 parentElement
.addElement(element
);
3019 public CommonNameReferenceSelectionElement
createCommonNameReferenceSelectionElement(ICdmFormElement parentElement
, String labelString
, Reference selection
, int mode
,
3021 CommonNameReferenceSelectionElement element
= new CommonNameReferenceSelectionElement(this,
3022 parentElement
, labelString
, selection
, mode
, style
);
3024 parentElement
.addElement(element
);
3030 * Creates a selection element for the given type T which shows only the <b>abbreviated</b> title as the label.
3033 * <strong>Selection elements not handled by this method:</strong>
3035 * <li>{@link TaxonNodeSelectionElement} see
3036 * {@link #createTaxonNodeSelectionElement(ICdmFormElement, String, TaxonNode, int, int)}
3038 * <li>{@link NomenclaturalAuthorTeamSelectionElement} see
3039 * {@link #createNomenclaturalAuthorTeamSelectionElement(ICdmFormElement, String, Team, int, int)}
3044 public <T
extends CdmBase
> EntitySelectionElementWithAbbreviatedTitle
<T
> createSelectionElementWithAbbreviatedTitle(
3045 Class
<T
> clazz
, ICdmFormElement parentElement
, String labelString
,
3046 T selection
, int mode
, int style
) {
3047 EntitySelectionElementWithAbbreviatedTitle
<T
> element
= new EntitySelectionElementWithAbbreviatedTitle
<T
>(this,
3048 parentElement
, clazz
,
3049 labelString
, selection
, mode
, style
);
3051 parentElement
.addElement(element
);
3055 public TaxonNodeSelectionElement
createTaxonNodeSelectionElement(
3056 ICdmFormElement parentElement
, String labelString
, TaxonNode selection
, int mode
, int style
) {
3057 TaxonNodeSelectionElement element
= new TaxonNodeSelectionElement(this,
3059 labelString
, selection
, mode
, style
, null);
3061 parentElement
.addElement(element
);
3065 public TaxonNodeSelectionElement
createTaxonNodeSelectionElement(
3066 ICdmFormElement parentElement
, String labelString
, TaxonNode selection
, int mode
, int style
, Integer limit
) {
3067 TaxonNodeSelectionElement element
= new TaxonNodeSelectionElement(this, //conversation,
3069 labelString
, selection
, mode
, style
, limit
);
3071 parentElement
.addElement(element
);
3075 // public NomenclaturalAuthorTeamSelectionElement createNomenclaturalAuthorTeamSelectionElement(
3076 // ICdmFormElement parentElement, String labelString, Team selection,
3077 // int mode, int style) {
3078 // NomenclaturalAuthorTeamSelectionElement element = new NomenclaturalAuthorTeamSelectionElement(this,
3079 // parentElement, labelString, selection, mode, style);
3081 // parentElement.addElement(element);
3085 public LabelElement
createLabel(ICdmFormElement parentElement
, String text
) {
3086 LabelElement labelElement
= new LabelElement(this, parentElement
, text
);
3087 adapt(labelElement
);
3088 parentElement
.addElement(labelElement
);
3089 return labelElement
;
3092 // public DateElementFormElement createDateElementForm(ICdmFormElement formElement, String labelText, DateTime dateTime, int style){
3093 // Label label = new Label(formElement.getLayoutComposite(), style);
3094 // label.setText(labelText+" (yyyy-MM-dd)");
3095 // DateElementFormElement dateElement = new DateElementFormElement(this, dateTime, style, formElement.getLayoutComposite());
3096 // dateElement.initInternalController();
3098 // return dateElement;
3101 public DateElement
createDateElement(ICdmFormElement formElement
, String labelText
, DateTime dateTime
, int style
, boolean editableText
){
3102 Label label
= new Label(formElement
.getLayoutComposite(), style
);
3103 label
.setText(labelText
);
3104 label
.setLayoutData(new TableWrapData(TableWrapData
.LEFT
, TableWrapData
.MIDDLE
, 1, 1));
3105 DateElement dateElement
= new DateElement(formElement
.getLayoutComposite(), dateTime
, labelText
, style
, editableText
);
3106 dateElement
.initController(this, formElement
);
3107 dateElement
.setLayoutData(new TableWrapData(TableWrapData
.LEFT
, TableWrapData
.MIDDLE
, 1, 1));
3111 public ISelectionProvider
getSelectionProvider() {
3112 return selectionProvider
;
3115 public AbstractDetailedDescriptionDetailElement
<?
> createDetailedDescriptionDetailElement(
3116 ICdmFormElement parentElement
, DescriptionElementBase entity
, int style
, boolean enabled
) {
3117 AbstractDetailedDescriptionDetailElement
<?
> detailedDescriptionElement
= null;
3119 if (entity
instanceof CategoricalData
) {
3120 detailedDescriptionElement
= new CategoricalDataDetailElement(this, parentElement
,
3121 (CategoricalData
) entity
, enabled
, style
);
3122 } else if (entity
instanceof CommonTaxonName
) {
3123 detailedDescriptionElement
= new CommonNameDetailElement(this, parentElement
, (CommonTaxonName
) entity
, enabled
, style
);
3124 } else if (entity
instanceof Distribution
&& !enabled
) {
3125 detailedDescriptionElement
= new DistributionDetailElement(this, parentElement
, (Distribution
) entity
,
3127 } else if (entity
instanceof Distribution
) {
3128 detailedDescriptionElement
= new DistributionDetailElement(this, parentElement
, (Distribution
) entity
,
3130 }else if (entity
instanceof IndividualsAssociation
) {
3131 detailedDescriptionElement
= new IndividualsAssociationDetailElement(this, parentElement
,
3132 (IndividualsAssociation
) entity
, enabled
, style
);
3133 } else if (entity
instanceof QuantitativeData
) {
3134 detailedDescriptionElement
= new QuantitativeDataDetailElement(this, parentElement
,
3135 (QuantitativeData
) entity
, enabled
, style
);
3136 } else if (entity
instanceof TaxonInteraction
) {
3137 detailedDescriptionElement
= new TaxonInteractionDetailElement(this, parentElement
,
3138 (TaxonInteraction
) entity
, enabled
, style
);
3139 } else if (entity
instanceof TemporalData
) {
3140 detailedDescriptionElement
= new TemporalDataDetailElement(this, parentElement
, (TemporalData
) entity
, enabled
, style
);
3141 } else if (entity
instanceof TextData
) {
3142 detailedDescriptionElement
= new TextDataDetailElement(this, parentElement
, (TextData
) entity
, enabled
, style
);
3145 throw new IllegalStateException("There is no interface for the given description element");
3147 // detailedDescriptionElement.setEnabled(enabled);
3148 adapt(detailedDescriptionElement
);
3149 parentElement
.addElement(detailedDescriptionElement
);
3150 return detailedDescriptionElement
;
3153 public StyledText
createStyledText(Composite parent
, String value
, int style
) {
3154 StyledText text
= new StyledText(parent
, getBorderStyle() | style
| getOrientation());
3155 if (value
!= null) {
3156 text
.setText(value
);
3158 text
.setForeground(getColors().getForeground());
3159 text
.setBackground(getColors().getBackground());
3160 // text.addFocusListener(visibilityHandler);
3164 public PreservedSpecimenDetailSection
createPreservedSpecimenDetailsSection(ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
3165 PreservedSpecimenDetailSection section
= new PreservedSpecimenDetailSection(this, parentElement
, selectionProvider
, style
);
3166 addAndAdaptSection(parentElement
, section
);
3170 public TaxonNodeAgentRelationCollectionSection
createTaxonNodeAgentRelationCollectionSection(
3171 ICdmFormElement formElement
, int style
) {
3172 TaxonNodeAgentRelationCollectionSection section
= new TaxonNodeAgentRelationCollectionSection(this, formElement
, style
);
3173 addAndAdaptSection(formElement
, section
);
3177 public TaxonOfRelationshipElement
createTaxonOfRelationshipDetailElement(
3178 ICdmFormElement parentElement
, int style
) {
3179 TaxonOfRelationshipElement section
= new TaxonOfRelationshipElement(this, parentElement
, style
);
3180 addAndAdaptElement(parentElement
, section
);
3184 public TaxonDetailSection
createTaxonDetailSection(
3185 ICdmFormElement formElement
, ISelectionProvider selectionProvider
, int style
) {
3186 TaxonDetailSection section
= new TaxonDetailSection(this, formElement
, selectionProvider
, style
);
3187 addAndAdaptSection(formElement
, section
);
3191 public RuleConsideredElement
createRuleConsideredElement(ICdmFormElement parentElement
, String labelString
, boolean isShowCodeEdition
, int style
) {
3192 RuleConsideredElement element
= new RuleConsideredElement(this, parentElement
, labelString
, isShowCodeEdition
, style
);
3194 parentElement
.addElement(element
);
3198 public EntitySelectionElementWithIdInVocabulary
createSelectionElementWithIdInVocabulary(Class
<NamedArea
> clazz
,
3199 ICdmFormElement formElement
, String labelString
, NamedArea area
, int mode
, int style
) {
3200 EntitySelectionElementWithIdInVocabulary element
= new EntitySelectionElementWithIdInVocabulary(this,
3201 formElement
, clazz
, labelString
, area
, mode
, style
);
3203 formElement
.addElement(element
);
3207 public ExtendedTimeDetailSection
createExtendedTimeDetailSection(
3208 ExtendedTimePeriodElement parentElement
, int style
) {
3209 ExtendedTimeDetailSection section
= new ExtendedTimeDetailSection(this, parentElement
, style
);
3210 parentElement
.addElement(section
);
3215 public ExtendedTimePeriodElement
createExtendedTimePeriodElement(
3216 ICdmFormElement parentElement
, String labelString
, ExtendedTimePeriod timePeriod
, int style
) {
3217 ExtendedTimePeriodElement section
= new ExtendedTimePeriodElement(this, parentElement
, labelString
, timePeriod
, style
);
3218 parentElement
.addElement(section
);
3223 // public RichTextWithLabelElement createRichTextLabelElement(ICdmFormElement parentElement, String labelString, String initialText, int textHeight, int style) {
3224 // RichTextWithLabelElement element = new RichTextWithLabelElement(this, parentElement, labelString,
3225 // initialText, textHeight, style);
3227 // parentElement.addElement(element);