4 package eu
.etaxonomy
.taxeditor
.ui
.element
;
7 import java
.util
.ArrayList
;
8 import java
.util
.HashSet
;
13 import org
.eclipse
.jface
.util
.IPropertyChangeListener
;
14 import org
.eclipse
.jface
.viewers
.ISelection
;
15 import org
.eclipse
.jface
.viewers
.ISelectionProvider
;
16 import org
.eclipse
.jface
.window
.Window
;
17 import org
.eclipse
.swt
.SWT
;
18 import org
.eclipse
.swt
.custom
.StyledText
;
19 import org
.eclipse
.swt
.events
.FocusAdapter
;
20 import org
.eclipse
.swt
.events
.FocusEvent
;
21 import org
.eclipse
.swt
.events
.FocusListener
;
22 import org
.eclipse
.swt
.events
.MouseAdapter
;
23 import org
.eclipse
.swt
.events
.MouseEvent
;
24 import org
.eclipse
.swt
.events
.MouseListener
;
25 import org
.eclipse
.swt
.events
.SelectionEvent
;
26 import org
.eclipse
.swt
.events
.SelectionListener
;
27 import org
.eclipse
.swt
.events
.TypedEvent
;
28 import org
.eclipse
.swt
.graphics
.Color
;
29 import org
.eclipse
.swt
.graphics
.Font
;
30 import org
.eclipse
.swt
.widgets
.Composite
;
31 import org
.eclipse
.swt
.widgets
.Control
;
32 import org
.eclipse
.swt
.widgets
.Display
;
33 import org
.eclipse
.swt
.widgets
.Event
;
34 import org
.eclipse
.swt
.widgets
.Label
;
35 import org
.eclipse
.ui
.forms
.IFormColors
;
36 import org
.eclipse
.ui
.forms
.widgets
.ExpandableComposite
;
37 import org
.eclipse
.ui
.forms
.widgets
.FormToolkit
;
38 import org
.eclipse
.ui
.forms
.widgets
.Section
;
39 import org
.eclipse
.ui
.internal
.forms
.widgets
.FormFonts
;
40 import org
.joda
.time
.DateTime
;
41 import org
.joda
.time
.Partial
;
42 import org
.springframework
.security
.core
.GrantedAuthority
;
44 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
45 import eu
.etaxonomy
.cdm
.api
.facade
.DerivedUnitFacade
;
46 import eu
.etaxonomy
.cdm
.hibernate
.HibernateProxyHelper
;
47 import eu
.etaxonomy
.cdm
.model
.agent
.Person
;
48 import eu
.etaxonomy
.cdm
.model
.agent
.Team
;
49 import eu
.etaxonomy
.cdm
.model
.common
.Annotation
;
50 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
51 import eu
.etaxonomy
.cdm
.model
.common
.Credit
;
52 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTerm
;
53 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTermBase
;
54 import eu
.etaxonomy
.cdm
.model
.common
.Extension
;
55 import eu
.etaxonomy
.cdm
.model
.common
.GrantedAuthorityImpl
;
56 import eu
.etaxonomy
.cdm
.model
.common
.Group
;
57 import eu
.etaxonomy
.cdm
.model
.common
.ICdmBase
;
58 import eu
.etaxonomy
.cdm
.model
.common
.IEnumTerm
;
59 import eu
.etaxonomy
.cdm
.model
.common
.IdentifiableSource
;
60 import eu
.etaxonomy
.cdm
.model
.common
.Identifier
;
61 import eu
.etaxonomy
.cdm
.model
.common
.LSID
;
62 import eu
.etaxonomy
.cdm
.model
.common
.Language
;
63 import eu
.etaxonomy
.cdm
.model
.common
.LanguageString
;
64 import eu
.etaxonomy
.cdm
.model
.common
.Marker
;
65 import eu
.etaxonomy
.cdm
.model
.common
.TermType
;
66 import eu
.etaxonomy
.cdm
.model
.common
.TermVocabulary
;
67 import eu
.etaxonomy
.cdm
.model
.common
.TimePeriod
;
68 import eu
.etaxonomy
.cdm
.model
.common
.User
;
69 import eu
.etaxonomy
.cdm
.model
.common
.VersionableEntity
;
70 import eu
.etaxonomy
.cdm
.model
.description
.CategoricalData
;
71 import eu
.etaxonomy
.cdm
.model
.description
.CommonTaxonName
;
72 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionElementBase
;
73 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionElementSource
;
74 import eu
.etaxonomy
.cdm
.model
.description
.Distribution
;
75 import eu
.etaxonomy
.cdm
.model
.description
.Feature
;
76 import eu
.etaxonomy
.cdm
.model
.description
.IndividualsAssociation
;
77 import eu
.etaxonomy
.cdm
.model
.description
.KeyStatement
;
78 import eu
.etaxonomy
.cdm
.model
.description
.MeasurementUnit
;
79 import eu
.etaxonomy
.cdm
.model
.description
.QuantitativeData
;
80 import eu
.etaxonomy
.cdm
.model
.description
.State
;
81 import eu
.etaxonomy
.cdm
.model
.description
.StateData
;
82 import eu
.etaxonomy
.cdm
.model
.description
.StatisticalMeasure
;
83 import eu
.etaxonomy
.cdm
.model
.description
.StatisticalMeasurementValue
;
84 import eu
.etaxonomy
.cdm
.model
.description
.TaxonInteraction
;
85 import eu
.etaxonomy
.cdm
.model
.description
.TextData
;
86 import eu
.etaxonomy
.cdm
.model
.location
.NamedArea
;
87 import eu
.etaxonomy
.cdm
.model
.location
.NamedAreaLevel
;
88 import eu
.etaxonomy
.cdm
.model
.location
.Point
;
89 import eu
.etaxonomy
.cdm
.model
.media
.ImageFile
;
90 import eu
.etaxonomy
.cdm
.model
.media
.Media
;
91 import eu
.etaxonomy
.cdm
.model
.media
.MediaRepresentation
;
92 import eu
.etaxonomy
.cdm
.model
.media
.MediaRepresentationPart
;
93 import eu
.etaxonomy
.cdm
.model
.media
.Rights
;
94 import eu
.etaxonomy
.cdm
.model
.molecular
.DnaSample
;
95 import eu
.etaxonomy
.cdm
.model
.name
.NameRelationship
;
96 import eu
.etaxonomy
.cdm
.model
.name
.NameTypeDesignation
;
97 import eu
.etaxonomy
.cdm
.model
.name
.NomenclaturalStatus
;
98 import eu
.etaxonomy
.cdm
.model
.name
.SpecimenTypeDesignation
;
99 import eu
.etaxonomy
.cdm
.model
.occurrence
.DerivedUnit
;
100 import eu
.etaxonomy
.cdm
.model
.occurrence
.DeterminationEvent
;
101 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
102 import eu
.etaxonomy
.cdm
.model
.taxon
.SynonymRelationship
;
103 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
104 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonNode
;
105 import eu
.etaxonomy
.cdm
.strategy
.parser
.ParserProblem
;
106 import eu
.etaxonomy
.taxeditor
.model
.MessagingUtils
;
107 import eu
.etaxonomy
.taxeditor
.ui
.combo
.EnumComboElement
;
108 import eu
.etaxonomy
.taxeditor
.ui
.combo
.TermComboElement
;
109 import eu
.etaxonomy
.taxeditor
.ui
.combo
.VocabularyComboElement
;
110 import eu
.etaxonomy
.taxeditor
.ui
.element
.MinMaxTextSection
.UnitType
;
111 import eu
.etaxonomy
.taxeditor
.ui
.mvc
.element
.DateElement
;
112 import eu
.etaxonomy
.taxeditor
.ui
.openurl
.IOpenUrlEnabled
;
113 import eu
.etaxonomy
.taxeditor
.ui
.openurl
.OpenUrlSelectorElement
;
114 import eu
.etaxonomy
.taxeditor
.ui
.password
.EditPasswordElement
;
115 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailElement
;
116 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailSection
;
117 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionElement
;
118 import eu
.etaxonomy
.taxeditor
.ui
.section
.EmptyElement
;
119 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.InstitutionDetailElement
;
120 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.InstitutionDetailSection
;
121 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailElement
;
122 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailSection
;
123 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailElement
;
124 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailSection
;
125 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamMemberElement
;
126 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamMemberSection
;
127 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamOrPersonBaseDetailSection
;
128 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.ClassificationDetailElement
;
129 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.ClassificationDetailSection
;
130 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.TaxonNodeDetailElement
;
131 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.TaxonNodeDetailSection
;
132 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferenceEntityDetailElement
;
133 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferencedEntityDetailSection
;
134 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DerivedUnitElement
;
135 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescribedSpecimenSection
;
136 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailElement
;
137 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailSection
;
138 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailElement
;
139 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailSection
;
140 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementMediaSection
;
141 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceElement
;
142 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceSection
;
143 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceElement
;
144 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceSection
;
145 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.MediaDetailsSection
;
146 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ModifierElement
;
147 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ModifierSection
;
148 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageDetailElement
;
149 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageSection
;
150 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeElement
;
151 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeSection
;
152 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StateDataElement
;
153 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StateDataSection
;
154 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StatisticalMeasurementValueElement
;
155 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StatisticalMeasurementValueSection
;
156 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.AbstractDetailedDescriptionDetailElement
;
157 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.CategoricalDataDetailElement
;
158 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.CommonNameDetailElement
;
159 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.DistributionDetailElement
;
160 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.IndividualsAssociationDetailElement
;
161 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.QuantitativeDataDetailElement
;
162 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.TaxonInteractionDetailElement
;
163 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.TextDataDetailElement
;
164 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailElement
;
165 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailSection
;
166 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityCollectionElement
;
167 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailElement
;
168 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailSection
;
169 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailElement
;
170 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailSection
;
171 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailElement
;
172 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailSection
;
173 import eu
.etaxonomy
.taxeditor
.ui
.section
.identifier
.IdentifierDetailElement
;
174 import eu
.etaxonomy
.taxeditor
.ui
.section
.identifier
.IdentifierDetailSection
;
175 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailElement
;
176 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailSection
;
177 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailElement
;
178 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailSection
;
179 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.ScopeRestrictionSection
;
180 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.TaxonomicScopeSection
;
181 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.ImageFileElement
;
182 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaDetailElement
;
183 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaMetaElement
;
184 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationElement
;
185 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationPartElement
;
186 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationPartSection
;
187 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationSection
;
188 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaSection
;
189 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.AuthorshipDetailElement
;
190 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.AuthorshipDetailSection
;
191 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.HybridDetailElement
;
192 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.HybridDetailSection
;
193 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameDetailElement
;
194 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameDetailSection
;
195 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailElement
;
196 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailSection
;
197 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameTypeDesignationElement
;
198 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusElement
;
199 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusSection
;
200 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailElement
;
201 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailSection
;
202 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.ProtologueElement
;
203 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.ProtologueSection
;
204 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.SpecimenTypeDesignationElement
;
205 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.SynonymRelationshipDetailElement
;
206 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.SynonymRelationshipDetailSection
;
207 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.TypeDesignationSection
;
208 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CollectingAreasDetailSection
;
209 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CollectionDetailElement
;
210 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CurrentDeterminationDetailSection
;
211 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitBaseDetailElement
;
212 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitBaseDetailSection
;
213 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitGeneralDetailElement
;
214 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitGeneralDetailSection
;
215 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailElement
;
216 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailSection
;
217 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationEventDetailElement
;
218 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationHistoryDetailSection
;
219 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.EmptySection
;
220 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitDetailElement
;
221 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitDetailSection
;
222 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitGeneralDetailElement
;
223 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitGeneralDetailSection
;
224 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailElement
;
225 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailSection
;
226 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GeoScopeDetailSection
;
227 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GeoScopePolyKeyDetailSection
;
228 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.NamedAreaDetailElement
;
229 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.OriginalLabelDataSection
;
230 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SourceCollectionDetailSection
;
231 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SpecimenCollectionDetailElement
;
232 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SpecimenCollectionDetailSection
;
233 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SpecimenHierarchyDetailElement
;
234 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SpecimenHierarchyDetailSection
;
235 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.association
.TaxonAssociationDetailElement
;
236 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.association
.TaxonAssociationDetailSection
;
237 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenCurrentDeterminationDetailSection
;
238 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenDetailElement
;
239 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenDetailSection
;
240 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenDeterminationDetailElement
;
241 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenDeterminationDetailSection
;
242 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenDeterminationHistoryDetailSection
;
243 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenGeneralDetailElement
;
244 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenGeneralDetailSection
;
245 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenSourceCollectionDetailSection
;
246 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AbstractSampleDesignationDetailSection
;
247 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationCloningDetailElement
;
248 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationCloningDetailSection
;
249 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationGelPhotoCollectionDetailSection
;
250 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationGelPhotoDetailElement
;
251 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationGeneralDetailElement
;
252 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationGeneralDetailSection
;
253 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationPrimerDetailElement
;
254 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationPrimerDetailSection
;
255 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.CurrentSampleDesignationDetailSection
;
256 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaQualityDetailElement
;
257 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaQualityDetailSection
;
258 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaSampleGeneralDetailElement
;
259 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaSampleGeneralDetailSection
;
260 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaSamplePreparationPreservationDetailElement
;
261 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaSamplePreparationPreservationSection
;
262 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.PrimerGeneralDetailElement
;
263 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SampleDesignationDetailElement
;
264 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SampleDesignationDetailSection
;
265 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SampleDesignationHistoryDetailSection
;
266 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SampleDesignationTextDetailElement
;
267 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceContigFileCollectionDetailSection
;
268 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceGeneralDetailElement
;
269 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceGeneralDetailSection
;
270 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceReferenceCollectionDetailElement
;
271 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceReferenceCollectionDetailSection
;
272 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SingleReadGeneralDetailElement
;
273 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SingleReadGeneralDetailSection
;
274 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SingleReadPherogramCollectionDetailSection
;
275 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.TissueSampleGeneralDetailElement
;
276 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.TissueSampleGeneralDetailSection
;
277 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.media
.MediaSpecimenGeneralDetailElement
;
278 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.media
.MediaSpecimenGeneralDetailSection
;
279 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailElement
;
280 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailSection
;
281 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailElement
;
282 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailSection
;
283 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.AnnotationElement
;
284 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.AnnotationSection
;
285 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CdmBaseElement
;
286 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CdmBaseSection
;
287 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CreditElement
;
288 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CreditSection
;
289 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.ExtensionElement
;
290 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.ExtensionSection
;
291 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.HeadlineSection
;
292 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.IdentifiableSourceElement
;
293 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.MarkerElement
;
294 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.MarkerSection
;
295 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.RightsElement
;
296 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.RightsSection
;
297 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.SourceSection
;
298 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.VersionElement
;
299 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.VersionSection
;
300 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessageElement
;
301 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessagesSection
;
302 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailElement
;
303 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailSection
;
304 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonDetailElement
;
305 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailElement
;
306 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailSection
;
307 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailElement
;
308 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailSection
;
309 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailElement
;
310 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailSection
;
311 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailElement
;
312 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailSection
;
313 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.DefinedTermDetailElement
;
314 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.DefinedTermDetailSection
;
315 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.FeatureDetailElement
;
316 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.MeasurementUnitCollectionElement
;
317 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.MeasurementUnitCollectionSection
;
318 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailSection
;
319 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.RecommendedModifierVocabulariesCollectionSection
;
320 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.RecommendedModifierVocabulariesElement
;
321 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.StateVocabularyCollectionElement
;
322 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.StateVocabularyCollectionSection
;
323 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.StatisticalMeasureCollectionElement
;
324 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.StatisticalMeasureCollectionSection
;
325 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailElement
;
326 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailSection
;
327 import eu
.etaxonomy
.taxeditor
.ui
.selection
.EntitySelectionElement
;
328 import eu
.etaxonomy
.taxeditor
.ui
.selection
.EntitySelectionElementWithAbbreviatedTitle
;
329 import eu
.etaxonomy
.taxeditor
.ui
.selection
.NomenclaturalAuthorTeamSelectionElement
;
330 import eu
.etaxonomy
.taxeditor
.ui
.selection
.TaxonNodeSelectionElement
;
334 * CdmFormFactory class.
338 * @created Feb 24, 2010
341 public class CdmFormFactory
extends FormToolkit
{
343 private BoldFontHolder2 boldFontHolder2
;
344 private MouseListener selectionMouseHandler
;
345 private FocusListener selectionFocusHandler
;
347 private final Set
<SelectionListener
> selectionListenerList
= new HashSet
<SelectionListener
>();
349 private final List
<IPropertyChangeListener
> propertyChangeListeners
= new ArrayList
<IPropertyChangeListener
>();
351 private final int orientation
= Window
.getDefaultOrientation();
352 private ISelectionProvider selectionProvider
;
354 /** Constant <code>EMPTY_SELECTION</code> */
355 public static ISelection EMPTY_SELECTION
= new ISelection() {
357 public boolean isEmpty() {
368 private class SelectionMouseHandler
extends MouseAdapter
{
370 public void mouseDown(MouseEvent e
) {
371 notifySelectionListeners(e
);
381 private class SelectionFocusHandler
extends FocusAdapter
{
383 public void focusGained(FocusEvent e
) {
384 notifySelectionListeners(e
);
388 private void notifySelectionListeners(TypedEvent e
) {
389 Event event
= new Event();
390 event
.widget
= e
.widget
;
391 SelectionEvent selectionEvent
= new SelectionEvent(event
);
393 for (SelectionListener listener
: selectionListenerList
) {
394 listener
.widgetSelected(selectionEvent
);
400 * Constructor for CdmFormFactory.
404 * a {@link org.eclipse.swt.widgets.Display} object.
405 * @param selectionProvider
406 * a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
408 public CdmFormFactory(Display display
, ISelectionProvider selectionProvider
) {
410 this.selectionProvider
= selectionProvider
;
416 * Constructor for CdmFormFactory.
420 * a {@link org.eclipse.swt.widgets.Display} object.
422 public CdmFormFactory(Display display
) {
430 private void init() {
431 boldFontHolder2
= new BoldFontHolder2();
432 selectionMouseHandler
= new SelectionMouseHandler();
433 selectionFocusHandler
= new SelectionFocusHandler();
437 * Creates an instance initialized with the correct selectionProvider
439 * Make sure to remove the instance when the entityComposite disposes via
440 * destroySelectionArbitrator(..)
442 * @param entityElement
443 * a {@link eu.etaxonomy.taxeditor.ui.element.IEntityElement}
445 * @return a {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator}
448 public SelectionArbitrator
createSelectionArbitrator(IEntityElement entityElement
) {
449 SelectionArbitrator selectionArbitrator
= new SelectionArbitrator(entityElement
);
450 selectionArbitrator
.addSelectionProvider(selectionProvider
);
451 selectionProvider
.addSelectionChangedListener(selectionArbitrator
);
452 addSelectionListener(selectionArbitrator
);
453 return selectionArbitrator
;
458 * destroySelectionArbitrator
461 * @param selectionArbitrator
463 * {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator}
466 public void destroySelectionArbitrator(SelectionArbitrator selectionArbitrator
) {
467 removeSelectionListener(selectionArbitrator
);
468 if (selectionProvider
!= null) {
469 selectionProvider
.removeSelectionChangedListener(selectionArbitrator
);
471 MessagingUtils
.error(this.getClass(),
472 "Tried to destroy a selection listener from this factories listeners but was null", null);
478 * Adapts the {@link AbstractCdmFormElement}:<br>
479 * - sets the {@link IPropertyChangeListener}s handled by this class
484 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement}
487 public void adapt(ICdmFormElement formElement
) {
488 formElement
.setPropertyChangeListeners(propertyChangeListeners
);
493 public void adapt(Control control
, boolean trackFocus
, boolean trackKeyboard
) {
495 control
.addFocusListener(selectionFocusHandler
);
497 super.adapt(control
, trackFocus
, trackKeyboard
);
502 public void adapt(Composite composite
) {
503 composite
.addMouseListener(selectionMouseHandler
);
504 super.adapt(composite
);
513 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
516 public void destroyElement(ICdmFormElement formElement
) {
517 // return if element was not initialized
518 if (formElement
== null) {
521 // destroy selection arbitrator, if any
522 if (formElement
instanceof ISelectableElement
) {
523 destroySelectionArbitrator(((ISelectableElement
) formElement
).getSelectionArbitrator());
525 // remove this element form its parents list of elements
526 // ICdmFormElement parentElement = formElement.getParentElement();
527 // if(parentElement != null){
528 // parentElement.removeElement(formElement);
530 // call destroy on child elements recursively
531 for (ICdmFormElement childElement
: formElement
.getElements()) {
532 destroyElement(childElement
);
534 // dispose of the controls
535 for (Control control
: formElement
.getControls()) {
536 // we added the layoutComposite of the parental element as the
537 // layout composite to this formElement
538 // but we do not want to destroy it.
539 if (control
.equals(formElement
.getLayoutComposite())) {
554 * a {@link org.eclipse.swt.widgets.Composite} object.
555 * @return a {@link org.eclipse.swt.widgets.Label} object.
557 public Label
createEmptyCell(Composite parent
) {
558 return this.createLabel(parent
, null);
563 * createMultiLanguageTextElement
566 * @param parentElement
567 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
570 * a {@link java.lang.String} object.
571 * @param multilanguageText
572 * a {@link java.util.Map} object.
578 * {@link eu.etaxonomy.taxeditor.ui.element.MultilanguageTextElement}
581 public MultilanguageTextElement
createMultiLanguageTextElement(ICdmFormElement parentElement
, String labelString
,
582 Map
<Language
, LanguageString
> multilanguageText
, int textHeight
, int style
) {
583 MultilanguageTextElement element
= new MultilanguageTextElement(this, parentElement
, labelString
,
584 multilanguageText
, textHeight
, style
);
586 parentElement
.addElement(element
);
590 public KeyStatementElement
createKeyStatementElement(ICdmFormElement parentElement
, String labelString
,
591 KeyStatement keyStatement
, int textHeight
, int style
) {
592 KeyStatementElement element
= new KeyStatementElement(this, parentElement
, labelString
, keyStatement
,
595 parentElement
.addElement(element
);
600 * Creates a text field with a label. The initial content will be the return value of the initalObject's {@link #toString()}
602 * <b>Note</b>: if initialObject is <code>null</code> then an empty string is used.
603 * @param parentElement the parent container
604 * @param labelString the label name
605 * @param initialObject the object from which the <code>toString()</code> method is called
606 * @param style {@link SWT} style constant
607 * @return the created textfield with label
609 public TextWithLabelElement
createTextWithLabelElement(ICdmFormElement parentElement
, String labelString
,
610 Object initialObject
, int style
) {
611 return createTextWithLabelElement(parentElement
, labelString
, initialObject
==null?
"":initialObject
.toString(), style
);
616 * createTextWithLabelElement
619 * @param parentElement
620 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
623 * a {@link java.lang.String} object.
625 * a {@link java.lang.String} object.
628 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
631 public TextWithLabelElement
createTextWithLabelElement(ICdmFormElement parentElement
, String labelString
,
632 String initialText
, int style
) {
633 return createTextWithLabelElement(parentElement
, labelString
, initialText
, null, style
);
637 * createTextWithLabelElement
640 * @param parentElement
641 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
644 * a {@link java.lang.String} object.
646 * a {@link java.lang.String} object.
647 * @param textLimit maximal number of characters allowed
650 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
653 public TextWithLabelElement
createTextWithLabelElement(ICdmFormElement parentElement
, String labelString
,
654 String initialText
, Integer textLimit
, int style
) {
655 if(initialText
==null){
659 TextWithLabelElement element
= new TextWithLabelElement(this, parentElement
, labelString
, initialText
, null,
662 parentElement
.addElement(element
);
666 public TextWithLabelElement
createMultiLineTextWithLabel(ICdmFormElement parentElement
, String labelString
,
667 int textHeight
, int style
) {
668 TextWithLabelElement element
= new TextWithLabelElement(this, parentElement
, labelString
, "", textHeight
, true, style
);
670 parentElement
.addElement(element
);
674 public LsidWithExceptionLabelElement
createLsidWithExceptionLabelElement(ICdmFormElement parentElement
, String labelString
,
675 LSID initialLsid
, int style
) {
676 LsidWithExceptionLabelElement element
= new LsidWithExceptionLabelElement(this, parentElement
, labelString
, initialLsid
, null, style
);
678 parentElement
.addElement(element
);
682 public UriWithLabelElement
createUriWithLabelElement(ICdmFormElement parentElement
, String labelString
,
683 URI initialUri
, int style
) {
684 UriWithLabelElement element
= new UriWithLabelElement(this, parentElement
, labelString
, initialUri
, null, style
);
686 parentElement
.addElement(element
);
697 public OpenUrlSelectorElement
createOpenUrlSelectorElement(ICdmFormElement parentElement
, String labelString
,
698 IOpenUrlEnabled openUrlEnabled
, int style
) {
699 OpenUrlSelectorElement element
= new OpenUrlSelectorElement(this, parentElement
, labelString
, openUrlEnabled
,
702 parentElement
.addElement(element
);
708 * @param parentElement
710 * @param conversationEnabled
715 public EditPasswordElement
createEditPasswordElement(ICdmFormElement parentElement
, String labelString
,
716 ConversationHolder conversation
, User user
, int style
) {
717 EditPasswordElement element
= new EditPasswordElement(this, parentElement
, labelString
, user
, conversation
);
719 parentElement
.addElement(element
);
725 * createIntegerTextWithLabelElement
728 * @param parentElement
729 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
732 * a {@link java.lang.String} object.
733 * @param initialInteger
734 * a {@link java.lang.Integer} object.
738 * {@link eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement}
741 public NumberWithLabelElement
createNumberTextWithLabelElement(
742 ICdmFormElement parentElement
, String labelString
,
743 Number initialNumber
, int style
) {
744 NumberWithLabelElement element
= new NumberWithLabelElement(this,
745 parentElement
, labelString
, initialNumber
, style
);
747 parentElement
.addElement(element
);
751 public LanguageStringWithLabelElement
createLanguageStringWithLabelElement(ICdmFormElement parentElement
,
752 String labelString
, LanguageString languageString
, int style
) {
753 return createLanguageStringWithLabelElement(parentElement
, labelString
, languageString
, null, false, style
);
756 public LanguageStringWithLabelElement
createLanguageStringWithLabelElement(ICdmFormElement parentElement
,
757 String labelString
, LanguageString languageString
, Integer height
, boolean isMultiLine
, int style
) {
758 LanguageStringWithLabelElement element
= new LanguageStringWithLabelElement(this, parentElement
, labelString
,
759 languageString
, height
, isMultiLine
, style
);
761 parentElement
.addElement(element
);
767 * createKeyValueViewerElement
770 * @param parentElement
771 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
774 * a {@link java.lang.String} object.
775 * @param valueHeading
776 * a {@link java.lang.String} object.
778 * a {@link java.util.Map} object.
779 * @return a {@link eu.etaxonomy.taxeditor.ui.element.KeyValueViewerElement}
782 public KeyValueViewerElement
createKeyValueViewerElement(ICdmFormElement parentElement
, String keyHeading
,
783 String valueHeading
, Map
<Object
, Object
> map
) {
784 KeyValueViewerElement element
= new KeyValueViewerElement(this, parentElement
, keyHeading
, valueHeading
, map
);
786 parentElement
.addElement(element
);
790 * @deprecated Use {@link #createDefinedTermComboElement(TermType, ICdmFormElement, String, DefinedTermBase, int)} instead
793 public <T
extends DefinedTermBase
> TermComboElement
<T
> createTermComboElement(Class
<T
> termComboType
,
794 ICdmFormElement parentElement
, String labelString
, T selection
, int style
) {
795 TermComboElement
<T
> element
= new TermComboElement
<T
>(this, parentElement
, termComboType
, labelString
,
796 selection
, true, style
);
798 parentElement
.addElement(element
);
802 public <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
804 ICdmFormElement parentElement
,
808 TermComboElement
<T
> element
= new TermComboElement
<T
>(this, parentElement
, termType
, labelString
, selection
, true, style
);
810 parentElement
.addElement(element
);
814 public <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
816 ICdmFormElement parentElement
,
819 boolean addEmptyElement
,
821 TermComboElement
<T
> element
= new TermComboElement
<T
>(this, parentElement
, termType
, labelString
, selection
, addEmptyElement
, style
);
823 parentElement
.addElement(element
);
827 public <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
828 TermVocabulary
<?
> termVocabulary
,
829 ICdmFormElement parentElement
,
833 TermComboElement
<T
> element
= new TermComboElement
<T
>(this, parentElement
, termVocabulary
, labelString
, selection
, true, style
);
835 parentElement
.addElement(element
);
839 public <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
840 TermVocabulary
<?
> termVocabulary
,
841 ICdmFormElement parentElement
,
844 boolean addEmptyElement
,
846 TermComboElement
<T
> element
= new TermComboElement
<T
>(this, parentElement
, termVocabulary
, labelString
, selection
, addEmptyElement
, style
);
848 parentElement
.addElement(element
);
854 * createEnumComboElement
857 * @param enumComboType
859 * {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EnumComboType}
861 * @param parentElement
862 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
866 * @return a {@link eu.etaxonomy.taxeditor.ui.term.AbstractEnumComboElement}
869 public <T
extends IEnumTerm
<T
>> EnumComboElement
<T
> createEnumComboElement(
870 Class
<T
> enumComboType
, ICdmFormElement parentElement
,
872 EnumComboElement
<T
> element
= new EnumComboElement
<T
>(this, parentElement
, enumComboType
, style
);
874 parentElement
.addElement(element
);
878 public <TERM
extends DefinedTermBase
<TERM
>, VOC
extends TermVocabulary
<TERM
>> VocabularyComboElement
<TERM
, VOC
> createVocabularyComboElement(
879 TermType termType
, String label
, VOC selection
, ICdmFormElement parentElement
, int style
) {
880 VocabularyComboElement
<TERM
, VOC
> element
= new VocabularyComboElement
<TERM
, VOC
>(this, parentElement
, termType
, label
, selection
, style
);
882 parentElement
.addElement(element
);
888 * createBrowserElement
892 * a {@link java.net.URI} object.
895 * @param parentElement
896 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
898 * @return a {@link eu.etaxonomy.taxeditor.ui.element.BrowserElement}
901 public BrowserElement
createBrowserElement(ICdmFormElement parentElement
, URI imageUri
, int style
) {
902 BrowserElement element
= new BrowserElement(this, parentElement
, imageUri
, style
);
904 parentElement
.addElement(element
);
913 * @param parentElement
914 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
917 * a {@link java.net.URI} object.
920 * @return a {@link eu.etaxonomy.taxeditor.ui.element.ImageElement} object.
922 public ImageElement
createImageElement(ICdmFormElement parentElement
, URI imageUri
, int style
) {
923 ImageElement element
= new ImageElement(this, parentElement
, imageUri
, style
);
925 parentElement
.addElement(element
);
931 * createTextActionElement
935 * a {@link java.lang.String} object.
937 * a {@link java.lang.String} object.
940 * @param parentElement
941 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
944 * a {@link java.lang.String} object.
945 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextActionElement}
948 public TextActionElement
createTextActionElement(ICdmFormElement parentElement
, String labelString
,
949 String buttonLabel
, String initialText
, int style
) {
950 TextActionElement element
= new TextActionElement(this, parentElement
, labelString
, buttonLabel
, initialText
,
953 parentElement
.addElement(element
);
962 * @param parentElement
963 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
966 * a {@link java.lang.String} object.
967 * @param initialState
971 * @return a {@link eu.etaxonomy.taxeditor.ui.element.CheckboxElement}
974 public CheckboxElement
createCheckbox(ICdmFormElement parentElement
, String label
, Boolean initialState
, int style
) {
975 if(initialState
==null){
976 initialState
= Boolean
.FALSE
;
978 CheckboxElement element
= new CheckboxElement(this, parentElement
, label
, initialState
, style
| orientation
);
980 parentElement
.addElement(element
);
985 * Creates a section as a part of the form.
987 * @return the section widget
990 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
993 public Section
adapt(AbstractFormSection section
) {
994 section
.setMenu(section
.getLayoutComposite().getMenu());
995 adapt(section
, true, true);
997 // handle focus and property change events for cdm use
998 section
.addFocusListener(selectionFocusHandler
);
999 section
.setPropertyChangeListeners(propertyChangeListeners
);
1001 if (section
.getToggle() != null) {
1002 section
.getToggle().setHoverDecorationColor(getColors().getColor(IFormColors
.TB_TOGGLE_HOVER
));
1003 section
.getToggle().setDecorationColor(getColors().getColor(IFormColors
.TB_TOGGLE
));
1006 section
.setFont(boldFontHolder2
.getBoldFont(section
.getLayoutComposite().getFont()));
1008 if ((section
.getStyle() & ExpandableComposite
.TITLE_BAR
) != 0
1009 || (section
.getStyle() & ExpandableComposite
.SHORT_TITLE_BAR
) != 0) {
1010 getColors().initializeSectionToolBarColors();
1011 section
.setTitleBarBackground(getColors().getColor(IFormColors
.TB_BG
));
1012 section
.setTitleBarBorderColor(getColors().getColor(IFormColors
.TB_BORDER
));
1014 // call setTitleBarForeground regardless as it also sets the label color
1015 section
.setTitleBarForeground(getColors().getColor(IFormColors
.TB_TOGGLE
));
1019 private class BoldFontHolder2
{
1020 private Font normalFont
;
1022 private Font boldFont
;
1024 public BoldFontHolder2() {
1027 public Font
getBoldFont(Font font
) {
1028 createBoldFont(font
);
1032 private void createBoldFont(Font font
) {
1033 if (normalFont
== null || !normalFont
.equals(font
)) {
1037 if (boldFont
== null) {
1038 boldFont
= FormFonts
.getInstance().getBoldFont(getColors().getDisplay(), normalFont
);
1042 public void dispose() {
1043 if (boldFont
!= null) {
1044 FormFonts
.getInstance().markFinished(boldFont
, getColors().getDisplay());
1052 * createToggleableTextField
1055 * @param parentElement
1056 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1058 * @param labelString
1059 * a {@link java.lang.String} object.
1060 * @param initialText
1061 * a {@link java.lang.String} object.
1062 * @param initialState
1066 * @return a {@link eu.etaxonomy.taxeditor.ui.element.ToggleableTextElement}
1069 public ToggleableTextElement
createToggleableTextField(ICdmFormElement parentElement
, String labelString
,
1070 String initialText
, boolean initialState
, int style
) {
1071 ToggleableTextElement element
= new ToggleableTextElement(this, parentElement
, labelString
, initialText
,
1072 initialState
, style
| orientation
);
1074 parentElement
.addElement(element
);
1080 * createTimePeriodElement
1083 * @param parentElement
1084 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1086 * @param labelString
1087 * a {@link java.lang.String} object.
1089 * a {@link eu.etaxonomy.cdm.model.common.TimePeriod} object.
1092 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TimePeriodElement}
1095 public TimePeriodElement
createTimePeriodElement(ICdmFormElement parentElement
, String labelString
,
1096 TimePeriod timePeriod
, int style
) {
1097 TimePeriodElement element
= new TimePeriodElement(this, parentElement
, labelString
, timePeriod
, style
);
1099 parentElement
.addElement(element
);
1105 * createGatheringEventUnitElement
1108 * @param parentElement
1109 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1111 * @param labelString
1112 * a {@link java.lang.String} object.
1114 * a {@link eu.etaxonomy.cdm.model.common.GatheringEvent} object.
1117 * @return a {@link eu.etaxonomy.taxeditor.ui.element.GatheringEventUnitElement}
1120 public GatheringEventUnitElement
createGatheringEventUnitElement(
1121 ICdmFormElement parentElement
,
1123 DerivedUnitFacade gatheringEvent
,
1124 MinMaxTextSection
.UnitType unitType
,
1126 GatheringEventUnitElement element
= new GatheringEventUnitElement(this,
1133 parentElement
.addElement(element
);
1139 * createPointElement
1144 * @param parentElement
1145 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1148 * a {@link eu.etaxonomy.cdm.model.location.Point} object.
1149 * @return a {@link eu.etaxonomy.taxeditor.ui.element.PointElement} object.
1151 public PointElement
createPointElement(ICdmFormElement parentElement
, Point point
, int style
) {
1152 PointElement element
= new PointElement(this, parentElement
, point
, style
);
1154 parentElement
.addElement(element
);
1161 * @param conversationHolder
1163 * @param detailsViewer
1167 public EmptySection
createEmptySection(CdmFormFactory formFactory
, ICdmFormElement parentElement
, int style
) {
1168 EmptySection section
= new EmptySection(formFactory
, parentElement
, style
);
1169 parentElement
.addElement(section
);
1176 * createDateDetailSection
1179 * @param parentElement
1180 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1184 * @return a {@link eu.etaxonomy.taxeditor.ui.element.DateDetailSection}
1187 public DateDetailSection
createDateDetailSection(ICdmFormElement parentElement
, int style
) {
1188 DateDetailSection section
= new DateDetailSection(this, parentElement
, style
);
1189 parentElement
.addElement(section
);
1196 * createDateDetailSection
1199 * @param parentElement
1200 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1204 * @return a {@link eu.etaxonomy.taxeditor.ui.element.MinMaxTextSection}
1207 public MinMaxTextSection
createMinMaxTextSection(ICdmFormElement parentElement
, UnitType unitType
, int style
) {
1208 MinMaxTextSection section
= new MinMaxTextSection(this, parentElement
, unitType
, style
);
1209 parentElement
.addElement(section
);
1216 * createPartialElement
1219 * @param parentElement
1220 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1222 * @param labelString
1223 * a {@link java.lang.String} object.
1225 * a {@link org.joda.time.Partial} object.
1228 * @return a {@link eu.etaxonomy.taxeditor.ui.element.PartialElement}
1231 public PartialElement
createPartialElement(ICdmFormElement parentElement
, String labelString
, Partial partial
,
1233 PartialElement element
= new PartialElement(this, parentElement
, labelString
, style
);
1235 parentElement
.addElement(element
);
1241 * addSelectionListener
1245 * a {@link org.eclipse.swt.events.SelectionListener} object.
1247 public void addSelectionListener(SelectionListener listener
) {
1248 selectionListenerList
.add(listener
);
1253 * removeSelectionListener
1257 * a {@link org.eclipse.swt.events.SelectionListener} object.
1259 public void removeSelectionListener(SelectionListener listener
) {
1260 if (listener
== null) {
1261 MessagingUtils
.error(this.getClass(),
1262 "Tried to remove a selection listener from this factories listeners but was null", null);
1264 selectionListenerList
.remove(listener
);
1270 * addPropertyChangeListener
1274 * a {@link org.eclipse.jface.util.IPropertyChangeListener}
1277 public void addPropertyChangeListener(IPropertyChangeListener listener
) {
1278 if (propertyChangeListeners
.contains(listener
)) {
1281 propertyChangeListeners
.add(0, listener
);
1286 * removePropertyChangeListener
1290 * a {@link org.eclipse.jface.util.IPropertyChangeListener}
1293 public void removePropertyChangeListener(IPropertyChangeListener listener
) {
1294 propertyChangeListeners
.remove(listener
);
1298 * @return the propertyChangeListeners
1300 public List
<IPropertyChangeListener
> getPropertyChangeListeners() {
1301 return propertyChangeListeners
;
1306 * createHorizontalSeparator
1309 * @param parentElement
1310 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1314 * @return a {@link org.eclipse.swt.widgets.Label} object.
1316 public Label
createHorizontalSeparator(ICdmFormElement parentElement
, int style
) {
1317 Label separator
= this.createSeparator(parentElement
.getLayoutComposite(), SWT
.HORIZONTAL
| style
);
1318 separator
.setLayoutData(LayoutConstants
.FILL_HORIZONTALLY());
1324 * createVersionElement
1327 * @param parentElement
1328 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1331 * a {@link eu.etaxonomy.cdm.model.common.VersionableEntity}
1336 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.VersionElement}
1339 public VersionElement
createVersionElement(ICdmFormElement parentElement
, VersionableEntity entity
, int style
) {
1340 VersionElement element
= new VersionElement(this, parentElement
, entity
, style
);
1342 parentElement
.addElement(element
);
1347 * @param cdmBaseSection
1352 public CdmBaseElement
createCdmBaseElement(ICdmFormElement parentElement
, CdmBase entity
, int style
) {
1353 CdmBaseElement element
= new CdmBaseElement(this, parentElement
, entity
, style
);
1355 parentElement
.addElement(element
);
1361 * createVersionSection
1364 * @param parentElement
1365 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1370 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.VersionSection}
1373 public VersionSection
createVersionSection(ICdmFormElement parentElement
, int style
) {
1374 VersionSection section
= new VersionSection(this, parentElement
, style
);
1375 parentElement
.addElement(section
);
1385 public CdmBaseSection
createCdmBaseSection(ICdmFormElement parentElement
, int style
) {
1386 CdmBaseSection section
= new CdmBaseSection(this, parentElement
, style
);
1387 parentElement
.addElement(section
);
1394 * createEmptyElement
1397 * @param parentElement
1398 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1400 * @return a {@link eu.etaxonomy.taxeditor.ui.section.EmptyElement} object.
1402 public EmptyElement
createEmptyElement(ICdmFormElement parentElement
, String emptyText
) {
1403 EmptyElement element
= new EmptyElement(this, parentElement
, emptyText
, SWT
.NULL
);
1405 parentElement
.addElement(element
);
1411 * createHeadlineSection
1414 * @param parentElement
1415 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1418 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.HeadlineSection}
1421 public HeadlineSection
createHeadlineSection(ICdmFormElement parentElement
) {
1422 HeadlineSection section
= new HeadlineSection(this, parentElement
, SWT
.NULL
);
1423 parentElement
.addElement(section
);
1430 * createParsingMessageElement
1433 * @param parentElement
1434 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1436 * @param parserProblem
1437 * a {@link eu.etaxonomy.cdm.strategy.parser.ParserProblem}
1442 * {@link eu.etaxonomy.taxeditor.ui.section.taxon.ParsingMessageElement}
1445 public ParsingMessageElement
createParsingMessageElement(ICdmFormElement parentElement
,
1446 ParserProblem parserProblem
, int style
) {
1447 ParsingMessageElement element
= new ParsingMessageElement(this, parentElement
, parserProblem
, style
);
1449 parentElement
.addElement(element
);
1453 public AbstractFormSection
createDefinedTermDetailSection(Class definedTermClass
, ConversationHolder conversation
,
1454 ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
1456 AbstractFormSection section
= new DefinedTermDetailSection(this, definedTermClass
, conversation
, parentElement
,
1457 selectionProvider
, style
);
1459 parentElement
.addElement(section
);
1466 * @param definedTermClass
1467 * @param formElement
1471 public AbstractCdmDetailElement
createDefinedTermDetailElement(Class definedTermClass
,
1472 AbstractCdmDetailSection parentElement
, int style
) {
1473 AbstractCdmDetailElement element
= null;
1475 if (NamedArea
.class.isAssignableFrom(definedTermClass
)) {
1476 element
= new eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement(this, parentElement
);
1477 } else if (definedTermClass
.equals(Feature
.class)) {
1478 element
= new FeatureDetailElement(this, parentElement
);
1480 element
= new DefinedTermDetailElement(this, parentElement
);
1484 parentElement
.addElement(element
);
1489 //--------DetailSections---------
1490 public NameDetailSection
createNameDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1491 NameDetailSection section
= new NameDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1492 addAndAdaptSection(parentElement
, section
);
1496 public ReferenceDetailSection
createReferenceDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1497 ReferenceDetailSection section
= new ReferenceDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1498 addAndAdaptSection(parentElement
, section
);
1502 public NomenclaturalReferenceDetailSection
createNomenclaturalReferenceDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1503 NomenclaturalReferenceDetailSection section
= new NomenclaturalReferenceDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1504 addAndAdaptSection(parentElement
, section
);
1508 public TaxonBaseDetailSection
createTaxonBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1509 TaxonBaseDetailSection section
= new TaxonBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1510 addAndAdaptSection(parentElement
, section
);
1514 public AuthorshipDetailSection
createAuthorshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1515 AuthorshipDetailSection section
= new AuthorshipDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1516 addAndAdaptSection(parentElement
, section
);
1520 public TeamOrPersonBaseDetailSection
createTeamOrPersonBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1521 TeamOrPersonBaseDetailSection section
= new TeamOrPersonBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1522 addAndAdaptSection(parentElement
, section
);
1526 public TeamDetailSection
createTeamDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1527 TeamDetailSection section
= new TeamDetailSection(this, conversation
, parentElement
, null, style
);
1528 addAndAdaptSection(parentElement
, section
);
1532 public PersonDetailSection
createPersonDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1533 PersonDetailSection section
= new PersonDetailSection(this, conversation
, parentElement
, null, style
);
1534 addAndAdaptSection(parentElement
, section
);
1538 public DescriptionDetailSection
createDescriptionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1539 DescriptionDetailSection section
= new DescriptionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1540 addAndAdaptSection(parentElement
, section
);
1544 public DescriptionElementDetailSection
createDescriptionElementDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1545 DescriptionElementDetailSection section
= new DescriptionElementDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1546 addAndAdaptSection(parentElement
, section
);
1550 public ParsingMessagesSection
createParsingMessagesSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1551 ParsingMessagesSection section
= new ParsingMessagesSection(this, conversation
, parentElement
, selectionProvider
, style
);
1552 addAndAdaptSection(parentElement
, section
);
1556 public NonViralNameDetailSection
createNonViralNameDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1557 NonViralNameDetailSection section
= new NonViralNameDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1558 addAndAdaptSection(parentElement
, section
);
1562 public MediaDetailsSection
createMediaDetailsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1563 MediaDetailsSection section
= new MediaDetailsSection(this, conversation
, parentElement
, selectionProvider
, style
);
1564 addAndAdaptSection(parentElement
, section
);
1568 public FieldUnitDetailSection
createFieldUnitDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1569 FieldUnitDetailSection section
= new FieldUnitDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1570 addAndAdaptSection(parentElement
, section
);
1574 public GatheringEventDetailSection
createGatheringEventDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1575 GatheringEventDetailSection section
= new GatheringEventDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1576 addAndAdaptSection(parentElement
, section
);
1580 public SpecimenHierarchyDetailSection
createSpecimenHierarchyDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1581 SpecimenHierarchyDetailSection section
= new SpecimenHierarchyDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1582 addAndAdaptSection(parentElement
, section
);
1586 public DerivedUnitBaseDetailSection
createDerivedUnitBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1587 DerivedUnitBaseDetailSection section
= new DerivedUnitBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1588 addAndAdaptSection(parentElement
, section
);
1592 public TaxonAssociationDetailSection
createTaxonAssociationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1593 TaxonAssociationDetailSection section
= new TaxonAssociationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1594 addAndAdaptSection(parentElement
, section
);
1598 public OriginalLabelDataSection
createOriginalLabelDataSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1599 OriginalLabelDataSection section
= new OriginalLabelDataSection(this, conversation
, parentElement
, selectionProvider
, style
);
1600 addAndAdaptSection(parentElement
, section
);
1604 public NaturalLanguageSection
createNaturalLanguageSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1605 NaturalLanguageSection section
= new NaturalLanguageSection(this, conversation
, parentElement
, selectionProvider
, style
);
1606 addAndAdaptSection(parentElement
, section
);
1610 public FeatureDistributionDetailSection
createFeatureDistributionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1611 FeatureDistributionDetailSection section
= new FeatureDistributionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1612 addAndAdaptSection(parentElement
, section
);
1616 public ClassificationDetailSection
createClassificationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1617 ClassificationDetailSection section
= new ClassificationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1618 addAndAdaptSection(parentElement
, section
);
1622 public TaxonNodeDetailSection
createTaxonNodeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1623 TaxonNodeDetailSection section
= new TaxonNodeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1624 addAndAdaptSection(parentElement
, section
);
1628 public PolytomousKeyDetailSection
createPolytomousKeyDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1629 PolytomousKeyDetailSection section
= new PolytomousKeyDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1630 addAndAdaptSection(parentElement
, section
);
1634 public PolytomousKeyNodeDetailSection
createPolytomousKeyNodeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1635 PolytomousKeyNodeDetailSection section
= new PolytomousKeyNodeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1636 addAndAdaptSection(parentElement
, section
);
1640 public InstitutionDetailSection
createInstitutionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1641 InstitutionDetailSection section
= new InstitutionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1642 addAndAdaptSection(parentElement
, section
);
1646 public FieldUnitGeneralDetailSection
createFieldUnitGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1647 FieldUnitGeneralDetailSection section
= new FieldUnitGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1648 addAndAdaptSection(parentElement
, section
);
1652 public DerivedUnitGeneralDetailSection
createDerivedUnitGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1653 DerivedUnitGeneralDetailSection section
= new DerivedUnitGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1654 addAndAdaptSection(parentElement
, section
);
1658 public PreservedSpecimenGeneralDetailSection
createPreservedSpecimenGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1659 PreservedSpecimenGeneralDetailSection section
= new PreservedSpecimenGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1660 addAndAdaptSection(parentElement
, section
);
1664 public TissueSampleGeneralDetailSection
createTissueSampleGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1665 TissueSampleGeneralDetailSection section
= new TissueSampleGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1666 addAndAdaptSection(parentElement
, section
);
1670 public DnaSampleGeneralDetailSection
createDnaSampleGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1671 DnaSampleGeneralDetailSection section
= new DnaSampleGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1672 addAndAdaptSection(parentElement
, section
);
1676 public DnaSamplePreparationPreservationSection
createDnaSamplePreparationPreservationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1677 DnaSamplePreparationPreservationSection section
= new DnaSamplePreparationPreservationSection(this, conversation
, parentElement
, selectionProvider
, style
);
1678 addAndAdaptSection(parentElement
, section
);
1682 public DnaQualityDetailSection
createDnaQualityDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1683 DnaQualityDetailSection section
= new DnaQualityDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1684 addAndAdaptSection(parentElement
, section
);
1688 public SequenceGeneralDetailSection
createSequenceGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1689 SequenceGeneralDetailSection section
= new SequenceGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1690 addAndAdaptSection(parentElement
, section
);
1694 public SequenceContigFileCollectionDetailSection
createSequenceContigFileCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1695 SequenceContigFileCollectionDetailSection section
= new SequenceContigFileCollectionDetailSection(this, conversation
, parentElement
, style
);
1696 addAndAdaptSection(parentElement
, section
);
1700 public SingleReadPherogramCollectionDetailSection
createSingleReadPherogramCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1701 SingleReadPherogramCollectionDetailSection section
= new SingleReadPherogramCollectionDetailSection(this, conversation
, parentElement
, style
);
1702 addAndAdaptSection(parentElement
, section
);
1706 public SequenceReferenceCollectionDetailSection
createSequenceReferenceCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1707 SequenceReferenceCollectionDetailSection section
= new SequenceReferenceCollectionDetailSection(this, conversation
, parentElement
, style
);
1708 addAndAdaptSection(parentElement
, section
);
1712 public SingleReadGeneralDetailSection
createSingleReadGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1713 SingleReadGeneralDetailSection section
= new SingleReadGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1714 addAndAdaptSection(parentElement
, section
);
1718 public AmplificationGeneralDetailSection
createAmplificationGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1719 AmplificationGeneralDetailSection section
= new AmplificationGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1720 addAndAdaptSection(parentElement
, section
);
1724 public AmplificationPrimerDetailSection
createAmplificationPrimerDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1725 AmplificationPrimerDetailSection section
= new AmplificationPrimerDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1726 addAndAdaptSection(parentElement
, section
);
1730 public AmplificationCloningDetailSection
createAmplificationCloningDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1731 AmplificationCloningDetailSection section
= new AmplificationCloningDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1732 addAndAdaptSection(parentElement
, section
);
1736 public AmplificationGelPhotoCollectionDetailSection
createAmplificationGelPhotoCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1737 AmplificationGelPhotoCollectionDetailSection section
= new AmplificationGelPhotoCollectionDetailSection(this, conversation
, parentElement
, style
);
1738 addAndAdaptSection(parentElement
, section
);
1742 public MediaSpecimenGeneralDetailSection
createMediaSpecimenGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1743 MediaSpecimenGeneralDetailSection section
= new MediaSpecimenGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1744 addAndAdaptSection(parentElement
, section
);
1748 public HybridDetailSection
createHybridDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1749 HybridDetailSection section
= new HybridDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1750 addAndAdaptSection(parentElement
, section
);
1754 public UserDetailSection
createUserDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1755 UserDetailSection section
= new UserDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1756 addAndAdaptSection(parentElement
, section
);
1760 public GroupDetailSection
createGroupDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1761 GroupDetailSection section
= new GroupDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1762 addAndAdaptSection(parentElement
, section
);
1766 public DeterminationDetailSection
createDeterminationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1767 DeterminationDetailSection section
= new DeterminationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1768 addAndAdaptSection(parentElement
, section
);
1772 public SampleDesignationDetailSection
createSampleDesignationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1773 SampleDesignationDetailSection section
= new SampleDesignationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1774 addAndAdaptSection(parentElement
, section
);
1778 public PreservedSpecimenDeterminationDetailSection
createPreservedSpecimenDeterminationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1779 PreservedSpecimenDeterminationDetailSection section
= new PreservedSpecimenDeterminationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1780 addAndAdaptSection(parentElement
, section
);
1784 public TaxonRelationshipDetailSection
createTaxonRelationshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1785 TaxonRelationshipDetailSection section
= new TaxonRelationshipDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1786 addAndAdaptSection(parentElement
, section
);
1790 public ReferencedEntityDetailSection
createReferencedEntityDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1791 ReferencedEntityDetailSection section
= new ReferencedEntityDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1792 addAndAdaptSection(parentElement
, section
);
1796 public TermVocabularyDetailSection
createTermVocabularyDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1797 TermVocabularyDetailSection section
= new TermVocabularyDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1798 addAndAdaptSection(parentElement
, section
);
1802 public GatheringEventDetailSection
createGatheringSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1803 GatheringEventDetailSection section
= new GatheringEventDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1804 addAndAdaptSection(parentElement
, section
);
1808 public NamedAreaDetailSection
createNamedAreaDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1809 NamedAreaDetailSection section
= new NamedAreaDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1810 addAndAdaptSection(parentElement
, section
);
1814 public UseRecordDetailSection
createUseRecordDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1815 UseRecordDetailSection section
= new UseRecordDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1816 addAndAdaptSection(parentElement
, section
);
1820 private void addAndAdaptSection(ICdmFormElement parentElement
, AbstractFormSection
<?
> section
) {
1821 parentElement
.addElement(section
);
1825 //--------DetailElements------------
1827 public UseRecordDetailElement
createUseRecordDetailElement(ICdmFormElement parentElement
){
1828 UseRecordDetailElement element
= new UseRecordDetailElement(this, parentElement
);
1829 addAndAdaptElement(parentElement
, element
);
1833 public DefinedTermDetailElement
<NamedAreaLevel
> createNamedAreaLevelElement(ICdmFormElement parentElement
){
1834 DefinedTermDetailElement
<NamedAreaLevel
> element
= new DefinedTermDetailElement
<NamedAreaLevel
>(this, parentElement
);
1835 addAndAdaptElement(parentElement
, element
);
1839 public eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement
createNamedAreaDetailElement(ICdmFormElement parentElement
){
1840 eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement element
= new eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement(this, parentElement
);
1841 addAndAdaptElement(parentElement
, element
);
1845 public TermVocabularyDetailElement
createTermVocabularyDetailElement(ICdmFormElement parentElement
){
1846 TermVocabularyDetailElement element
= new TermVocabularyDetailElement(this, parentElement
);
1847 addAndAdaptElement(parentElement
, element
);
1851 public ReferenceEntityDetailElement
createReferenceEntityDetailElement(ICdmFormElement parentElement
){
1852 ReferenceEntityDetailElement element
= new ReferenceEntityDetailElement(this, parentElement
);
1853 addAndAdaptElement(parentElement
, element
);
1857 public TaxonRelationshipDetailElement
createTaxonRelationshipDetailElement(ICdmFormElement parentElement
){
1858 TaxonRelationshipDetailElement element
= new TaxonRelationshipDetailElement(this, parentElement
);
1859 addAndAdaptElement(parentElement
, element
);
1863 public GrantedAuthorityDetailElement
createGrantedAuthorityDetailElement(ICdmFormElement parentElement
){
1864 GrantedAuthorityDetailElement element
= new GrantedAuthorityDetailElement(this, parentElement
);
1865 addAndAdaptElement(parentElement
, element
);
1869 public GroupDetailElement
createGroupDetailElement(ICdmFormElement parentElement
){
1870 GroupDetailElement element
= new GroupDetailElement(this, parentElement
);
1871 addAndAdaptElement(parentElement
, element
);
1875 public UserDetailElement
createUserDetailElement(ICdmFormElement parentElement
){
1876 UserDetailElement element
= new UserDetailElement(this, parentElement
);
1877 addAndAdaptElement(parentElement
, element
);
1881 public HybridDetailElement
createHybridDetailElement(ICdmFormElement parentElement
){
1882 HybridDetailElement element
= new HybridDetailElement(this, parentElement
);
1883 addAndAdaptElement(parentElement
, element
);
1887 public InstitutionDetailElement
createInstitutionDetailElement(ICdmFormElement parentElement
){
1888 InstitutionDetailElement element
= new InstitutionDetailElement(this, parentElement
);
1889 addAndAdaptElement(parentElement
, element
);
1893 public PolytomousKeyNodeDetailElement
createPolytomousKeyNodeDetailElement(ICdmFormElement parentElement
){
1894 PolytomousKeyNodeDetailElement element
= new PolytomousKeyNodeDetailElement(this, parentElement
);
1895 addAndAdaptElement(parentElement
, element
);
1899 public PolytomousKeyDetailElement
createPolytomousKeyDetailElement(ICdmFormElement parentElement
){
1900 PolytomousKeyDetailElement element
= new PolytomousKeyDetailElement(this, parentElement
);
1901 addAndAdaptElement(parentElement
, element
);
1905 public CollectionDetailElement
createCollectionDetailElement(ICdmFormElement parentElement
){
1906 CollectionDetailElement element
= new CollectionDetailElement(this, parentElement
);
1907 addAndAdaptElement(parentElement
, element
);
1911 public TaxonNodeDetailElement
createTaxonNodeDetailElement(ICdmFormElement parentElement
){
1912 TaxonNodeDetailElement element
= new TaxonNodeDetailElement(this, parentElement
);
1913 addAndAdaptElement(parentElement
, element
);
1917 public ClassificationDetailElement
createClassificationDetailElement(ICdmFormElement parentElement
){
1918 ClassificationDetailElement element
= new ClassificationDetailElement(this, parentElement
);
1919 addAndAdaptElement(parentElement
, element
);
1923 public FeatureDistributionDetailElement
createFeatureDistributionDetailElement(ICdmFormElement parentElement
){
1924 FeatureDistributionDetailElement element
= new FeatureDistributionDetailElement(this, parentElement
);
1925 addAndAdaptElement(parentElement
, element
);
1929 public NaturalLanguageDetailElement
createNaturalLanguageDetailElement(ICdmFormElement parentElement
){
1930 NaturalLanguageDetailElement element
= new NaturalLanguageDetailElement(this, parentElement
);
1931 addAndAdaptElement(parentElement
, element
);
1935 public NonViralNameDetailElement
createNonViralNameDetailElement(ICdmFormElement parentElement
){
1936 NonViralNameDetailElement element
= new NonViralNameDetailElement(this, parentElement
);
1937 addAndAdaptElement(parentElement
, element
);
1941 public DescriptionElementDetailElement
createDescriptionElementDetailElement(ICdmFormElement parentElement
, int style
){
1942 DescriptionElementDetailElement element
= new DescriptionElementDetailElement(this, parentElement
, style
);
1943 addAndAdaptElement(parentElement
, element
);
1947 public DescriptionDetailElement
createDescriptionDetailElement(ICdmFormElement parentElement
, int style
){
1948 DescriptionDetailElement element
= new DescriptionDetailElement(this, parentElement
, style
);
1949 addAndAdaptElement(parentElement
, element
);
1953 public PersonDetailElement
createPersonDetailElement(ICdmFormElement parentElement
, int style
){
1954 PersonDetailElement element
= new PersonDetailElement(this, parentElement
, style
);
1955 addAndAdaptElement(parentElement
, element
);
1959 public TeamDetailElement
createTeamDetailElement(ICdmFormElement parentElement
, int style
){
1960 TeamDetailElement element
= new TeamDetailElement(this, parentElement
, style
);
1961 addAndAdaptElement(parentElement
, element
);
1965 public AuthorshipDetailElement
createAuthorshipDetailElement(ICdmFormElement parentElement
, int style
){
1966 AuthorshipDetailElement element
= new AuthorshipDetailElement(this, parentElement
, style
);
1967 addAndAdaptElement(parentElement
, element
);
1971 public TaxonBaseDetailElement
createTaxonBaseDetailElement(ICdmFormElement parentElement
, int style
){
1972 TaxonBaseDetailElement element
= new TaxonBaseDetailElement(this, parentElement
, style
);
1973 addAndAdaptElement(parentElement
, element
);
1977 public NameDetailElement
createNameDetailElement(ICdmFormElement parentElement
, int style
){
1978 NameDetailElement element
= new NameDetailElement(this, parentElement
, style
);
1979 addAndAdaptElement(parentElement
, element
);
1983 public ReferenceDetailElement
createReferenceDetailElement(ICdmFormElement parentElement
, int style
){
1984 ReferenceDetailElement element
= new ReferenceDetailElement(this, parentElement
, style
);
1985 addAndAdaptElement(parentElement
, element
);
1989 public NomenclaturalReferenceDetailElement
createNomenclaturalReferenceDetailElement(ICdmFormElement parentElement
, int style
){
1990 NomenclaturalReferenceDetailElement element
= new NomenclaturalReferenceDetailElement(this, parentElement
, style
);
1991 addAndAdaptElement(parentElement
, element
);
1996 public FieldUnitGeneralDetailElement
createFieldUnitGeneralDetailElement(ICdmFormElement parentElement
){
1997 FieldUnitGeneralDetailElement element
= new FieldUnitGeneralDetailElement(this, parentElement
);
1998 addAndAdaptElement(parentElement
, element
);
2002 public DerivedUnitGeneralDetailElement
createDerivedUnitGeneralDetailElement(ICdmFormElement parentElement
){
2003 DerivedUnitGeneralDetailElement element
= new DerivedUnitGeneralDetailElement(this, parentElement
);
2004 addAndAdaptElement(parentElement
, element
);
2008 public TaxonAssociationDetailElement
createTaxonAssociationDetailElement(ICdmFormElement parentElement
){
2009 TaxonAssociationDetailElement element
= new TaxonAssociationDetailElement(this, parentElement
);
2010 addAndAdaptElement(parentElement
, element
);
2014 public PreservedSpecimenGeneralDetailElement
createPreservedSpecimenGeneralDetailElement(ICdmFormElement parentElement
){
2015 PreservedSpecimenGeneralDetailElement element
= new PreservedSpecimenGeneralDetailElement(this, parentElement
);
2016 addAndAdaptElement(parentElement
, element
);
2020 public TissueSampleGeneralDetailElement
createTissueSampleGeneralDetailElement(ICdmFormElement parentElement
){
2021 TissueSampleGeneralDetailElement element
= new TissueSampleGeneralDetailElement(this, parentElement
);
2022 addAndAdaptElement(parentElement
, element
);
2026 public DnaSampleGeneralDetailElement
createDnaSampleGeneralDetailElement(ICdmFormElement parentElement
){
2027 DnaSampleGeneralDetailElement element
= new DnaSampleGeneralDetailElement(this, parentElement
);
2028 addAndAdaptElement(parentElement
, element
);
2032 public DnaSamplePreparationPreservationDetailElement
createDnaSamplePreparationPreservationDetailElement(ICdmFormElement parentElement
){
2033 DnaSamplePreparationPreservationDetailElement element
= new DnaSamplePreparationPreservationDetailElement(this, parentElement
);
2034 addAndAdaptElement(parentElement
, element
);
2038 public DnaQualityDetailElement
createDnaQualityDetailElement(ICdmFormElement parentElement
){
2039 DnaQualityDetailElement element
= new DnaQualityDetailElement(this, parentElement
);
2040 addAndAdaptElement(parentElement
, element
);
2044 public SequenceGeneralDetailElement
createSequenceGeneralDetailElement(ICdmFormElement parentElement
){
2045 SequenceGeneralDetailElement element
= new SequenceGeneralDetailElement(this, parentElement
);
2046 addAndAdaptElement(parentElement
, element
);
2050 public SingleReadGeneralDetailElement
createSingleReadGeneralDetailElement(ICdmFormElement parentElement
){
2051 SingleReadGeneralDetailElement element
= new SingleReadGeneralDetailElement(this, parentElement
);
2052 addAndAdaptElement(parentElement
, element
);
2056 public PrimerGeneralDetailElement
createPrimerGeneralDetailElement(ICdmFormElement parentElement
){
2057 PrimerGeneralDetailElement element
= new PrimerGeneralDetailElement(this, parentElement
);
2058 addAndAdaptElement(parentElement
, element
);
2062 public AmplificationGeneralDetailElement
createAmplificationGeneralDetailElement(ICdmFormElement parentElement
){
2063 AmplificationGeneralDetailElement element
= new AmplificationGeneralDetailElement(this, parentElement
);
2064 addAndAdaptElement(parentElement
, element
);
2068 public AmplificationPrimerDetailElement
createAmplificationPrimerDetailElement(ICdmFormElement parentElement
){
2069 AmplificationPrimerDetailElement element
= new AmplificationPrimerDetailElement(this, parentElement
);
2070 addAndAdaptElement(parentElement
, element
);
2074 public AmplificationCloningDetailElement
createAmplificationCloningDetailElement(ICdmFormElement parentElement
){
2075 AmplificationCloningDetailElement element
= new AmplificationCloningDetailElement(this, parentElement
);
2076 addAndAdaptElement(parentElement
, element
);
2080 public AmplificationGelPhotoDetailElement
createAmplificationGelPhotoDetailElement(ICdmFormElement parentElement
){
2081 AmplificationGelPhotoDetailElement element
= new AmplificationGelPhotoDetailElement(this, parentElement
);
2082 addAndAdaptElement(parentElement
, element
);
2086 public MediaSpecimenGeneralDetailElement
createMediaSpecimenGeneralDetailElement(ICdmFormElement parentElement
){
2087 MediaSpecimenGeneralDetailElement element
= new MediaSpecimenGeneralDetailElement(this, parentElement
);
2088 addAndAdaptElement(parentElement
, element
);
2092 public MediaDetailElement
createMediaDetailElement(ICdmFormElement parentElement
){
2093 MediaDetailElement mediaDetailElement
= new MediaDetailElement(this, parentElement
);
2094 addAndAdaptElement(parentElement
, mediaDetailElement
);
2095 return mediaDetailElement
;
2098 public GatheringEventDetailElement
createGatheringEventDetailElement(ICdmFormElement parentElement
) {
2099 GatheringEventDetailElement element
= new GatheringEventDetailElement(this, parentElement
);
2100 addAndAdaptElement(parentElement
, element
);
2104 public FieldUnitDetailElement
createFieldUnitDetailElement(ICdmFormElement parentElement
) {
2105 FieldUnitDetailElement element
= new FieldUnitDetailElement(this, parentElement
);
2106 addAndAdaptElement(parentElement
, element
);
2110 public SpecimenHierarchyDetailElement
createSpecimenHierarchyDetailElement(ICdmFormElement parentElement
) {
2111 SpecimenHierarchyDetailElement element
= new SpecimenHierarchyDetailElement(this, parentElement
);
2112 addAndAdaptElement(parentElement
, element
);
2116 public DerivedUnitBaseDetailElement
createDerivedUnitBaseDetailElement(ICdmFormElement parentElement
) {
2117 DerivedUnitBaseDetailElement element
= new DerivedUnitBaseDetailElement(this, parentElement
);
2118 addAndAdaptElement(parentElement
, element
);
2122 public OriginalLabelDataElement
createOriginalLabelDataElement(ICdmFormElement parentElement
) {
2123 OriginalLabelDataElement element
= new OriginalLabelDataElement(this, parentElement
);
2124 addAndAdaptElement(parentElement
, element
);
2128 public PreservedSpecimenDetailElement
createPreservedSpecimenDetailElement(ICdmFormElement parentElement
) {
2129 PreservedSpecimenDetailElement element
= new PreservedSpecimenDetailElement(this, parentElement
);
2130 addAndAdaptElement(parentElement
, element
);
2134 public PreservedSpecimenDeterminationDetailElement
createPreservedSpecimenDeterminationDetailElement(ICdmFormElement parentElement
) {
2135 PreservedSpecimenDeterminationDetailElement element
= new PreservedSpecimenDeterminationDetailElement(this, parentElement
);
2136 addAndAdaptElement(parentElement
, element
);
2140 public DeterminationDetailElement
createDeterminationDetailElement(ICdmFormElement parentElement
) {
2141 DeterminationDetailElement element
= new DeterminationDetailElement(this, parentElement
);
2142 addAndAdaptElement(parentElement
, element
);
2146 public SampleDesignationDetailElement
createSampleDesignationDetailElement(ICdmFormElement parentElement
) {
2147 SampleDesignationDetailElement element
= new SampleDesignationDetailElement(this, parentElement
);
2148 addAndAdaptElement(parentElement
, element
);
2153 * @param parentElement
2156 private void addAndAdaptElement(ICdmFormElement parentElement
, AbstractCdmDetailElement
<?
> element
) {
2158 parentElement
.addElement(element
);
2161 //--------EntityCollectionSection----------
2162 public TeamMemberSection
createTeamMemberSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2163 TeamMemberSection section
= new TeamMemberSection(this, conversation
, parentElement
, style
);
2164 addAndAdaptSection(parentElement
, section
);
2168 public AnnotationSection
createAnnotationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2169 AnnotationSection section
= new AnnotationSection(this, conversation
, parentElement
, style
);
2170 addAndAdaptSection(parentElement
, section
);
2174 public CreditSection
createCreditSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2175 CreditSection section
= new CreditSection(this, conversation
, parentElement
, style
);
2176 addAndAdaptSection(parentElement
, section
);
2180 public DescriptionElementSourceSection
createDescriptionElementSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2181 DescriptionElementSourceSection section
= new DescriptionElementSourceSection(this, conversation
, parentElement
, style
);
2182 addAndAdaptSection(parentElement
, section
);
2186 public ExtensionSection
createExtensionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2187 ExtensionSection section
= new ExtensionSection(this, conversation
, parentElement
, style
);
2188 addAndAdaptSection(parentElement
, section
);
2192 public MarkerSection
createMarkerSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2193 MarkerSection section
= new MarkerSection(this, conversation
, parentElement
, style
);
2194 addAndAdaptSection(parentElement
, section
);
2198 public MediaSection
createMediaSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2199 MediaSection section
= new MediaSection(this, conversation
, parentElement
, style
);
2200 addAndAdaptSection(parentElement
, section
);
2204 public DescriptionElementMediaSection
createDescriptionElementMediaSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2205 DescriptionElementMediaSection section
= new DescriptionElementMediaSection(this, conversation
, parentElement
, style
);
2206 addAndAdaptSection(parentElement
, section
);
2210 public MediaRepresentationSection
createMediaRepresentationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2211 MediaRepresentationSection section
= new MediaRepresentationSection(this, conversation
, parentElement
, style
);
2212 addAndAdaptSection(parentElement
, section
);
2216 public MediaRepresentationPartSection
createMediaRepresentationPartSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2217 MediaRepresentationPartSection section
= new MediaRepresentationPartSection(this, conversation
, parentElement
, style
);
2218 addAndAdaptSection(parentElement
, section
);
2222 public ModifierSection
createModifierSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2223 ModifierSection section
= new ModifierSection(this, conversation
, parentElement
, style
);
2224 addAndAdaptSection(parentElement
, section
);
2228 public NomenclaturalStatusSection
createNomenclaturalStatusSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2229 NomenclaturalStatusSection section
= new NomenclaturalStatusSection(this, conversation
, parentElement
, style
);
2230 addAndAdaptSection(parentElement
, section
);
2234 public NameRelationshipDetailSection
createNameRelationshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2235 NameRelationshipDetailSection section
= new NameRelationshipDetailSection(this, conversation
, parentElement
, style
);
2236 addAndAdaptSection(parentElement
, section
);
2240 public SynonymRelationshipDetailSection
createSynonymRelationshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2241 SynonymRelationshipDetailSection section
= new SynonymRelationshipDetailSection(this, conversation
, parentElement
, style
);
2242 addAndAdaptSection(parentElement
, section
);
2246 public ProtologueSection
createProtologueSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2247 ProtologueSection section
= new ProtologueSection(this, conversation
, parentElement
, style
);
2248 addAndAdaptSection(parentElement
, section
);
2252 public RightsSection
createRightsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2253 RightsSection section
= new RightsSection(this, conversation
, parentElement
, style
);
2254 addAndAdaptSection(parentElement
, section
);
2258 public SourceSection
createSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2259 SourceSection section
= new SourceSection(this, conversation
, parentElement
, style
);
2260 addAndAdaptSection(parentElement
, section
);
2264 public ScopeSection
createScopeSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2265 ScopeSection section
= new ScopeSection(this, conversation
, parentElement
, style
);
2266 addAndAdaptSection(parentElement
, section
);
2270 public DescriptionSourceSection
createDescriptionSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2271 DescriptionSourceSection section
= new DescriptionSourceSection(this, conversation
, parentElement
, style
);
2272 addAndAdaptSection(parentElement
, section
);
2276 public TypeDesignationSection
createTypeDesignationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2277 TypeDesignationSection section
= new TypeDesignationSection(this, conversation
, parentElement
, style
);
2278 addAndAdaptSection(parentElement
, section
);
2282 public StateDataSection
createStateDataSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2283 StateDataSection section
= new StateDataSection(this, conversation
, parentElement
, style
);
2284 addAndAdaptSection(parentElement
, section
);
2288 public StatisticalMeasurementValueSection
createStatisticalMeasurementValueSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2289 StatisticalMeasurementValueSection section
= new StatisticalMeasurementValueSection(this, conversation
, parentElement
, style
);
2290 addAndAdaptSection(parentElement
, section
);
2294 public DescribedSpecimenSection
createDescribedSpecimenSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2295 DescribedSpecimenSection section
= new DescribedSpecimenSection(this, conversation
, parentElement
, style
);
2296 addAndAdaptSection(parentElement
, section
);
2300 public StateVocabularyCollectionSection
createStateVocabulariesSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2301 StateVocabularyCollectionSection section
= new StateVocabularyCollectionSection(this, conversation
, parentElement
, style
);
2302 addAndAdaptSection(parentElement
, section
);
2306 public RecommendedModifierVocabulariesCollectionSection
createRecommendedModifierVocabulariesCollectionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2307 RecommendedModifierVocabulariesCollectionSection section
= new RecommendedModifierVocabulariesCollectionSection(this, conversation
, parentElement
, style
);
2308 addAndAdaptSection(parentElement
, section
);
2312 public MeasurementUnitCollectionSection
createMeasurementUnitCollectionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2313 MeasurementUnitCollectionSection section
= new MeasurementUnitCollectionSection(this, conversation
, parentElement
, style
);
2314 addAndAdaptSection(parentElement
, section
);
2318 public StatisticalMeasureCollectionSection
createStatisticalMeasureCollectionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2319 StatisticalMeasureCollectionSection section
= new StatisticalMeasureCollectionSection(this, conversation
, parentElement
, style
);
2320 addAndAdaptSection(parentElement
, section
);
2324 public CollectingAreasDetailSection
createCollectingAreasDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2325 CollectingAreasDetailSection section
= new CollectingAreasDetailSection(this, conversation
, parentElement
, style
);
2326 addAndAdaptSection(parentElement
, section
);
2330 public GeoScopeDetailSection
createGeoScopeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2331 GeoScopeDetailSection section
= new GeoScopeDetailSection(this, conversation
, parentElement
, style
);
2332 addAndAdaptSection(parentElement
, section
);
2336 public GeoScopePolyKeyDetailSection
createGeoScopePolyKeyDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2337 GeoScopePolyKeyDetailSection section
= new GeoScopePolyKeyDetailSection(this, conversation
, parentElement
, style
);
2338 addAndAdaptSection(parentElement
, section
);
2342 public IdentifierDetailSection
createIdentifierDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2343 IdentifierDetailSection section
= new IdentifierDetailSection(this, conversation
, parentElement
, style
);
2344 addAndAdaptSection(parentElement
, section
);
2348 public CurrentSampleDesignationDetailSection
createCurrentSampleDesignationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2349 CurrentSampleDesignationDetailSection section
= new CurrentSampleDesignationDetailSection(this, conversation
, parentElement
, style
);
2350 addAndAdaptSection(parentElement
, section
);
2354 public CurrentDeterminationDetailSection
createCurrentDeterminationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2355 CurrentDeterminationDetailSection section
= new CurrentDeterminationDetailSection(this, conversation
, parentElement
, style
);
2356 addAndAdaptSection(parentElement
, section
);
2360 public PreservedSpecimenCurrentDeterminationDetailSection
createPreservedSpecimenCurrentDeterminationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2361 PreservedSpecimenCurrentDeterminationDetailSection section
= new PreservedSpecimenCurrentDeterminationDetailSection(this, conversation
, parentElement
, style
);
2362 addAndAdaptSection(parentElement
, section
);
2366 public SampleDesignationHistoryDetailSection
createSampleDesignationHistoryDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2367 SampleDesignationHistoryDetailSection section
= new SampleDesignationHistoryDetailSection(this, conversation
, parentElement
, style
);
2368 addAndAdaptSection(parentElement
, section
);
2372 public DeterminationHistoryDetailSection
createDeterminationHistoryDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2373 DeterminationHistoryDetailSection section
= new DeterminationHistoryDetailSection(this, conversation
, parentElement
, style
);
2374 addAndAdaptSection(parentElement
, section
);
2378 public PreservedSpecimenDeterminationHistoryDetailSection
createPreservedSpecimenDeterminationHistoryDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2379 PreservedSpecimenDeterminationHistoryDetailSection section
= new PreservedSpecimenDeterminationHistoryDetailSection(this, conversation
, parentElement
, style
);
2380 addAndAdaptSection(parentElement
, section
);
2384 public SpecimenCollectionDetailSection
createSpecimenCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2385 SpecimenCollectionDetailSection section
= new SpecimenCollectionDetailSection(this, conversation
, parentElement
, style
);
2386 addAndAdaptSection(parentElement
, section
);
2390 public PreservedSpecimenSourceCollectionDetailSection
createPreservedSpecimenSourceCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2391 PreservedSpecimenSourceCollectionDetailSection section
= new PreservedSpecimenSourceCollectionDetailSection(this, conversation
, parentElement
, style
);
2392 addAndAdaptSection(parentElement
, section
);
2396 public SourceCollectionDetailSection
createSourceCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2397 SourceCollectionDetailSection section
= new SourceCollectionDetailSection(this, conversation
, parentElement
, style
);
2398 addAndAdaptSection(parentElement
, section
);
2402 public ScopeRestrictionSection
createScopeRestrictionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2403 ScopeRestrictionSection section
= new ScopeRestrictionSection(this, conversation
, parentElement
, style
);
2404 addAndAdaptSection(parentElement
, section
);
2408 public MemberDetailSection
createMemberDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2409 MemberDetailSection section
= new MemberDetailSection(this, conversation
, parentElement
, style
);
2410 addAndAdaptSection(parentElement
, section
);
2414 public GrantedAuthorityDetailSection
createGrantedAuthorityDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2415 GrantedAuthorityDetailSection section
= new GrantedAuthorityDetailSection(this, conversation
, parentElement
, style
);
2416 addAndAdaptSection(parentElement
, section
);
2420 public GroupsByUserDetailSection
createGroupsByUserDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2421 GroupsByUserDetailSection section
= new GroupsByUserDetailSection(this, conversation
, parentElement
, style
);
2422 addAndAdaptSection(parentElement
, section
);
2426 public TaxonomicScopeSection
createTaxonomicScopeSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2427 TaxonomicScopeSection section
= new TaxonomicScopeSection(this, conversation
, parentElement
, style
);
2428 addAndAdaptSection(parentElement
, section
);
2432 public AbstractEntityCollectionElement
createEntityCollectionElement(AbstractFormSection parentElement
,
2433 Object versionableEntity
, SelectionListener removeListener
, Color backgroundColor
, int style
) {
2434 AbstractEntityCollectionElement element
= null;
2436 Object entity
= HibernateProxyHelper
.deproxy(versionableEntity
);
2438 if (entity
instanceof Annotation
) {
2439 element
= new AnnotationElement(this, parentElement
, (Annotation
) entity
, removeListener
, style
);
2440 } else if (entity
instanceof Person
) {
2441 element
= new TeamMemberElement(this, parentElement
, (Person
) entity
, removeListener
, style
);
2442 } else if (entity
instanceof Credit
) {
2443 element
= new CreditElement(this, parentElement
, (Credit
) entity
, removeListener
, style
);
2444 } else if (entity
instanceof Extension
) {
2445 element
= new ExtensionElement(this, parentElement
, (Extension
) entity
, removeListener
, style
);
2446 } else if (entity
instanceof Marker
) {
2447 element
= new MarkerElement(this, parentElement
, (Marker
) entity
, removeListener
, style
);
2448 } else if (entity
instanceof Media
) {
2449 element
= new MediaMetaElement(this, parentElement
, (Media
) entity
, removeListener
, true, style
);
2450 } else if (entity
instanceof MediaRepresentation
) {
2451 element
= new MediaRepresentationElement(this, parentElement
, (MediaRepresentation
) entity
, removeListener
,
2453 } else if (entity
instanceof ImageFile
) {
2454 element
= new ImageFileElement(this, parentElement
, (ImageFile
) entity
, removeListener
, style
);
2455 } else if (entity
instanceof MediaRepresentationPart
) {
2456 element
= new MediaRepresentationPartElement(this, parentElement
, (MediaRepresentationPart
) entity
,
2457 removeListener
, style
);
2458 } else if (entity
instanceof NomenclaturalStatus
) {
2459 element
= new NomenclaturalStatusElement(this, parentElement
, (NomenclaturalStatus
) entity
, removeListener
,
2461 } else if (entity
instanceof Rights
) {
2462 element
= new RightsElement(this, parentElement
, (Rights
) entity
, removeListener
, style
);
2463 } else if (entity
instanceof DescriptionElementSource
) {
2464 element
= new DescriptionElementSourceElement(this, parentElement
, (DescriptionElementSource
) entity
,
2465 removeListener
, style
);
2466 } else if (entity
instanceof IdentifiableSource
) {
2467 element
= new IdentifiableSourceElement(this, parentElement
, (IdentifiableSource
) entity
, removeListener
,
2469 } else if (entity
instanceof DefinedTerm
) {
2470 switch(((DefinedTerm
)entity
).getTermType()) {
2472 element
= new ScopeElement(this,
2474 (DefinedTerm
) entity
,
2479 element
= new ModifierElement(this,
2481 (DefinedTerm
) entity
,
2489 } else if (entity
instanceof Reference
) {
2490 if(parentElement
instanceof SequenceReferenceCollectionDetailSection
){
2491 element
= new SequenceReferenceCollectionDetailElement(this, parentElement
, (Reference
) entity
, removeListener
, style
);
2494 element
= new DescriptionSourceElement(this, parentElement
, (Reference
) entity
, removeListener
, style
);
2496 } else if (entity
instanceof NameTypeDesignation
) {
2497 element
= new NameTypeDesignationElement(this, parentElement
, (NameTypeDesignation
) entity
, removeListener
,
2499 } else if (entity
instanceof NameRelationship
) {
2500 element
= new NameRelationshipDetailElement(this, parentElement
, (NameRelationship
) entity
, removeListener
,
2502 } else if (entity
instanceof SynonymRelationship
) {
2503 element
= new SynonymRelationshipDetailElement(this, parentElement
, (SynonymRelationship
) entity
, removeListener
,
2505 } else if (entity
instanceof SpecimenTypeDesignation
) {
2506 element
= new SpecimenTypeDesignationElement(this, parentElement
, (SpecimenTypeDesignation
) entity
,
2507 removeListener
, style
);
2508 } else if (entity
instanceof StateData
) {
2509 element
= new StateDataElement(this, parentElement
, (StateData
) entity
, removeListener
, style
);
2510 } else if (entity
instanceof StatisticalMeasurementValue
) {
2511 element
= new StatisticalMeasurementValueElement(this, parentElement
, (StatisticalMeasurementValue
) entity
,
2512 removeListener
, style
);
2513 } else if (entity
instanceof DerivedUnit
) {
2514 switch(((DerivedUnit
)entity
).getRecordBasis()) {
2515 case LivingSpecimen
:
2516 case PreservedSpecimen
:
2518 element
= new SpecimenCollectionDetailElement(this,
2520 (DerivedUnit
) entity
,
2525 element
= new DerivedUnitElement(this,
2527 (DerivedUnit
) entity
,
2532 } else if (entity
instanceof NamedArea
) {
2533 element
= new NamedAreaDetailElement(this, parentElement
, (NamedArea
) entity
, removeListener
, style
);
2534 } else if (entity
instanceof DeterminationEvent
) {
2535 element
= new DeterminationEventDetailElement(this, parentElement
, (DeterminationEvent
) entity
, removeListener
, style
);
2536 } else if (entity
instanceof User
) {
2537 element
= new MemberDetailElement(this, parentElement
, (User
) entity
, removeListener
, style
);
2538 } else if (entity
instanceof GrantedAuthority
) {
2539 element
= new GrantedAuthorityCollectionElement(this, parentElement
, (GrantedAuthorityImpl
) entity
,
2540 removeListener
, style
);
2541 } else if (entity
instanceof Group
) {
2542 element
= new GroupsByUserDetailElement(this, parentElement
, (Group
) entity
, removeListener
, style
);
2543 } else if (entity
instanceof Taxon
) {
2544 element
= new TaxonDetailElement(this, parentElement
, (Taxon
) entity
, removeListener
, style
);
2545 } else if (entity
instanceof DescriptionElementBase
) {
2546 // this is the special case for protologs, maybe we can do this
2547 // differently when API improves
2548 DescriptionElementBase descriptionElement
= (DescriptionElementBase
) entity
;
2549 if (descriptionElement
.getFeature().equals(Feature
.PROTOLOGUE())) {
2550 element
= new ProtologueElement(this, parentElement
, descriptionElement
, removeListener
, style
);
2552 } else if (entity
instanceof Identifier
) {
2553 if(parentElement
instanceof AbstractSampleDesignationDetailSection
){
2554 element
= new SampleDesignationTextDetailElement(this, parentElement
, (Identifier
<DnaSample
>) entity
, removeListener
, backgroundColor
, style
);
2557 element
= new IdentifierDetailElement(this, parentElement
, (Identifier
) entity
, removeListener
, style
);
2559 } else if (entity
instanceof TermVocabulary
) {
2560 TermVocabulary
<?
> termVocabulary
= (TermVocabulary
<?
>)entity
;
2561 switch (termVocabulary
.getTermType()) {
2563 element
= new StateVocabularyCollectionElement(this, parentElement
, (TermVocabulary
<State
>) entity
, removeListener
, backgroundColor
, style
);
2566 element
= new RecommendedModifierVocabulariesElement(this, parentElement
, (TermVocabulary
<DefinedTerm
>) entity
, removeListener
, backgroundColor
, style
);
2571 } else if (entity
instanceof MeasurementUnit
) {
2572 element
= new MeasurementUnitCollectionElement(this, parentElement
, (MeasurementUnit
) entity
, removeListener
, backgroundColor
, style
);
2573 } else if (entity
instanceof StatisticalMeasure
) {
2574 element
= new StatisticalMeasureCollectionElement(this, parentElement
, (StatisticalMeasure
) entity
, removeListener
, backgroundColor
, style
);
2577 if (element
== null) {
2578 MessagingUtils
.messageDialog("No element for entity", this,
2579 "Could not generate element for entity. Looks like the case is not handled already. Check implementation. Entity: "
2584 if (backgroundColor
!= null && !backgroundColor
.isDisposed()) {
2585 element
.setPersistentBackground(backgroundColor
);
2588 parentElement
.addElement(element
);
2596 * Creates a selection element for the given type T.
2599 * <strong>Selection elements not handled by this method:</strong>
2601 * <li>{@link TaxonNodeSelectionElement} see
2602 * {@link #createTaxonNodeSelectionElement(ConversationHolder, ICdmFormElement, String, TaxonNode, int, int)}
2604 * <li>{@link NomenclaturalAuthorTeamSelectionElement} see
2605 * {@link #createNomenclaturalAuthorTeamSelectionElement(ConversationHolder, ICdmFormElement, String, Team, int, int)}
2611 * a {@link Class} object of the type that you want the selection
2613 * @param parentElement
2614 * a {@link ICdmFormElement} object.
2615 * @param labelString
2616 * a {@link String} object.
2617 * @param selectionType
2619 * a {@link ICdmBase} object.
2622 * @param conversation
2623 * a {@link ConversationHolder} object.
2624 * @return a {@link EntitySelectionElement} object.
2626 public <T
extends ICdmBase
> EntitySelectionElement
<T
> createSelectionElement(Class
<T
> clazz
,
2627 ConversationHolder conversation
, ICdmFormElement parentElement
, String labelString
, T selection
, int mode
,
2629 EntitySelectionElement
<T
> element
= new EntitySelectionElement
<T
>(this, conversation
, parentElement
, clazz
,
2630 labelString
, selection
, mode
, style
);
2632 parentElement
.addElement(element
);
2638 * Creates a selection element for the given type T which shows only the <b>abbreviated</b> title as the label.
2641 * <strong>Selection elements not handled by this method:</strong>
2643 * <li>{@link TaxonNodeSelectionElement} see
2644 * {@link #createTaxonNodeSelectionElement(ConversationHolder, ICdmFormElement, String, TaxonNode, int, int)}
2646 * <li>{@link NomenclaturalAuthorTeamSelectionElement} see
2647 * {@link #createNomenclaturalAuthorTeamSelectionElement(ConversationHolder, ICdmFormElement, String, Team, int, int)}
2653 * a {@link Class} object of the type that you want the selection
2655 * @param parentElement
2656 * a {@link ICdmFormElement} object.
2657 * @param labelString
2658 * a {@link String} object.
2659 * @param selectionType
2661 * a {@link ICdmBase} object.
2664 * @param conversation
2665 * a {@link ConversationHolder} object.
2666 * @return a {@link EntitySelectionElement} object.
2668 public <T
extends ICdmBase
> EntitySelectionElementWithAbbreviatedTitle
<T
> createSelectionElementWithAbbreviatedTitle(
2669 Class
<T
> clazz
, ConversationHolder conversation
, ICdmFormElement parentElement
, String labelString
,
2670 T selection
, int mode
, int style
) {
2671 EntitySelectionElementWithAbbreviatedTitle
<T
> element
= new EntitySelectionElementWithAbbreviatedTitle
<T
>(this, conversation
, parentElement
, clazz
,
2672 labelString
, selection
, mode
, style
);
2674 parentElement
.addElement(element
);
2678 public TaxonNodeSelectionElement
createTaxonNodeSelectionElement(ConversationHolder conversation
,
2679 ICdmFormElement parentElement
, String labelString
, TaxonNode selection
, int mode
, int style
) {
2680 TaxonNodeSelectionElement element
= new TaxonNodeSelectionElement(this, conversation
, parentElement
,
2681 labelString
, selection
, mode
, style
);
2683 parentElement
.addElement(element
);
2687 public NomenclaturalAuthorTeamSelectionElement
createNomenclaturalAuthorTeamSelectionElement(
2688 ConversationHolder conversation
, ICdmFormElement parentElement
, String labelString
, Team selection
,
2689 int mode
, int style
) {
2690 NomenclaturalAuthorTeamSelectionElement element
= new NomenclaturalAuthorTeamSelectionElement(this,
2691 conversation
, parentElement
, labelString
, selection
, mode
, style
);
2693 parentElement
.addElement(element
);
2697 /** {@inheritDoc} */
2698 public LabelElement
createLabel(ICdmFormElement parentElement
, String text
) {
2699 LabelElement labelElement
= new LabelElement(this, parentElement
, text
);
2700 adapt(labelElement
);
2701 parentElement
.addElement(labelElement
);
2702 return labelElement
;
2705 public DateElement
createDateElement(ICdmFormElement formElement
, String labelText
, DateTime dateTime
, int style
){
2706 Label label
= new Label(formElement
.getLayoutComposite(), style
);
2707 label
.setText(labelText
+" (yyyy-MM-dd)");
2708 DateElement dateElement
= new DateElement(formElement
.getLayoutComposite(), dateTime
, style
);
2709 dateElement
.initController(this, formElement
);
2715 * Getter for the field <code>selectionProvider</code>.
2718 * @return a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
2720 public ISelectionProvider
getSelectionProvider() {
2721 return selectionProvider
;
2726 * createDetailedDescriptionDetailElement
2729 * @param parentElement
2730 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
2734 * {@link eu.etaxonomy.cdm.model.description.DescriptionElementBase}
2739 * {@link eu.etaxonomy.taxeditor.ui.section.description.detail.AbstractDetailedDescriptionDetailElement}
2742 public AbstractDetailedDescriptionDetailElement
createDetailedDescriptionDetailElement(
2743 ICdmFormElement parentElement
, DescriptionElementBase entity
, int style
) {
2744 AbstractDetailedDescriptionDetailElement detailedDescriptionElement
= null;
2746 if (entity
instanceof CategoricalData
) {
2747 detailedDescriptionElement
= new CategoricalDataDetailElement(this, parentElement
,
2748 (CategoricalData
) entity
, style
);
2749 } else if (entity
instanceof CommonTaxonName
) {
2750 detailedDescriptionElement
= new CommonNameDetailElement(this, parentElement
, (CommonTaxonName
) entity
,
2752 } else if (entity
instanceof Distribution
) {
2753 detailedDescriptionElement
= new DistributionDetailElement(this, parentElement
, (Distribution
) entity
,
2755 } else if (entity
instanceof IndividualsAssociation
) {
2756 detailedDescriptionElement
= new IndividualsAssociationDetailElement(this, parentElement
,
2757 (IndividualsAssociation
) entity
, style
);
2758 } else if (entity
instanceof QuantitativeData
) {
2759 detailedDescriptionElement
= new QuantitativeDataDetailElement(this, parentElement
,
2760 (QuantitativeData
) entity
, style
);
2761 } else if (entity
instanceof TaxonInteraction
) {
2762 detailedDescriptionElement
= new TaxonInteractionDetailElement(this, parentElement
,
2763 (TaxonInteraction
) entity
, style
);
2764 } else if (entity
instanceof TextData
) {
2765 detailedDescriptionElement
= new TextDataDetailElement(this, parentElement
, (TextData
) entity
, style
);
2767 throw new IllegalStateException("There is no interface for the given description element");
2769 adapt(detailedDescriptionElement
);
2770 parentElement
.addElement(detailedDescriptionElement
);
2771 return detailedDescriptionElement
;
2776 * Creates a styled text as a part of the form.
2781 * the text initial value
2784 * @return the text widget
2786 public StyledText
createStyledText(Composite parent
, String value
, int style
) {
2787 StyledText text
= new StyledText(parent
, getBorderStyle() | style
| getOrientation());
2788 if (value
!= null) {
2789 text
.setText(value
);
2791 text
.setForeground(getColors().getForeground());
2792 text
.setBackground(getColors().getBackground());
2793 // text.addFocusListener(visibilityHandler);
2797 public PreservedSpecimenDetailSection
createPreservedSpecimenDetailsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
2798 PreservedSpecimenDetailSection section
= new PreservedSpecimenDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
2799 addAndAdaptSection(parentElement
, section
);