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
.DerivedUnitTypeDesignationElement
;
236 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.association
.DerivedUnitTypeDesignationSection
;
237 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.association
.TaxonAssociationDetailElement
;
238 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.association
.TaxonAssociationDetailSection
;
239 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenCurrentDeterminationDetailSection
;
240 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenDetailElement
;
241 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenDetailSection
;
242 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenDeterminationDetailElement
;
243 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenDeterminationDetailSection
;
244 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenDeterminationHistoryDetailSection
;
245 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenGeneralDetailElement
;
246 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenGeneralDetailSection
;
247 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenSourceCollectionDetailSection
;
248 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AbstractSampleDesignationDetailSection
;
249 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationCloningDetailElement
;
250 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationCloningDetailSection
;
251 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationGelPhotoCollectionDetailSection
;
252 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationGelPhotoDetailElement
;
253 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationGeneralDetailElement
;
254 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationGeneralDetailSection
;
255 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationPrimerDetailElement
;
256 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationPrimerDetailSection
;
257 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.CurrentSampleDesignationDetailSection
;
258 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaQualityDetailElement
;
259 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaQualityDetailSection
;
260 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaSampleGeneralDetailElement
;
261 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaSampleGeneralDetailSection
;
262 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaSamplePreparationPreservationDetailElement
;
263 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaSamplePreparationPreservationSection
;
264 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.PrimerGeneralDetailElement
;
265 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SampleDesignationDetailElement
;
266 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SampleDesignationDetailSection
;
267 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SampleDesignationHistoryDetailSection
;
268 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SampleDesignationTextDetailElement
;
269 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceContigFileCollectionDetailSection
;
270 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceGeneralDetailElement
;
271 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceGeneralDetailSection
;
272 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceReferenceCollectionDetailElement
;
273 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceReferenceCollectionDetailSection
;
274 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SingleReadGeneralDetailElement
;
275 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SingleReadGeneralDetailSection
;
276 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SingleReadPherogramCollectionDetailSection
;
277 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.TissueSampleGeneralDetailElement
;
278 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.TissueSampleGeneralDetailSection
;
279 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.media
.MediaSpecimenGeneralDetailElement
;
280 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.media
.MediaSpecimenGeneralDetailSection
;
281 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailElement
;
282 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailSection
;
283 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailElement
;
284 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailSection
;
285 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.AnnotationElement
;
286 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.AnnotationSection
;
287 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CdmBaseElement
;
288 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CdmBaseSection
;
289 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CreditElement
;
290 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CreditSection
;
291 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.ExtensionElement
;
292 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.ExtensionSection
;
293 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.HeadlineSection
;
294 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.IdentifiableSourceElement
;
295 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.MarkerElement
;
296 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.MarkerSection
;
297 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.RightsElement
;
298 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.RightsSection
;
299 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.SourceSection
;
300 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.VersionElement
;
301 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.VersionSection
;
302 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessageElement
;
303 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessagesSection
;
304 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailElement
;
305 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailSection
;
306 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonDetailElement
;
307 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailElement
;
308 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailSection
;
309 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailElement
;
310 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailSection
;
311 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailElement
;
312 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailSection
;
313 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailElement
;
314 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailSection
;
315 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.DefinedTermDetailElement
;
316 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.DefinedTermDetailSection
;
317 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.FeatureDetailElement
;
318 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.MeasurementUnitCollectionElement
;
319 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.MeasurementUnitCollectionSection
;
320 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailSection
;
321 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.RecommendedModifierVocabulariesCollectionSection
;
322 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.RecommendedModifierVocabulariesElement
;
323 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.StateVocabularyCollectionElement
;
324 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.StateVocabularyCollectionSection
;
325 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.StatisticalMeasureCollectionElement
;
326 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.StatisticalMeasureCollectionSection
;
327 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailElement
;
328 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailSection
;
329 import eu
.etaxonomy
.taxeditor
.ui
.selection
.EntitySelectionElement
;
330 import eu
.etaxonomy
.taxeditor
.ui
.selection
.EntitySelectionElementWithAbbreviatedTitle
;
331 import eu
.etaxonomy
.taxeditor
.ui
.selection
.NomenclaturalAuthorTeamSelectionElement
;
332 import eu
.etaxonomy
.taxeditor
.ui
.selection
.TaxonNodeSelectionElement
;
336 * CdmFormFactory class.
340 * @created Feb 24, 2010
343 public class CdmFormFactory
extends FormToolkit
{
345 private BoldFontHolder2 boldFontHolder2
;
346 private MouseListener selectionMouseHandler
;
347 private FocusListener selectionFocusHandler
;
349 private final Set
<SelectionListener
> selectionListenerList
= new HashSet
<SelectionListener
>();
351 private final List
<IPropertyChangeListener
> propertyChangeListeners
= new ArrayList
<IPropertyChangeListener
>();
353 private final int orientation
= Window
.getDefaultOrientation();
354 private ISelectionProvider selectionProvider
;
356 /** Constant <code>EMPTY_SELECTION</code> */
357 public static ISelection EMPTY_SELECTION
= new ISelection() {
359 public boolean isEmpty() {
370 private class SelectionMouseHandler
extends MouseAdapter
{
372 public void mouseDown(MouseEvent e
) {
373 notifySelectionListeners(e
);
383 private class SelectionFocusHandler
extends FocusAdapter
{
385 public void focusGained(FocusEvent e
) {
386 notifySelectionListeners(e
);
390 private void notifySelectionListeners(TypedEvent e
) {
391 Event event
= new Event();
392 event
.widget
= e
.widget
;
393 SelectionEvent selectionEvent
= new SelectionEvent(event
);
395 for (SelectionListener listener
: selectionListenerList
) {
396 listener
.widgetSelected(selectionEvent
);
402 * Constructor for CdmFormFactory.
406 * a {@link org.eclipse.swt.widgets.Display} object.
407 * @param selectionProvider
408 * a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
410 public CdmFormFactory(Display display
, ISelectionProvider selectionProvider
) {
412 this.selectionProvider
= selectionProvider
;
418 * Constructor for CdmFormFactory.
422 * a {@link org.eclipse.swt.widgets.Display} object.
424 public CdmFormFactory(Display display
) {
432 private void init() {
433 boldFontHolder2
= new BoldFontHolder2();
434 selectionMouseHandler
= new SelectionMouseHandler();
435 selectionFocusHandler
= new SelectionFocusHandler();
439 * Creates an instance initialized with the correct selectionProvider
441 * Make sure to remove the instance when the entityComposite disposes via
442 * destroySelectionArbitrator(..)
444 * @param entityElement
445 * a {@link eu.etaxonomy.taxeditor.ui.element.IEntityElement}
447 * @return a {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator}
450 public SelectionArbitrator
createSelectionArbitrator(IEntityElement entityElement
) {
451 SelectionArbitrator selectionArbitrator
= new SelectionArbitrator(entityElement
);
452 selectionArbitrator
.addSelectionProvider(selectionProvider
);
453 selectionProvider
.addSelectionChangedListener(selectionArbitrator
);
454 addSelectionListener(selectionArbitrator
);
455 return selectionArbitrator
;
460 * destroySelectionArbitrator
463 * @param selectionArbitrator
465 * {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator}
468 public void destroySelectionArbitrator(SelectionArbitrator selectionArbitrator
) {
469 removeSelectionListener(selectionArbitrator
);
470 if (selectionProvider
!= null) {
471 selectionProvider
.removeSelectionChangedListener(selectionArbitrator
);
473 MessagingUtils
.error(this.getClass(),
474 "Tried to destroy a selection listener from this factories listeners but was null", null);
480 * Adapts the {@link AbstractCdmFormElement}:<br>
481 * - sets the {@link IPropertyChangeListener}s handled by this class
486 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement}
489 public void adapt(ICdmFormElement formElement
) {
490 formElement
.setPropertyChangeListeners(propertyChangeListeners
);
495 public void adapt(Control control
, boolean trackFocus
, boolean trackKeyboard
) {
497 control
.addFocusListener(selectionFocusHandler
);
499 super.adapt(control
, trackFocus
, trackKeyboard
);
504 public void adapt(Composite composite
) {
505 composite
.addMouseListener(selectionMouseHandler
);
506 super.adapt(composite
);
515 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
518 public void destroyElement(ICdmFormElement formElement
) {
519 // return if element was not initialized
520 if (formElement
== null) {
523 // destroy selection arbitrator, if any
524 if (formElement
instanceof ISelectableElement
) {
525 destroySelectionArbitrator(((ISelectableElement
) formElement
).getSelectionArbitrator());
527 // remove this element form its parents list of elements
528 // ICdmFormElement parentElement = formElement.getParentElement();
529 // if(parentElement != null){
530 // parentElement.removeElement(formElement);
532 // call destroy on child elements recursively
533 for (ICdmFormElement childElement
: formElement
.getElements()) {
534 destroyElement(childElement
);
536 // dispose of the controls
537 for (Control control
: formElement
.getControls()) {
538 // we added the layoutComposite of the parental element as the
539 // layout composite to this formElement
540 // but we do not want to destroy it.
541 if (control
.equals(formElement
.getLayoutComposite())) {
556 * a {@link org.eclipse.swt.widgets.Composite} object.
557 * @return a {@link org.eclipse.swt.widgets.Label} object.
559 public Label
createEmptyCell(Composite parent
) {
560 return this.createLabel(parent
, null);
565 * createMultiLanguageTextElement
568 * @param parentElement
569 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
572 * a {@link java.lang.String} object.
573 * @param multilanguageText
574 * a {@link java.util.Map} object.
580 * {@link eu.etaxonomy.taxeditor.ui.element.MultilanguageTextElement}
583 public MultilanguageTextElement
createMultiLanguageTextElement(ICdmFormElement parentElement
, String labelString
,
584 Map
<Language
, LanguageString
> multilanguageText
, int textHeight
, int style
) {
585 MultilanguageTextElement element
= new MultilanguageTextElement(this, parentElement
, labelString
,
586 multilanguageText
, textHeight
, style
);
588 parentElement
.addElement(element
);
592 public KeyStatementElement
createKeyStatementElement(ICdmFormElement parentElement
, String labelString
,
593 KeyStatement keyStatement
, int textHeight
, int style
) {
594 KeyStatementElement element
= new KeyStatementElement(this, parentElement
, labelString
, keyStatement
,
597 parentElement
.addElement(element
);
602 * Creates a text field with a label. The initial content will be the return value of the initalObject's {@link #toString()}
604 * <b>Note</b>: if initialObject is <code>null</code> then an empty string is used.
605 * @param parentElement the parent container
606 * @param labelString the label name
607 * @param initialObject the object from which the <code>toString()</code> method is called
608 * @param style {@link SWT} style constant
609 * @return the created textfield with label
611 public TextWithLabelElement
createTextWithLabelElement(ICdmFormElement parentElement
, String labelString
,
612 Object initialObject
, int style
) {
613 return createTextWithLabelElement(parentElement
, labelString
, initialObject
==null?
"":initialObject
.toString(), style
);
618 * createTextWithLabelElement
621 * @param parentElement
622 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
625 * a {@link java.lang.String} object.
627 * a {@link java.lang.String} object.
630 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
633 public TextWithLabelElement
createTextWithLabelElement(ICdmFormElement parentElement
, String labelString
,
634 String initialText
, int style
) {
635 return createTextWithLabelElement(parentElement
, labelString
, initialText
, null, style
);
639 * createTextWithLabelElement
642 * @param parentElement
643 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
646 * a {@link java.lang.String} object.
648 * a {@link java.lang.String} object.
649 * @param textLimit maximal number of characters allowed
652 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
655 public TextWithLabelElement
createTextWithLabelElement(ICdmFormElement parentElement
, String labelString
,
656 String initialText
, Integer textLimit
, int style
) {
657 if(initialText
==null){
661 TextWithLabelElement element
= new TextWithLabelElement(this, parentElement
, labelString
, initialText
, null,
664 parentElement
.addElement(element
);
668 public TextWithLabelElement
createMultiLineTextWithLabel(ICdmFormElement parentElement
, String labelString
,
669 int textHeight
, int style
) {
670 TextWithLabelElement element
= new TextWithLabelElement(this, parentElement
, labelString
, "", textHeight
, true, style
);
672 parentElement
.addElement(element
);
676 public LsidWithExceptionLabelElement
createLsidWithExceptionLabelElement(ICdmFormElement parentElement
, String labelString
,
677 LSID initialLsid
, int style
) {
678 LsidWithExceptionLabelElement element
= new LsidWithExceptionLabelElement(this, parentElement
, labelString
, initialLsid
, null, style
);
680 parentElement
.addElement(element
);
684 public UriWithLabelElement
createUriWithLabelElement(ICdmFormElement parentElement
, String labelString
,
685 URI initialUri
, int style
) {
686 UriWithLabelElement element
= new UriWithLabelElement(this, parentElement
, labelString
, initialUri
, null, style
);
688 parentElement
.addElement(element
);
699 public OpenUrlSelectorElement
createOpenUrlSelectorElement(ICdmFormElement parentElement
, String labelString
,
700 IOpenUrlEnabled openUrlEnabled
, int style
) {
701 OpenUrlSelectorElement element
= new OpenUrlSelectorElement(this, parentElement
, labelString
, openUrlEnabled
,
704 parentElement
.addElement(element
);
710 * @param parentElement
712 * @param conversationEnabled
717 public EditPasswordElement
createEditPasswordElement(ICdmFormElement parentElement
, String labelString
,
718 ConversationHolder conversation
, User user
, int style
) {
719 EditPasswordElement element
= new EditPasswordElement(this, parentElement
, labelString
, user
, conversation
);
721 parentElement
.addElement(element
);
727 * createIntegerTextWithLabelElement
730 * @param parentElement
731 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
734 * a {@link java.lang.String} object.
735 * @param initialInteger
736 * a {@link java.lang.Integer} object.
740 * {@link eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement}
743 public NumberWithLabelElement
createNumberTextWithLabelElement(
744 ICdmFormElement parentElement
, String labelString
,
745 Number initialNumber
, int style
) {
746 NumberWithLabelElement element
= new NumberWithLabelElement(this,
747 parentElement
, labelString
, initialNumber
, style
);
749 parentElement
.addElement(element
);
753 public LanguageStringWithLabelElement
createLanguageStringWithLabelElement(ICdmFormElement parentElement
,
754 String labelString
, LanguageString languageString
, int style
) {
755 return createLanguageStringWithLabelElement(parentElement
, labelString
, languageString
, null, false, style
);
758 public LanguageStringWithLabelElement
createLanguageStringWithLabelElement(ICdmFormElement parentElement
,
759 String labelString
, LanguageString languageString
, Integer height
, boolean isMultiLine
, int style
) {
760 LanguageStringWithLabelElement element
= new LanguageStringWithLabelElement(this, parentElement
, labelString
,
761 languageString
, height
, isMultiLine
, style
);
763 parentElement
.addElement(element
);
769 * createKeyValueViewerElement
772 * @param parentElement
773 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
776 * a {@link java.lang.String} object.
777 * @param valueHeading
778 * a {@link java.lang.String} object.
780 * a {@link java.util.Map} object.
781 * @return a {@link eu.etaxonomy.taxeditor.ui.element.KeyValueViewerElement}
784 public KeyValueViewerElement
createKeyValueViewerElement(ICdmFormElement parentElement
, String keyHeading
,
785 String valueHeading
, Map
<Object
, Object
> map
) {
786 KeyValueViewerElement element
= new KeyValueViewerElement(this, parentElement
, keyHeading
, valueHeading
, map
);
788 parentElement
.addElement(element
);
792 * @deprecated Use {@link #createDefinedTermComboElement(TermType, ICdmFormElement, String, DefinedTermBase, int)} instead
795 public <T
extends DefinedTermBase
> TermComboElement
<T
> createTermComboElement(Class
<T
> termComboType
,
796 ICdmFormElement parentElement
, String labelString
, T selection
, int style
) {
797 TermComboElement
<T
> element
= new TermComboElement
<T
>(this, parentElement
, termComboType
, labelString
,
798 selection
, true, style
);
800 parentElement
.addElement(element
);
804 public <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
806 ICdmFormElement parentElement
,
810 TermComboElement
<T
> element
= new TermComboElement
<T
>(this, parentElement
, termType
, labelString
, selection
, true, style
);
812 parentElement
.addElement(element
);
816 public <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
818 ICdmFormElement parentElement
,
821 boolean addEmptyElement
,
823 TermComboElement
<T
> element
= new TermComboElement
<T
>(this, parentElement
, termType
, labelString
, selection
, addEmptyElement
, style
);
825 parentElement
.addElement(element
);
829 public <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
830 TermVocabulary
<?
> termVocabulary
,
831 ICdmFormElement parentElement
,
835 TermComboElement
<T
> element
= new TermComboElement
<T
>(this, parentElement
, termVocabulary
, labelString
, selection
, true, style
);
837 parentElement
.addElement(element
);
841 public <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
842 TermVocabulary
<?
> termVocabulary
,
843 ICdmFormElement parentElement
,
846 boolean addEmptyElement
,
848 TermComboElement
<T
> element
= new TermComboElement
<T
>(this, parentElement
, termVocabulary
, labelString
, selection
, addEmptyElement
, style
);
850 parentElement
.addElement(element
);
856 * createEnumComboElement
859 * @param enumComboType
861 * {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EnumComboType}
863 * @param parentElement
864 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
868 * @return a {@link eu.etaxonomy.taxeditor.ui.term.AbstractEnumComboElement}
871 public <T
extends IEnumTerm
<T
>> EnumComboElement
<T
> createEnumComboElement(
872 Class
<T
> enumComboType
, ICdmFormElement parentElement
,
874 EnumComboElement
<T
> element
= new EnumComboElement
<T
>(this, parentElement
, enumComboType
, style
);
876 parentElement
.addElement(element
);
880 public <TERM
extends DefinedTermBase
<TERM
>, VOC
extends TermVocabulary
<TERM
>> VocabularyComboElement
<TERM
, VOC
> createVocabularyComboElement(
881 TermType termType
, String label
, VOC selection
, ICdmFormElement parentElement
, int style
) {
882 VocabularyComboElement
<TERM
, VOC
> element
= new VocabularyComboElement
<TERM
, VOC
>(this, parentElement
, termType
, label
, selection
, style
);
884 parentElement
.addElement(element
);
890 * createBrowserElement
894 * a {@link java.net.URI} object.
897 * @param parentElement
898 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
900 * @return a {@link eu.etaxonomy.taxeditor.ui.element.BrowserElement}
903 public BrowserElement
createBrowserElement(ICdmFormElement parentElement
, URI imageUri
, int style
) {
904 BrowserElement element
= new BrowserElement(this, parentElement
, imageUri
, style
);
906 parentElement
.addElement(element
);
915 * @param parentElement
916 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
919 * a {@link java.net.URI} object.
922 * @return a {@link eu.etaxonomy.taxeditor.ui.element.ImageElement} object.
924 public ImageElement
createImageElement(ICdmFormElement parentElement
, URI imageUri
, int style
) {
925 ImageElement element
= new ImageElement(this, parentElement
, imageUri
, style
);
927 parentElement
.addElement(element
);
933 * createTextActionElement
937 * a {@link java.lang.String} object.
939 * a {@link java.lang.String} object.
942 * @param parentElement
943 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
946 * a {@link java.lang.String} object.
947 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextActionElement}
950 public TextActionElement
createTextActionElement(ICdmFormElement parentElement
, String labelString
,
951 String buttonLabel
, String initialText
, int style
) {
952 TextActionElement element
= new TextActionElement(this, parentElement
, labelString
, buttonLabel
, initialText
,
955 parentElement
.addElement(element
);
964 * @param parentElement
965 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
968 * a {@link java.lang.String} object.
969 * @param initialState
973 * @return a {@link eu.etaxonomy.taxeditor.ui.element.CheckboxElement}
976 public CheckboxElement
createCheckbox(ICdmFormElement parentElement
, String label
, Boolean initialState
, int style
) {
977 if(initialState
==null){
978 initialState
= Boolean
.FALSE
;
980 CheckboxElement element
= new CheckboxElement(this, parentElement
, label
, initialState
, style
| orientation
);
982 parentElement
.addElement(element
);
987 * Creates a section as a part of the form.
989 * @return the section widget
992 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
995 public Section
adapt(AbstractFormSection section
) {
996 section
.setMenu(section
.getLayoutComposite().getMenu());
997 adapt(section
, true, true);
999 // handle focus and property change events for cdm use
1000 section
.addFocusListener(selectionFocusHandler
);
1001 section
.setPropertyChangeListeners(propertyChangeListeners
);
1003 if (section
.getToggle() != null) {
1004 section
.getToggle().setHoverDecorationColor(getColors().getColor(IFormColors
.TB_TOGGLE_HOVER
));
1005 section
.getToggle().setDecorationColor(getColors().getColor(IFormColors
.TB_TOGGLE
));
1008 section
.setFont(boldFontHolder2
.getBoldFont(section
.getLayoutComposite().getFont()));
1010 if ((section
.getStyle() & ExpandableComposite
.TITLE_BAR
) != 0
1011 || (section
.getStyle() & ExpandableComposite
.SHORT_TITLE_BAR
) != 0) {
1012 getColors().initializeSectionToolBarColors();
1013 section
.setTitleBarBackground(getColors().getColor(IFormColors
.TB_BG
));
1014 section
.setTitleBarBorderColor(getColors().getColor(IFormColors
.TB_BORDER
));
1016 // call setTitleBarForeground regardless as it also sets the label color
1017 section
.setTitleBarForeground(getColors().getColor(IFormColors
.TB_TOGGLE
));
1021 private class BoldFontHolder2
{
1022 private Font normalFont
;
1024 private Font boldFont
;
1026 public BoldFontHolder2() {
1029 public Font
getBoldFont(Font font
) {
1030 createBoldFont(font
);
1034 private void createBoldFont(Font font
) {
1035 if (normalFont
== null || !normalFont
.equals(font
)) {
1039 if (boldFont
== null) {
1040 boldFont
= FormFonts
.getInstance().getBoldFont(getColors().getDisplay(), normalFont
);
1044 public void dispose() {
1045 if (boldFont
!= null) {
1046 FormFonts
.getInstance().markFinished(boldFont
, getColors().getDisplay());
1054 * createToggleableTextField
1057 * @param parentElement
1058 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1060 * @param labelString
1061 * a {@link java.lang.String} object.
1062 * @param initialText
1063 * a {@link java.lang.String} object.
1064 * @param initialState
1068 * @return a {@link eu.etaxonomy.taxeditor.ui.element.ToggleableTextElement}
1071 public ToggleableTextElement
createToggleableTextField(ICdmFormElement parentElement
, String labelString
,
1072 String initialText
, boolean initialState
, int style
) {
1073 ToggleableTextElement element
= new ToggleableTextElement(this, parentElement
, labelString
, initialText
,
1074 initialState
, style
| orientation
);
1076 parentElement
.addElement(element
);
1082 * createTimePeriodElement
1085 * @param parentElement
1086 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1088 * @param labelString
1089 * a {@link java.lang.String} object.
1091 * a {@link eu.etaxonomy.cdm.model.common.TimePeriod} object.
1094 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TimePeriodElement}
1097 public TimePeriodElement
createTimePeriodElement(ICdmFormElement parentElement
, String labelString
,
1098 TimePeriod timePeriod
, int style
) {
1099 TimePeriodElement element
= new TimePeriodElement(this, parentElement
, labelString
, timePeriod
, style
);
1101 parentElement
.addElement(element
);
1107 * createGatheringEventUnitElement
1110 * @param parentElement
1111 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1113 * @param labelString
1114 * a {@link java.lang.String} object.
1116 * a {@link eu.etaxonomy.cdm.model.common.GatheringEvent} object.
1119 * @return a {@link eu.etaxonomy.taxeditor.ui.element.GatheringEventUnitElement}
1122 public GatheringEventUnitElement
createGatheringEventUnitElement(
1123 ICdmFormElement parentElement
,
1125 DerivedUnitFacade gatheringEvent
,
1126 MinMaxTextSection
.UnitType unitType
,
1128 GatheringEventUnitElement element
= new GatheringEventUnitElement(this,
1135 parentElement
.addElement(element
);
1141 * createPointElement
1146 * @param parentElement
1147 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1150 * a {@link eu.etaxonomy.cdm.model.location.Point} object.
1151 * @return a {@link eu.etaxonomy.taxeditor.ui.element.PointElement} object.
1153 public PointElement
createPointElement(ICdmFormElement parentElement
, Point point
, int style
) {
1154 PointElement element
= new PointElement(this, parentElement
, point
, style
);
1156 parentElement
.addElement(element
);
1163 * @param conversationHolder
1165 * @param detailsViewer
1169 public EmptySection
createEmptySection(CdmFormFactory formFactory
, ICdmFormElement parentElement
, int style
) {
1170 EmptySection section
= new EmptySection(formFactory
, parentElement
, style
);
1171 parentElement
.addElement(section
);
1178 * createDateDetailSection
1181 * @param parentElement
1182 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1186 * @return a {@link eu.etaxonomy.taxeditor.ui.element.DateDetailSection}
1189 public DateDetailSection
createDateDetailSection(ICdmFormElement parentElement
, int style
) {
1190 DateDetailSection section
= new DateDetailSection(this, parentElement
, style
);
1191 parentElement
.addElement(section
);
1198 * createDateDetailSection
1201 * @param parentElement
1202 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1206 * @return a {@link eu.etaxonomy.taxeditor.ui.element.MinMaxTextSection}
1209 public MinMaxTextSection
createMinMaxTextSection(ICdmFormElement parentElement
, UnitType unitType
, int style
) {
1210 MinMaxTextSection section
= new MinMaxTextSection(this, parentElement
, unitType
, style
);
1211 parentElement
.addElement(section
);
1218 * createPartialElement
1221 * @param parentElement
1222 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1224 * @param labelString
1225 * a {@link java.lang.String} object.
1227 * a {@link org.joda.time.Partial} object.
1230 * @return a {@link eu.etaxonomy.taxeditor.ui.element.PartialElement}
1233 public PartialElement
createPartialElement(ICdmFormElement parentElement
, String labelString
, Partial partial
,
1235 PartialElement element
= new PartialElement(this, parentElement
, labelString
, style
);
1237 parentElement
.addElement(element
);
1243 * addSelectionListener
1247 * a {@link org.eclipse.swt.events.SelectionListener} object.
1249 public void addSelectionListener(SelectionListener listener
) {
1250 selectionListenerList
.add(listener
);
1255 * removeSelectionListener
1259 * a {@link org.eclipse.swt.events.SelectionListener} object.
1261 public void removeSelectionListener(SelectionListener listener
) {
1262 if (listener
== null) {
1263 MessagingUtils
.error(this.getClass(),
1264 "Tried to remove a selection listener from this factories listeners but was null", null);
1266 selectionListenerList
.remove(listener
);
1272 * addPropertyChangeListener
1276 * a {@link org.eclipse.jface.util.IPropertyChangeListener}
1279 public void addPropertyChangeListener(IPropertyChangeListener listener
) {
1280 if (propertyChangeListeners
.contains(listener
)) {
1283 propertyChangeListeners
.add(0, listener
);
1288 * removePropertyChangeListener
1292 * a {@link org.eclipse.jface.util.IPropertyChangeListener}
1295 public void removePropertyChangeListener(IPropertyChangeListener listener
) {
1296 propertyChangeListeners
.remove(listener
);
1300 * @return the propertyChangeListeners
1302 public List
<IPropertyChangeListener
> getPropertyChangeListeners() {
1303 return propertyChangeListeners
;
1308 * createHorizontalSeparator
1311 * @param parentElement
1312 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1316 * @return a {@link org.eclipse.swt.widgets.Label} object.
1318 public Label
createHorizontalSeparator(ICdmFormElement parentElement
, int style
) {
1319 Label separator
= this.createSeparator(parentElement
.getLayoutComposite(), SWT
.HORIZONTAL
| style
);
1320 separator
.setLayoutData(LayoutConstants
.FILL_HORIZONTALLY());
1326 * createVersionElement
1329 * @param parentElement
1330 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1333 * a {@link eu.etaxonomy.cdm.model.common.VersionableEntity}
1338 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.VersionElement}
1341 public VersionElement
createVersionElement(ICdmFormElement parentElement
, VersionableEntity entity
, int style
) {
1342 VersionElement element
= new VersionElement(this, parentElement
, entity
, style
);
1344 parentElement
.addElement(element
);
1349 * @param cdmBaseSection
1354 public CdmBaseElement
createCdmBaseElement(ICdmFormElement parentElement
, CdmBase entity
, int style
) {
1355 CdmBaseElement element
= new CdmBaseElement(this, parentElement
, entity
, style
);
1357 parentElement
.addElement(element
);
1363 * createVersionSection
1366 * @param parentElement
1367 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1372 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.VersionSection}
1375 public VersionSection
createVersionSection(ICdmFormElement parentElement
, int style
) {
1376 VersionSection section
= new VersionSection(this, parentElement
, style
);
1377 parentElement
.addElement(section
);
1387 public CdmBaseSection
createCdmBaseSection(ICdmFormElement parentElement
, int style
) {
1388 CdmBaseSection section
= new CdmBaseSection(this, parentElement
, style
);
1389 parentElement
.addElement(section
);
1396 * createEmptyElement
1399 * @param parentElement
1400 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1402 * @return a {@link eu.etaxonomy.taxeditor.ui.section.EmptyElement} object.
1404 public EmptyElement
createEmptyElement(ICdmFormElement parentElement
, String emptyText
) {
1405 EmptyElement element
= new EmptyElement(this, parentElement
, emptyText
, SWT
.NULL
);
1407 parentElement
.addElement(element
);
1413 * createHeadlineSection
1416 * @param parentElement
1417 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1420 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.HeadlineSection}
1423 public HeadlineSection
createHeadlineSection(ICdmFormElement parentElement
) {
1424 HeadlineSection section
= new HeadlineSection(this, parentElement
, SWT
.NULL
);
1425 parentElement
.addElement(section
);
1432 * createParsingMessageElement
1435 * @param parentElement
1436 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1438 * @param parserProblem
1439 * a {@link eu.etaxonomy.cdm.strategy.parser.ParserProblem}
1444 * {@link eu.etaxonomy.taxeditor.ui.section.taxon.ParsingMessageElement}
1447 public ParsingMessageElement
createParsingMessageElement(ICdmFormElement parentElement
,
1448 ParserProblem parserProblem
, int style
) {
1449 ParsingMessageElement element
= new ParsingMessageElement(this, parentElement
, parserProblem
, style
);
1451 parentElement
.addElement(element
);
1455 public AbstractFormSection
createDefinedTermDetailSection(Class definedTermClass
, ConversationHolder conversation
,
1456 ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
1458 AbstractFormSection section
= new DefinedTermDetailSection(this, definedTermClass
, conversation
, parentElement
,
1459 selectionProvider
, style
);
1461 parentElement
.addElement(section
);
1468 * @param definedTermClass
1469 * @param formElement
1473 public AbstractCdmDetailElement
createDefinedTermDetailElement(Class definedTermClass
,
1474 AbstractCdmDetailSection parentElement
, int style
) {
1475 AbstractCdmDetailElement element
= null;
1477 if (NamedArea
.class.isAssignableFrom(definedTermClass
)) {
1478 element
= new eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement(this, parentElement
);
1479 } else if (definedTermClass
.equals(Feature
.class)) {
1480 element
= new FeatureDetailElement(this, parentElement
);
1482 element
= new DefinedTermDetailElement(this, parentElement
);
1486 parentElement
.addElement(element
);
1491 //--------DetailSections---------
1492 public NameDetailSection
createNameDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1493 NameDetailSection section
= new NameDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1494 addAndAdaptSection(parentElement
, section
);
1498 public ReferenceDetailSection
createReferenceDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1499 ReferenceDetailSection section
= new ReferenceDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1500 addAndAdaptSection(parentElement
, section
);
1504 public NomenclaturalReferenceDetailSection
createNomenclaturalReferenceDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1505 NomenclaturalReferenceDetailSection section
= new NomenclaturalReferenceDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1506 addAndAdaptSection(parentElement
, section
);
1510 public TaxonBaseDetailSection
createTaxonBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1511 TaxonBaseDetailSection section
= new TaxonBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1512 addAndAdaptSection(parentElement
, section
);
1516 public AuthorshipDetailSection
createAuthorshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1517 AuthorshipDetailSection section
= new AuthorshipDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1518 addAndAdaptSection(parentElement
, section
);
1522 public TeamOrPersonBaseDetailSection
createTeamOrPersonBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1523 TeamOrPersonBaseDetailSection section
= new TeamOrPersonBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1524 addAndAdaptSection(parentElement
, section
);
1528 public TeamDetailSection
createTeamDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1529 TeamDetailSection section
= new TeamDetailSection(this, conversation
, parentElement
, null, style
);
1530 addAndAdaptSection(parentElement
, section
);
1534 public PersonDetailSection
createPersonDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1535 PersonDetailSection section
= new PersonDetailSection(this, conversation
, parentElement
, null, style
);
1536 addAndAdaptSection(parentElement
, section
);
1540 public DescriptionDetailSection
createDescriptionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1541 DescriptionDetailSection section
= new DescriptionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1542 addAndAdaptSection(parentElement
, section
);
1546 public DescriptionElementDetailSection
createDescriptionElementDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1547 DescriptionElementDetailSection section
= new DescriptionElementDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1548 addAndAdaptSection(parentElement
, section
);
1552 public ParsingMessagesSection
createParsingMessagesSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1553 ParsingMessagesSection section
= new ParsingMessagesSection(this, conversation
, parentElement
, selectionProvider
, style
);
1554 addAndAdaptSection(parentElement
, section
);
1558 public NonViralNameDetailSection
createNonViralNameDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, boolean nameChoosable
, int style
){
1559 NonViralNameDetailSection section
= new NonViralNameDetailSection(this, conversation
, parentElement
, selectionProvider
, nameChoosable
, style
);
1560 addAndAdaptSection(parentElement
, section
);
1564 public MediaDetailsSection
createMediaDetailsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1565 MediaDetailsSection section
= new MediaDetailsSection(this, conversation
, parentElement
, selectionProvider
, style
);
1566 addAndAdaptSection(parentElement
, section
);
1570 public FieldUnitDetailSection
createFieldUnitDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1571 FieldUnitDetailSection section
= new FieldUnitDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1572 addAndAdaptSection(parentElement
, section
);
1576 public GatheringEventDetailSection
createGatheringEventDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1577 GatheringEventDetailSection section
= new GatheringEventDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1578 addAndAdaptSection(parentElement
, section
);
1582 public SpecimenHierarchyDetailSection
createSpecimenHierarchyDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1583 SpecimenHierarchyDetailSection section
= new SpecimenHierarchyDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1584 addAndAdaptSection(parentElement
, section
);
1588 public DerivedUnitBaseDetailSection
createDerivedUnitBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1589 DerivedUnitBaseDetailSection section
= new DerivedUnitBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1590 addAndAdaptSection(parentElement
, section
);
1594 public DerivedUnitTypeDesignationSection
createDerivedUnitTypeDesignationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1595 DerivedUnitTypeDesignationSection section
= new DerivedUnitTypeDesignationSection(this, conversation
, parentElement
, style
);
1596 addAndAdaptSection(parentElement
, section
);
1600 public TaxonAssociationDetailSection
createTaxonAssociationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1601 TaxonAssociationDetailSection section
= new TaxonAssociationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1602 addAndAdaptSection(parentElement
, section
);
1606 public OriginalLabelDataSection
createOriginalLabelDataSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1607 OriginalLabelDataSection section
= new OriginalLabelDataSection(this, conversation
, parentElement
, selectionProvider
, style
);
1608 addAndAdaptSection(parentElement
, section
);
1612 public NaturalLanguageSection
createNaturalLanguageSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1613 NaturalLanguageSection section
= new NaturalLanguageSection(this, conversation
, parentElement
, selectionProvider
, style
);
1614 addAndAdaptSection(parentElement
, section
);
1618 public FeatureDistributionDetailSection
createFeatureDistributionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1619 FeatureDistributionDetailSection section
= new FeatureDistributionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1620 addAndAdaptSection(parentElement
, section
);
1624 public ClassificationDetailSection
createClassificationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1625 ClassificationDetailSection section
= new ClassificationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1626 addAndAdaptSection(parentElement
, section
);
1630 public TaxonNodeDetailSection
createTaxonNodeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1631 TaxonNodeDetailSection section
= new TaxonNodeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1632 addAndAdaptSection(parentElement
, section
);
1636 public PolytomousKeyDetailSection
createPolytomousKeyDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1637 PolytomousKeyDetailSection section
= new PolytomousKeyDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1638 addAndAdaptSection(parentElement
, section
);
1642 public PolytomousKeyNodeDetailSection
createPolytomousKeyNodeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1643 PolytomousKeyNodeDetailSection section
= new PolytomousKeyNodeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1644 addAndAdaptSection(parentElement
, section
);
1648 public InstitutionDetailSection
createInstitutionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1649 InstitutionDetailSection section
= new InstitutionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1650 addAndAdaptSection(parentElement
, section
);
1654 public FieldUnitGeneralDetailSection
createFieldUnitGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1655 FieldUnitGeneralDetailSection section
= new FieldUnitGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1656 addAndAdaptSection(parentElement
, section
);
1660 public DerivedUnitGeneralDetailSection
createDerivedUnitGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1661 DerivedUnitGeneralDetailSection section
= new DerivedUnitGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1662 addAndAdaptSection(parentElement
, section
);
1666 public PreservedSpecimenGeneralDetailSection
createPreservedSpecimenGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1667 PreservedSpecimenGeneralDetailSection section
= new PreservedSpecimenGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1668 addAndAdaptSection(parentElement
, section
);
1672 public TissueSampleGeneralDetailSection
createTissueSampleGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1673 TissueSampleGeneralDetailSection section
= new TissueSampleGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1674 addAndAdaptSection(parentElement
, section
);
1678 public DnaSampleGeneralDetailSection
createDnaSampleGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1679 DnaSampleGeneralDetailSection section
= new DnaSampleGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1680 addAndAdaptSection(parentElement
, section
);
1684 public DnaSamplePreparationPreservationSection
createDnaSamplePreparationPreservationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1685 DnaSamplePreparationPreservationSection section
= new DnaSamplePreparationPreservationSection(this, conversation
, parentElement
, selectionProvider
, style
);
1686 addAndAdaptSection(parentElement
, section
);
1690 public DnaQualityDetailSection
createDnaQualityDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1691 DnaQualityDetailSection section
= new DnaQualityDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1692 addAndAdaptSection(parentElement
, section
);
1696 public SequenceGeneralDetailSection
createSequenceGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1697 SequenceGeneralDetailSection section
= new SequenceGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1698 addAndAdaptSection(parentElement
, section
);
1702 public SequenceContigFileCollectionDetailSection
createSequenceContigFileCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1703 SequenceContigFileCollectionDetailSection section
= new SequenceContigFileCollectionDetailSection(this, conversation
, parentElement
, style
);
1704 addAndAdaptSection(parentElement
, section
);
1708 public SingleReadPherogramCollectionDetailSection
createSingleReadPherogramCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1709 SingleReadPherogramCollectionDetailSection section
= new SingleReadPherogramCollectionDetailSection(this, conversation
, parentElement
, style
);
1710 addAndAdaptSection(parentElement
, section
);
1714 public SequenceReferenceCollectionDetailSection
createSequenceReferenceCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1715 SequenceReferenceCollectionDetailSection section
= new SequenceReferenceCollectionDetailSection(this, conversation
, parentElement
, style
);
1716 addAndAdaptSection(parentElement
, section
);
1720 public SingleReadGeneralDetailSection
createSingleReadGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1721 SingleReadGeneralDetailSection section
= new SingleReadGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1722 addAndAdaptSection(parentElement
, section
);
1726 public AmplificationGeneralDetailSection
createAmplificationGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1727 AmplificationGeneralDetailSection section
= new AmplificationGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1728 addAndAdaptSection(parentElement
, section
);
1732 public AmplificationPrimerDetailSection
createAmplificationPrimerDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1733 AmplificationPrimerDetailSection section
= new AmplificationPrimerDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1734 addAndAdaptSection(parentElement
, section
);
1738 public AmplificationCloningDetailSection
createAmplificationCloningDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1739 AmplificationCloningDetailSection section
= new AmplificationCloningDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1740 addAndAdaptSection(parentElement
, section
);
1744 public AmplificationGelPhotoCollectionDetailSection
createAmplificationGelPhotoCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1745 AmplificationGelPhotoCollectionDetailSection section
= new AmplificationGelPhotoCollectionDetailSection(this, conversation
, parentElement
, style
);
1746 addAndAdaptSection(parentElement
, section
);
1750 public MediaSpecimenGeneralDetailSection
createMediaSpecimenGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1751 MediaSpecimenGeneralDetailSection section
= new MediaSpecimenGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1752 addAndAdaptSection(parentElement
, section
);
1756 public HybridDetailSection
createHybridDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1757 HybridDetailSection section
= new HybridDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1758 addAndAdaptSection(parentElement
, section
);
1762 public UserDetailSection
createUserDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1763 UserDetailSection section
= new UserDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1764 addAndAdaptSection(parentElement
, section
);
1768 public GroupDetailSection
createGroupDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1769 GroupDetailSection section
= new GroupDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1770 addAndAdaptSection(parentElement
, section
);
1774 public DeterminationDetailSection
createDeterminationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1775 DeterminationDetailSection section
= new DeterminationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1776 addAndAdaptSection(parentElement
, section
);
1780 public SampleDesignationDetailSection
createSampleDesignationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1781 SampleDesignationDetailSection section
= new SampleDesignationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1782 addAndAdaptSection(parentElement
, section
);
1786 public PreservedSpecimenDeterminationDetailSection
createPreservedSpecimenDeterminationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1787 PreservedSpecimenDeterminationDetailSection section
= new PreservedSpecimenDeterminationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1788 addAndAdaptSection(parentElement
, section
);
1792 public TaxonRelationshipDetailSection
createTaxonRelationshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1793 TaxonRelationshipDetailSection section
= new TaxonRelationshipDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1794 addAndAdaptSection(parentElement
, section
);
1798 public ReferencedEntityDetailSection
createReferencedEntityDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1799 ReferencedEntityDetailSection section
= new ReferencedEntityDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1800 addAndAdaptSection(parentElement
, section
);
1804 public TermVocabularyDetailSection
createTermVocabularyDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1805 TermVocabularyDetailSection section
= new TermVocabularyDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1806 addAndAdaptSection(parentElement
, section
);
1810 public GatheringEventDetailSection
createGatheringSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1811 GatheringEventDetailSection section
= new GatheringEventDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1812 addAndAdaptSection(parentElement
, section
);
1816 public NamedAreaDetailSection
createNamedAreaDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1817 NamedAreaDetailSection section
= new NamedAreaDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1818 addAndAdaptSection(parentElement
, section
);
1822 public UseRecordDetailSection
createUseRecordDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1823 UseRecordDetailSection section
= new UseRecordDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1824 addAndAdaptSection(parentElement
, section
);
1828 private void addAndAdaptSection(ICdmFormElement parentElement
, AbstractFormSection
<?
> section
) {
1829 parentElement
.addElement(section
);
1833 //--------DetailElements------------
1835 public UseRecordDetailElement
createUseRecordDetailElement(ICdmFormElement parentElement
){
1836 UseRecordDetailElement element
= new UseRecordDetailElement(this, parentElement
);
1837 addAndAdaptElement(parentElement
, element
);
1841 public DefinedTermDetailElement
<NamedAreaLevel
> createNamedAreaLevelElement(ICdmFormElement parentElement
){
1842 DefinedTermDetailElement
<NamedAreaLevel
> element
= new DefinedTermDetailElement
<NamedAreaLevel
>(this, parentElement
);
1843 addAndAdaptElement(parentElement
, element
);
1847 public eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement
createNamedAreaDetailElement(ICdmFormElement parentElement
){
1848 eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement element
= new eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement(this, parentElement
);
1849 addAndAdaptElement(parentElement
, element
);
1853 public TermVocabularyDetailElement
createTermVocabularyDetailElement(ICdmFormElement parentElement
){
1854 TermVocabularyDetailElement element
= new TermVocabularyDetailElement(this, parentElement
);
1855 addAndAdaptElement(parentElement
, element
);
1859 public ReferenceEntityDetailElement
createReferenceEntityDetailElement(ICdmFormElement parentElement
){
1860 ReferenceEntityDetailElement element
= new ReferenceEntityDetailElement(this, parentElement
);
1861 addAndAdaptElement(parentElement
, element
);
1865 public TaxonRelationshipDetailElement
createTaxonRelationshipDetailElement(ICdmFormElement parentElement
){
1866 TaxonRelationshipDetailElement element
= new TaxonRelationshipDetailElement(this, parentElement
);
1867 addAndAdaptElement(parentElement
, element
);
1871 public GrantedAuthorityDetailElement
createGrantedAuthorityDetailElement(ICdmFormElement parentElement
){
1872 GrantedAuthorityDetailElement element
= new GrantedAuthorityDetailElement(this, parentElement
);
1873 addAndAdaptElement(parentElement
, element
);
1877 public GroupDetailElement
createGroupDetailElement(ICdmFormElement parentElement
){
1878 GroupDetailElement element
= new GroupDetailElement(this, parentElement
);
1879 addAndAdaptElement(parentElement
, element
);
1883 public UserDetailElement
createUserDetailElement(ICdmFormElement parentElement
){
1884 UserDetailElement element
= new UserDetailElement(this, parentElement
);
1885 addAndAdaptElement(parentElement
, element
);
1889 public HybridDetailElement
createHybridDetailElement(ICdmFormElement parentElement
){
1890 HybridDetailElement element
= new HybridDetailElement(this, parentElement
);
1891 addAndAdaptElement(parentElement
, element
);
1895 public InstitutionDetailElement
createInstitutionDetailElement(ICdmFormElement parentElement
){
1896 InstitutionDetailElement element
= new InstitutionDetailElement(this, parentElement
);
1897 addAndAdaptElement(parentElement
, element
);
1901 public PolytomousKeyNodeDetailElement
createPolytomousKeyNodeDetailElement(ICdmFormElement parentElement
){
1902 PolytomousKeyNodeDetailElement element
= new PolytomousKeyNodeDetailElement(this, parentElement
);
1903 addAndAdaptElement(parentElement
, element
);
1907 public PolytomousKeyDetailElement
createPolytomousKeyDetailElement(ICdmFormElement parentElement
){
1908 PolytomousKeyDetailElement element
= new PolytomousKeyDetailElement(this, parentElement
);
1909 addAndAdaptElement(parentElement
, element
);
1913 public CollectionDetailElement
createCollectionDetailElement(ICdmFormElement parentElement
){
1914 CollectionDetailElement element
= new CollectionDetailElement(this, parentElement
);
1915 addAndAdaptElement(parentElement
, element
);
1919 public TaxonNodeDetailElement
createTaxonNodeDetailElement(ICdmFormElement parentElement
){
1920 TaxonNodeDetailElement element
= new TaxonNodeDetailElement(this, parentElement
);
1921 addAndAdaptElement(parentElement
, element
);
1925 public ClassificationDetailElement
createClassificationDetailElement(ICdmFormElement parentElement
){
1926 ClassificationDetailElement element
= new ClassificationDetailElement(this, parentElement
);
1927 addAndAdaptElement(parentElement
, element
);
1931 public FeatureDistributionDetailElement
createFeatureDistributionDetailElement(ICdmFormElement parentElement
){
1932 FeatureDistributionDetailElement element
= new FeatureDistributionDetailElement(this, parentElement
);
1933 addAndAdaptElement(parentElement
, element
);
1937 public NaturalLanguageDetailElement
createNaturalLanguageDetailElement(ICdmFormElement parentElement
){
1938 NaturalLanguageDetailElement element
= new NaturalLanguageDetailElement(this, parentElement
);
1939 addAndAdaptElement(parentElement
, element
);
1943 public NonViralNameDetailElement
createNonViralNameDetailElement(ICdmFormElement parentElement
){
1944 NonViralNameDetailElement element
= new NonViralNameDetailElement(this, parentElement
);
1945 addAndAdaptElement(parentElement
, element
);
1949 public DescriptionElementDetailElement
createDescriptionElementDetailElement(ICdmFormElement parentElement
, int style
){
1950 DescriptionElementDetailElement element
= new DescriptionElementDetailElement(this, parentElement
, style
);
1951 addAndAdaptElement(parentElement
, element
);
1955 public DescriptionDetailElement
createDescriptionDetailElement(ICdmFormElement parentElement
, int style
){
1956 DescriptionDetailElement element
= new DescriptionDetailElement(this, parentElement
, style
);
1957 addAndAdaptElement(parentElement
, element
);
1961 public PersonDetailElement
createPersonDetailElement(ICdmFormElement parentElement
, int style
){
1962 PersonDetailElement element
= new PersonDetailElement(this, parentElement
, style
);
1963 addAndAdaptElement(parentElement
, element
);
1967 public TeamDetailElement
createTeamDetailElement(ICdmFormElement parentElement
, int style
){
1968 TeamDetailElement element
= new TeamDetailElement(this, parentElement
, style
);
1969 addAndAdaptElement(parentElement
, element
);
1973 public AuthorshipDetailElement
createAuthorshipDetailElement(ICdmFormElement parentElement
, int style
){
1974 AuthorshipDetailElement element
= new AuthorshipDetailElement(this, parentElement
, style
);
1975 addAndAdaptElement(parentElement
, element
);
1979 public TaxonBaseDetailElement
createTaxonBaseDetailElement(ICdmFormElement parentElement
, int style
){
1980 TaxonBaseDetailElement element
= new TaxonBaseDetailElement(this, parentElement
, style
);
1981 addAndAdaptElement(parentElement
, element
);
1985 public NameDetailElement
createNameDetailElement(ICdmFormElement parentElement
, int style
){
1986 NameDetailElement element
= new NameDetailElement(this, parentElement
, style
);
1987 addAndAdaptElement(parentElement
, element
);
1991 public ReferenceDetailElement
createReferenceDetailElement(ICdmFormElement parentElement
, int style
){
1992 ReferenceDetailElement element
= new ReferenceDetailElement(this, parentElement
, style
);
1993 addAndAdaptElement(parentElement
, element
);
1997 public NomenclaturalReferenceDetailElement
createNomenclaturalReferenceDetailElement(ICdmFormElement parentElement
, int style
){
1998 NomenclaturalReferenceDetailElement element
= new NomenclaturalReferenceDetailElement(this, parentElement
, style
);
1999 addAndAdaptElement(parentElement
, element
);
2004 public FieldUnitGeneralDetailElement
createFieldUnitGeneralDetailElement(ICdmFormElement parentElement
){
2005 FieldUnitGeneralDetailElement element
= new FieldUnitGeneralDetailElement(this, parentElement
);
2006 addAndAdaptElement(parentElement
, element
);
2010 public DerivedUnitGeneralDetailElement
createDerivedUnitGeneralDetailElement(ICdmFormElement parentElement
){
2011 DerivedUnitGeneralDetailElement element
= new DerivedUnitGeneralDetailElement(this, parentElement
);
2012 addAndAdaptElement(parentElement
, element
);
2016 public TaxonAssociationDetailElement
createTaxonAssociationDetailElement(ICdmFormElement parentElement
){
2017 TaxonAssociationDetailElement element
= new TaxonAssociationDetailElement(this, parentElement
);
2018 addAndAdaptElement(parentElement
, element
);
2022 public PreservedSpecimenGeneralDetailElement
createPreservedSpecimenGeneralDetailElement(ICdmFormElement parentElement
){
2023 PreservedSpecimenGeneralDetailElement element
= new PreservedSpecimenGeneralDetailElement(this, parentElement
);
2024 addAndAdaptElement(parentElement
, element
);
2028 public TissueSampleGeneralDetailElement
createTissueSampleGeneralDetailElement(ICdmFormElement parentElement
){
2029 TissueSampleGeneralDetailElement element
= new TissueSampleGeneralDetailElement(this, parentElement
);
2030 addAndAdaptElement(parentElement
, element
);
2034 public DnaSampleGeneralDetailElement
createDnaSampleGeneralDetailElement(ICdmFormElement parentElement
){
2035 DnaSampleGeneralDetailElement element
= new DnaSampleGeneralDetailElement(this, parentElement
);
2036 addAndAdaptElement(parentElement
, element
);
2040 public DnaSamplePreparationPreservationDetailElement
createDnaSamplePreparationPreservationDetailElement(ICdmFormElement parentElement
){
2041 DnaSamplePreparationPreservationDetailElement element
= new DnaSamplePreparationPreservationDetailElement(this, parentElement
);
2042 addAndAdaptElement(parentElement
, element
);
2046 public DnaQualityDetailElement
createDnaQualityDetailElement(ICdmFormElement parentElement
){
2047 DnaQualityDetailElement element
= new DnaQualityDetailElement(this, parentElement
);
2048 addAndAdaptElement(parentElement
, element
);
2052 public SequenceGeneralDetailElement
createSequenceGeneralDetailElement(ICdmFormElement parentElement
){
2053 SequenceGeneralDetailElement element
= new SequenceGeneralDetailElement(this, parentElement
);
2054 addAndAdaptElement(parentElement
, element
);
2058 public SingleReadGeneralDetailElement
createSingleReadGeneralDetailElement(ICdmFormElement parentElement
){
2059 SingleReadGeneralDetailElement element
= new SingleReadGeneralDetailElement(this, parentElement
);
2060 addAndAdaptElement(parentElement
, element
);
2064 public PrimerGeneralDetailElement
createPrimerGeneralDetailElement(ICdmFormElement parentElement
){
2065 PrimerGeneralDetailElement element
= new PrimerGeneralDetailElement(this, parentElement
);
2066 addAndAdaptElement(parentElement
, element
);
2070 public AmplificationGeneralDetailElement
createAmplificationGeneralDetailElement(ICdmFormElement parentElement
){
2071 AmplificationGeneralDetailElement element
= new AmplificationGeneralDetailElement(this, parentElement
);
2072 addAndAdaptElement(parentElement
, element
);
2076 public AmplificationPrimerDetailElement
createAmplificationPrimerDetailElement(ICdmFormElement parentElement
){
2077 AmplificationPrimerDetailElement element
= new AmplificationPrimerDetailElement(this, parentElement
);
2078 addAndAdaptElement(parentElement
, element
);
2082 public AmplificationCloningDetailElement
createAmplificationCloningDetailElement(ICdmFormElement parentElement
){
2083 AmplificationCloningDetailElement element
= new AmplificationCloningDetailElement(this, parentElement
);
2084 addAndAdaptElement(parentElement
, element
);
2088 public AmplificationGelPhotoDetailElement
createAmplificationGelPhotoDetailElement(ICdmFormElement parentElement
){
2089 AmplificationGelPhotoDetailElement element
= new AmplificationGelPhotoDetailElement(this, parentElement
);
2090 addAndAdaptElement(parentElement
, element
);
2094 public MediaSpecimenGeneralDetailElement
createMediaSpecimenGeneralDetailElement(ICdmFormElement parentElement
){
2095 MediaSpecimenGeneralDetailElement element
= new MediaSpecimenGeneralDetailElement(this, parentElement
);
2096 addAndAdaptElement(parentElement
, element
);
2100 public MediaDetailElement
createMediaDetailElement(ICdmFormElement parentElement
){
2101 MediaDetailElement mediaDetailElement
= new MediaDetailElement(this, parentElement
);
2102 addAndAdaptElement(parentElement
, mediaDetailElement
);
2103 return mediaDetailElement
;
2106 public GatheringEventDetailElement
createGatheringEventDetailElement(ICdmFormElement parentElement
) {
2107 GatheringEventDetailElement element
= new GatheringEventDetailElement(this, parentElement
);
2108 addAndAdaptElement(parentElement
, element
);
2112 public FieldUnitDetailElement
createFieldUnitDetailElement(ICdmFormElement parentElement
) {
2113 FieldUnitDetailElement element
= new FieldUnitDetailElement(this, parentElement
);
2114 addAndAdaptElement(parentElement
, element
);
2118 public SpecimenHierarchyDetailElement
createSpecimenHierarchyDetailElement(ICdmFormElement parentElement
) {
2119 SpecimenHierarchyDetailElement element
= new SpecimenHierarchyDetailElement(this, parentElement
);
2120 addAndAdaptElement(parentElement
, element
);
2124 public DerivedUnitBaseDetailElement
createDerivedUnitBaseDetailElement(ICdmFormElement parentElement
) {
2125 DerivedUnitBaseDetailElement element
= new DerivedUnitBaseDetailElement(this, parentElement
);
2126 addAndAdaptElement(parentElement
, element
);
2130 public OriginalLabelDataElement
createOriginalLabelDataElement(ICdmFormElement parentElement
) {
2131 OriginalLabelDataElement element
= new OriginalLabelDataElement(this, parentElement
);
2132 addAndAdaptElement(parentElement
, element
);
2136 public PreservedSpecimenDetailElement
createPreservedSpecimenDetailElement(ICdmFormElement parentElement
) {
2137 PreservedSpecimenDetailElement element
= new PreservedSpecimenDetailElement(this, parentElement
);
2138 addAndAdaptElement(parentElement
, element
);
2142 public PreservedSpecimenDeterminationDetailElement
createPreservedSpecimenDeterminationDetailElement(ICdmFormElement parentElement
) {
2143 PreservedSpecimenDeterminationDetailElement element
= new PreservedSpecimenDeterminationDetailElement(this, parentElement
);
2144 addAndAdaptElement(parentElement
, element
);
2148 public DeterminationDetailElement
createDeterminationDetailElement(ICdmFormElement parentElement
) {
2149 DeterminationDetailElement element
= new DeterminationDetailElement(this, parentElement
);
2150 addAndAdaptElement(parentElement
, element
);
2154 public SampleDesignationDetailElement
createSampleDesignationDetailElement(ICdmFormElement parentElement
) {
2155 SampleDesignationDetailElement element
= new SampleDesignationDetailElement(this, parentElement
);
2156 addAndAdaptElement(parentElement
, element
);
2161 * @param parentElement
2164 private void addAndAdaptElement(ICdmFormElement parentElement
, AbstractCdmDetailElement
<?
> element
) {
2166 parentElement
.addElement(element
);
2169 //--------EntityCollectionSection----------
2170 public TeamMemberSection
createTeamMemberSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2171 TeamMemberSection section
= new TeamMemberSection(this, conversation
, parentElement
, style
);
2172 addAndAdaptSection(parentElement
, section
);
2176 public AnnotationSection
createAnnotationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2177 AnnotationSection section
= new AnnotationSection(this, conversation
, parentElement
, style
);
2178 addAndAdaptSection(parentElement
, section
);
2182 public CreditSection
createCreditSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2183 CreditSection section
= new CreditSection(this, conversation
, parentElement
, style
);
2184 addAndAdaptSection(parentElement
, section
);
2188 public DescriptionElementSourceSection
createDescriptionElementSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2189 DescriptionElementSourceSection section
= new DescriptionElementSourceSection(this, conversation
, parentElement
, style
);
2190 addAndAdaptSection(parentElement
, section
);
2194 public ExtensionSection
createExtensionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2195 ExtensionSection section
= new ExtensionSection(this, conversation
, parentElement
, style
);
2196 addAndAdaptSection(parentElement
, section
);
2200 public MarkerSection
createMarkerSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2201 MarkerSection section
= new MarkerSection(this, conversation
, parentElement
, style
);
2202 addAndAdaptSection(parentElement
, section
);
2206 public MediaSection
createMediaSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2207 MediaSection section
= new MediaSection(this, conversation
, parentElement
, style
);
2208 addAndAdaptSection(parentElement
, section
);
2212 public DescriptionElementMediaSection
createDescriptionElementMediaSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2213 DescriptionElementMediaSection section
= new DescriptionElementMediaSection(this, conversation
, parentElement
, style
);
2214 addAndAdaptSection(parentElement
, section
);
2218 public MediaRepresentationSection
createMediaRepresentationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2219 MediaRepresentationSection section
= new MediaRepresentationSection(this, conversation
, parentElement
, style
);
2220 addAndAdaptSection(parentElement
, section
);
2224 public MediaRepresentationPartSection
createMediaRepresentationPartSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2225 MediaRepresentationPartSection section
= new MediaRepresentationPartSection(this, conversation
, parentElement
, style
);
2226 addAndAdaptSection(parentElement
, section
);
2230 public ModifierSection
createModifierSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2231 ModifierSection section
= new ModifierSection(this, conversation
, parentElement
, style
);
2232 addAndAdaptSection(parentElement
, section
);
2236 public NomenclaturalStatusSection
createNomenclaturalStatusSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2237 NomenclaturalStatusSection section
= new NomenclaturalStatusSection(this, conversation
, parentElement
, style
);
2238 addAndAdaptSection(parentElement
, section
);
2242 public NameRelationshipDetailSection
createNameRelationshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2243 NameRelationshipDetailSection section
= new NameRelationshipDetailSection(this, conversation
, parentElement
, style
);
2244 addAndAdaptSection(parentElement
, section
);
2248 public SynonymRelationshipDetailSection
createSynonymRelationshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2249 SynonymRelationshipDetailSection section
= new SynonymRelationshipDetailSection(this, conversation
, parentElement
, style
);
2250 addAndAdaptSection(parentElement
, section
);
2254 public ProtologueSection
createProtologueSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2255 ProtologueSection section
= new ProtologueSection(this, conversation
, parentElement
, style
);
2256 addAndAdaptSection(parentElement
, section
);
2260 public RightsSection
createRightsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2261 RightsSection section
= new RightsSection(this, conversation
, parentElement
, style
);
2262 addAndAdaptSection(parentElement
, section
);
2266 public SourceSection
createSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2267 SourceSection section
= new SourceSection(this, conversation
, parentElement
, style
);
2268 addAndAdaptSection(parentElement
, section
);
2272 public ScopeSection
createScopeSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2273 ScopeSection section
= new ScopeSection(this, conversation
, parentElement
, style
);
2274 addAndAdaptSection(parentElement
, section
);
2278 public DescriptionSourceSection
createDescriptionSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2279 DescriptionSourceSection section
= new DescriptionSourceSection(this, conversation
, parentElement
, style
);
2280 addAndAdaptSection(parentElement
, section
);
2284 public TypeDesignationSection
createTypeDesignationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2285 TypeDesignationSection section
= new TypeDesignationSection(this, conversation
, parentElement
, style
);
2286 addAndAdaptSection(parentElement
, section
);
2290 public StateDataSection
createStateDataSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2291 StateDataSection section
= new StateDataSection(this, conversation
, parentElement
, style
);
2292 addAndAdaptSection(parentElement
, section
);
2296 public StatisticalMeasurementValueSection
createStatisticalMeasurementValueSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2297 StatisticalMeasurementValueSection section
= new StatisticalMeasurementValueSection(this, conversation
, parentElement
, style
);
2298 addAndAdaptSection(parentElement
, section
);
2302 public DescribedSpecimenSection
createDescribedSpecimenSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2303 DescribedSpecimenSection section
= new DescribedSpecimenSection(this, conversation
, parentElement
, style
);
2304 addAndAdaptSection(parentElement
, section
);
2308 public StateVocabularyCollectionSection
createStateVocabulariesSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2309 StateVocabularyCollectionSection section
= new StateVocabularyCollectionSection(this, conversation
, parentElement
, style
);
2310 addAndAdaptSection(parentElement
, section
);
2314 public RecommendedModifierVocabulariesCollectionSection
createRecommendedModifierVocabulariesCollectionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2315 RecommendedModifierVocabulariesCollectionSection section
= new RecommendedModifierVocabulariesCollectionSection(this, conversation
, parentElement
, style
);
2316 addAndAdaptSection(parentElement
, section
);
2320 public MeasurementUnitCollectionSection
createMeasurementUnitCollectionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2321 MeasurementUnitCollectionSection section
= new MeasurementUnitCollectionSection(this, conversation
, parentElement
, style
);
2322 addAndAdaptSection(parentElement
, section
);
2326 public StatisticalMeasureCollectionSection
createStatisticalMeasureCollectionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2327 StatisticalMeasureCollectionSection section
= new StatisticalMeasureCollectionSection(this, conversation
, parentElement
, style
);
2328 addAndAdaptSection(parentElement
, section
);
2332 public CollectingAreasDetailSection
createCollectingAreasDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2333 CollectingAreasDetailSection section
= new CollectingAreasDetailSection(this, conversation
, parentElement
, style
);
2334 addAndAdaptSection(parentElement
, section
);
2338 public GeoScopeDetailSection
createGeoScopeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2339 GeoScopeDetailSection section
= new GeoScopeDetailSection(this, conversation
, parentElement
, style
);
2340 addAndAdaptSection(parentElement
, section
);
2344 public GeoScopePolyKeyDetailSection
createGeoScopePolyKeyDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2345 GeoScopePolyKeyDetailSection section
= new GeoScopePolyKeyDetailSection(this, conversation
, parentElement
, style
);
2346 addAndAdaptSection(parentElement
, section
);
2350 public IdentifierDetailSection
createIdentifierDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2351 IdentifierDetailSection section
= new IdentifierDetailSection(this, conversation
, parentElement
, style
);
2352 addAndAdaptSection(parentElement
, section
);
2356 public CurrentSampleDesignationDetailSection
createCurrentSampleDesignationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2357 CurrentSampleDesignationDetailSection section
= new CurrentSampleDesignationDetailSection(this, conversation
, parentElement
, style
);
2358 addAndAdaptSection(parentElement
, section
);
2362 public CurrentDeterminationDetailSection
createCurrentDeterminationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2363 CurrentDeterminationDetailSection section
= new CurrentDeterminationDetailSection(this, conversation
, parentElement
, style
);
2364 addAndAdaptSection(parentElement
, section
);
2368 public PreservedSpecimenCurrentDeterminationDetailSection
createPreservedSpecimenCurrentDeterminationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2369 PreservedSpecimenCurrentDeterminationDetailSection section
= new PreservedSpecimenCurrentDeterminationDetailSection(this, conversation
, parentElement
, style
);
2370 addAndAdaptSection(parentElement
, section
);
2374 public SampleDesignationHistoryDetailSection
createSampleDesignationHistoryDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2375 SampleDesignationHistoryDetailSection section
= new SampleDesignationHistoryDetailSection(this, conversation
, parentElement
, style
);
2376 addAndAdaptSection(parentElement
, section
);
2380 public DeterminationHistoryDetailSection
createDeterminationHistoryDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2381 DeterminationHistoryDetailSection section
= new DeterminationHistoryDetailSection(this, conversation
, parentElement
, style
);
2382 addAndAdaptSection(parentElement
, section
);
2386 public PreservedSpecimenDeterminationHistoryDetailSection
createPreservedSpecimenDeterminationHistoryDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2387 PreservedSpecimenDeterminationHistoryDetailSection section
= new PreservedSpecimenDeterminationHistoryDetailSection(this, conversation
, parentElement
, style
);
2388 addAndAdaptSection(parentElement
, section
);
2392 public SpecimenCollectionDetailSection
createSpecimenCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2393 SpecimenCollectionDetailSection section
= new SpecimenCollectionDetailSection(this, conversation
, parentElement
, style
);
2394 addAndAdaptSection(parentElement
, section
);
2398 public PreservedSpecimenSourceCollectionDetailSection
createPreservedSpecimenSourceCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2399 PreservedSpecimenSourceCollectionDetailSection section
= new PreservedSpecimenSourceCollectionDetailSection(this, conversation
, parentElement
, style
);
2400 addAndAdaptSection(parentElement
, section
);
2404 public SourceCollectionDetailSection
createSourceCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2405 SourceCollectionDetailSection section
= new SourceCollectionDetailSection(this, conversation
, parentElement
, style
);
2406 addAndAdaptSection(parentElement
, section
);
2410 public ScopeRestrictionSection
createScopeRestrictionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2411 ScopeRestrictionSection section
= new ScopeRestrictionSection(this, conversation
, parentElement
, style
);
2412 addAndAdaptSection(parentElement
, section
);
2416 public MemberDetailSection
createMemberDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2417 MemberDetailSection section
= new MemberDetailSection(this, conversation
, parentElement
, style
);
2418 addAndAdaptSection(parentElement
, section
);
2422 public GrantedAuthorityDetailSection
createGrantedAuthorityDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2423 GrantedAuthorityDetailSection section
= new GrantedAuthorityDetailSection(this, conversation
, parentElement
, style
);
2424 addAndAdaptSection(parentElement
, section
);
2428 public GroupsByUserDetailSection
createGroupsByUserDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2429 GroupsByUserDetailSection section
= new GroupsByUserDetailSection(this, conversation
, parentElement
, style
);
2430 addAndAdaptSection(parentElement
, section
);
2434 public TaxonomicScopeSection
createTaxonomicScopeSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2435 TaxonomicScopeSection section
= new TaxonomicScopeSection(this, conversation
, parentElement
, style
);
2436 addAndAdaptSection(parentElement
, section
);
2440 public AbstractEntityCollectionElement
createEntityCollectionElement(AbstractFormSection parentElement
,
2441 Object versionableEntity
, SelectionListener removeListener
, Color backgroundColor
, int style
) {
2442 AbstractEntityCollectionElement element
= null;
2444 Object entity
= HibernateProxyHelper
.deproxy(versionableEntity
);
2446 if (entity
instanceof Annotation
) {
2447 element
= new AnnotationElement(this, parentElement
, (Annotation
) entity
, removeListener
, style
);
2448 } else if (entity
instanceof Person
) {
2449 element
= new TeamMemberElement(this, parentElement
, (Person
) entity
, removeListener
, style
);
2450 } else if (entity
instanceof Credit
) {
2451 element
= new CreditElement(this, parentElement
, (Credit
) entity
, removeListener
, style
);
2452 } else if (entity
instanceof Extension
) {
2453 element
= new ExtensionElement(this, parentElement
, (Extension
) entity
, removeListener
, style
);
2454 } else if (entity
instanceof Marker
) {
2455 element
= new MarkerElement(this, parentElement
, (Marker
) entity
, removeListener
, style
);
2456 } else if (entity
instanceof Media
) {
2457 element
= new MediaMetaElement(this, parentElement
, (Media
) entity
, removeListener
, true, style
);
2458 } else if (entity
instanceof MediaRepresentation
) {
2459 element
= new MediaRepresentationElement(this, parentElement
, (MediaRepresentation
) entity
, removeListener
,
2461 } else if (entity
instanceof ImageFile
) {
2462 element
= new ImageFileElement(this, parentElement
, (ImageFile
) entity
, removeListener
, style
);
2463 } else if (entity
instanceof MediaRepresentationPart
) {
2464 element
= new MediaRepresentationPartElement(this, parentElement
, (MediaRepresentationPart
) entity
,
2465 removeListener
, style
);
2466 } else if (entity
instanceof NomenclaturalStatus
) {
2467 element
= new NomenclaturalStatusElement(this, parentElement
, (NomenclaturalStatus
) entity
, removeListener
,
2469 } else if (entity
instanceof Rights
) {
2470 element
= new RightsElement(this, parentElement
, (Rights
) entity
, removeListener
, style
);
2471 } else if (entity
instanceof DescriptionElementSource
) {
2472 element
= new DescriptionElementSourceElement(this, parentElement
, (DescriptionElementSource
) entity
,
2473 removeListener
, style
);
2474 } else if (entity
instanceof IdentifiableSource
) {
2475 element
= new IdentifiableSourceElement(this, parentElement
, (IdentifiableSource
) entity
, removeListener
,
2477 } else if (entity
instanceof DefinedTerm
) {
2478 switch(((DefinedTerm
)entity
).getTermType()) {
2480 element
= new ScopeElement(this,
2482 (DefinedTerm
) entity
,
2487 element
= new ModifierElement(this,
2489 (DefinedTerm
) entity
,
2497 } else if (entity
instanceof Reference
) {
2498 if(parentElement
instanceof SequenceReferenceCollectionDetailSection
){
2499 element
= new SequenceReferenceCollectionDetailElement(this, parentElement
, (Reference
) entity
, removeListener
, style
);
2502 element
= new DescriptionSourceElement(this, parentElement
, (Reference
) entity
, removeListener
, style
);
2504 } else if (entity
instanceof NameTypeDesignation
) {
2505 element
= new NameTypeDesignationElement(this, parentElement
, (NameTypeDesignation
) entity
, removeListener
,
2507 } else if (entity
instanceof NameRelationship
) {
2508 element
= new NameRelationshipDetailElement(this, parentElement
, (NameRelationship
) entity
, removeListener
,
2510 } else if (entity
instanceof SynonymRelationship
) {
2511 element
= new SynonymRelationshipDetailElement(this, parentElement
, (SynonymRelationship
) entity
, removeListener
,
2513 } else if (entity
instanceof SpecimenTypeDesignation
) {
2514 if(parentElement
instanceof DerivedUnitTypeDesignationSection
){
2515 element
= new DerivedUnitTypeDesignationElement(this, parentElement
, (SpecimenTypeDesignation
) entity
,
2516 removeListener
, style
);
2519 element
= new SpecimenTypeDesignationElement(this, parentElement
, (SpecimenTypeDesignation
) entity
,
2520 removeListener
, style
);
2522 } else if (entity
instanceof StateData
) {
2523 element
= new StateDataElement(this, parentElement
, (StateData
) entity
, removeListener
, style
);
2524 } else if (entity
instanceof StatisticalMeasurementValue
) {
2525 element
= new StatisticalMeasurementValueElement(this, parentElement
, (StatisticalMeasurementValue
) entity
,
2526 removeListener
, style
);
2527 } else if (entity
instanceof DerivedUnit
) {
2528 switch(((DerivedUnit
)entity
).getRecordBasis()) {
2529 case LivingSpecimen
:
2530 case PreservedSpecimen
:
2532 element
= new SpecimenCollectionDetailElement(this,
2534 (DerivedUnit
) entity
,
2539 element
= new DerivedUnitElement(this,
2541 (DerivedUnit
) entity
,
2546 } else if (entity
instanceof NamedArea
) {
2547 element
= new NamedAreaDetailElement(this, parentElement
, (NamedArea
) entity
, removeListener
, style
);
2548 } else if (entity
instanceof DeterminationEvent
) {
2549 element
= new DeterminationEventDetailElement(this, parentElement
, (DeterminationEvent
) entity
, removeListener
, style
);
2550 } else if (entity
instanceof User
) {
2551 element
= new MemberDetailElement(this, parentElement
, (User
) entity
, removeListener
, style
);
2552 } else if (entity
instanceof GrantedAuthority
) {
2553 element
= new GrantedAuthorityCollectionElement(this, parentElement
, (GrantedAuthorityImpl
) entity
,
2554 removeListener
, style
);
2555 } else if (entity
instanceof Group
) {
2556 element
= new GroupsByUserDetailElement(this, parentElement
, (Group
) entity
, removeListener
, style
);
2557 } else if (entity
instanceof Taxon
) {
2558 element
= new TaxonDetailElement(this, parentElement
, (Taxon
) entity
, removeListener
, style
);
2559 } else if (entity
instanceof DescriptionElementBase
) {
2560 // this is the special case for protologs, maybe we can do this
2561 // differently when API improves
2562 DescriptionElementBase descriptionElement
= (DescriptionElementBase
) entity
;
2563 if (descriptionElement
.getFeature().equals(Feature
.PROTOLOGUE())) {
2564 element
= new ProtologueElement(this, parentElement
, descriptionElement
, removeListener
, style
);
2566 } else if (entity
instanceof Identifier
) {
2567 if(parentElement
instanceof AbstractSampleDesignationDetailSection
){
2568 element
= new SampleDesignationTextDetailElement(this, parentElement
, (Identifier
<DnaSample
>) entity
, removeListener
, backgroundColor
, style
);
2571 element
= new IdentifierDetailElement(this, parentElement
, (Identifier
) entity
, removeListener
, style
);
2573 } else if (entity
instanceof TermVocabulary
) {
2574 TermVocabulary
<?
> termVocabulary
= (TermVocabulary
<?
>)entity
;
2575 switch (termVocabulary
.getTermType()) {
2577 element
= new StateVocabularyCollectionElement(this, parentElement
, (TermVocabulary
<State
>) entity
, removeListener
, backgroundColor
, style
);
2580 element
= new RecommendedModifierVocabulariesElement(this, parentElement
, (TermVocabulary
<DefinedTerm
>) entity
, removeListener
, backgroundColor
, style
);
2585 } else if (entity
instanceof MeasurementUnit
) {
2586 element
= new MeasurementUnitCollectionElement(this, parentElement
, (MeasurementUnit
) entity
, removeListener
, backgroundColor
, style
);
2587 } else if (entity
instanceof StatisticalMeasure
) {
2588 element
= new StatisticalMeasureCollectionElement(this, parentElement
, (StatisticalMeasure
) entity
, removeListener
, backgroundColor
, style
);
2591 if (element
== null) {
2592 MessagingUtils
.messageDialog("No element for entity", this,
2593 "Could not generate element for entity. Looks like the case is not handled already. Check implementation. Entity: "
2598 if (backgroundColor
!= null && !backgroundColor
.isDisposed()) {
2599 element
.setPersistentBackground(backgroundColor
);
2602 parentElement
.addElement(element
);
2610 * Creates a selection element for the given type T.
2613 * <strong>Selection elements not handled by this method:</strong>
2615 * <li>{@link TaxonNodeSelectionElement} see
2616 * {@link #createTaxonNodeSelectionElement(ConversationHolder, ICdmFormElement, String, TaxonNode, int, int)}
2618 * <li>{@link NomenclaturalAuthorTeamSelectionElement} see
2619 * {@link #createNomenclaturalAuthorTeamSelectionElement(ConversationHolder, ICdmFormElement, String, Team, int, int)}
2625 * a {@link Class} object of the type that you want the selection
2627 * @param parentElement
2628 * a {@link ICdmFormElement} object.
2629 * @param labelString
2630 * a {@link String} object.
2631 * @param selectionType
2633 * a {@link ICdmBase} object.
2636 * @param conversation
2637 * a {@link ConversationHolder} object.
2638 * @return a {@link EntitySelectionElement} object.
2640 public <T
extends ICdmBase
> EntitySelectionElement
<T
> createSelectionElement(Class
<T
> clazz
,
2641 ConversationHolder conversation
, ICdmFormElement parentElement
, String labelString
, T selection
, int mode
,
2643 EntitySelectionElement
<T
> element
= new EntitySelectionElement
<T
>(this, conversation
, parentElement
, clazz
,
2644 labelString
, selection
, mode
, style
);
2646 parentElement
.addElement(element
);
2652 * Creates a selection element for the given type T which shows only the <b>abbreviated</b> title as the label.
2655 * <strong>Selection elements not handled by this method:</strong>
2657 * <li>{@link TaxonNodeSelectionElement} see
2658 * {@link #createTaxonNodeSelectionElement(ConversationHolder, ICdmFormElement, String, TaxonNode, int, int)}
2660 * <li>{@link NomenclaturalAuthorTeamSelectionElement} see
2661 * {@link #createNomenclaturalAuthorTeamSelectionElement(ConversationHolder, ICdmFormElement, String, Team, int, int)}
2667 * a {@link Class} object of the type that you want the selection
2669 * @param parentElement
2670 * a {@link ICdmFormElement} object.
2671 * @param labelString
2672 * a {@link String} object.
2673 * @param selectionType
2675 * a {@link ICdmBase} object.
2678 * @param conversation
2679 * a {@link ConversationHolder} object.
2680 * @return a {@link EntitySelectionElement} object.
2682 public <T
extends ICdmBase
> EntitySelectionElementWithAbbreviatedTitle
<T
> createSelectionElementWithAbbreviatedTitle(
2683 Class
<T
> clazz
, ConversationHolder conversation
, ICdmFormElement parentElement
, String labelString
,
2684 T selection
, int mode
, int style
) {
2685 EntitySelectionElementWithAbbreviatedTitle
<T
> element
= new EntitySelectionElementWithAbbreviatedTitle
<T
>(this, conversation
, parentElement
, clazz
,
2686 labelString
, selection
, mode
, style
);
2688 parentElement
.addElement(element
);
2692 public TaxonNodeSelectionElement
createTaxonNodeSelectionElement(ConversationHolder conversation
,
2693 ICdmFormElement parentElement
, String labelString
, TaxonNode selection
, int mode
, int style
) {
2694 TaxonNodeSelectionElement element
= new TaxonNodeSelectionElement(this, conversation
, parentElement
,
2695 labelString
, selection
, mode
, style
);
2697 parentElement
.addElement(element
);
2701 public NomenclaturalAuthorTeamSelectionElement
createNomenclaturalAuthorTeamSelectionElement(
2702 ConversationHolder conversation
, ICdmFormElement parentElement
, String labelString
, Team selection
,
2703 int mode
, int style
) {
2704 NomenclaturalAuthorTeamSelectionElement element
= new NomenclaturalAuthorTeamSelectionElement(this,
2705 conversation
, parentElement
, labelString
, selection
, mode
, style
);
2707 parentElement
.addElement(element
);
2711 /** {@inheritDoc} */
2712 public LabelElement
createLabel(ICdmFormElement parentElement
, String text
) {
2713 LabelElement labelElement
= new LabelElement(this, parentElement
, text
);
2714 adapt(labelElement
);
2715 parentElement
.addElement(labelElement
);
2716 return labelElement
;
2719 public DateElement
createDateElement(ICdmFormElement formElement
, String labelText
, DateTime dateTime
, int style
){
2720 Label label
= new Label(formElement
.getLayoutComposite(), style
);
2721 label
.setText(labelText
+" (yyyy-MM-dd)");
2722 DateElement dateElement
= new DateElement(formElement
.getLayoutComposite(), dateTime
, style
);
2723 dateElement
.initController(this, formElement
);
2729 * Getter for the field <code>selectionProvider</code>.
2732 * @return a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
2734 public ISelectionProvider
getSelectionProvider() {
2735 return selectionProvider
;
2740 * createDetailedDescriptionDetailElement
2743 * @param parentElement
2744 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
2748 * {@link eu.etaxonomy.cdm.model.description.DescriptionElementBase}
2753 * {@link eu.etaxonomy.taxeditor.ui.section.description.detail.AbstractDetailedDescriptionDetailElement}
2756 public AbstractDetailedDescriptionDetailElement
createDetailedDescriptionDetailElement(
2757 ICdmFormElement parentElement
, DescriptionElementBase entity
, int style
) {
2758 AbstractDetailedDescriptionDetailElement detailedDescriptionElement
= null;
2760 if (entity
instanceof CategoricalData
) {
2761 detailedDescriptionElement
= new CategoricalDataDetailElement(this, parentElement
,
2762 (CategoricalData
) entity
, style
);
2763 } else if (entity
instanceof CommonTaxonName
) {
2764 detailedDescriptionElement
= new CommonNameDetailElement(this, parentElement
, (CommonTaxonName
) entity
,
2766 } else if (entity
instanceof Distribution
) {
2767 detailedDescriptionElement
= new DistributionDetailElement(this, parentElement
, (Distribution
) entity
,
2769 } else if (entity
instanceof IndividualsAssociation
) {
2770 detailedDescriptionElement
= new IndividualsAssociationDetailElement(this, parentElement
,
2771 (IndividualsAssociation
) entity
, style
);
2772 } else if (entity
instanceof QuantitativeData
) {
2773 detailedDescriptionElement
= new QuantitativeDataDetailElement(this, parentElement
,
2774 (QuantitativeData
) entity
, style
);
2775 } else if (entity
instanceof TaxonInteraction
) {
2776 detailedDescriptionElement
= new TaxonInteractionDetailElement(this, parentElement
,
2777 (TaxonInteraction
) entity
, style
);
2778 } else if (entity
instanceof TextData
) {
2779 detailedDescriptionElement
= new TextDataDetailElement(this, parentElement
, (TextData
) entity
, style
);
2781 throw new IllegalStateException("There is no interface for the given description element");
2783 adapt(detailedDescriptionElement
);
2784 parentElement
.addElement(detailedDescriptionElement
);
2785 return detailedDescriptionElement
;
2790 * Creates a styled text as a part of the form.
2795 * the text initial value
2798 * @return the text widget
2800 public StyledText
createStyledText(Composite parent
, String value
, int style
) {
2801 StyledText text
= new StyledText(parent
, getBorderStyle() | style
| getOrientation());
2802 if (value
!= null) {
2803 text
.setText(value
);
2805 text
.setForeground(getColors().getForeground());
2806 text
.setBackground(getColors().getBackground());
2807 // text.addFocusListener(visibilityHandler);
2811 public PreservedSpecimenDetailSection
createPreservedSpecimenDetailsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
2812 PreservedSpecimenDetailSection section
= new PreservedSpecimenDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
2813 addAndAdaptSection(parentElement
, section
);