4 package eu
.etaxonomy
.taxeditor
.ui
.element
;
7 import java
.util
.ArrayList
;
8 import java
.util
.Comparator
;
9 import java
.util
.HashSet
;
10 import java
.util
.List
;
14 import javax
.inject
.Inject
;
16 import org
.eclipse
.e4
.core
.contexts
.IEclipseContext
;
17 import org
.eclipse
.jface
.util
.IPropertyChangeListener
;
18 import org
.eclipse
.jface
.viewers
.ISelection
;
19 import org
.eclipse
.jface
.viewers
.ISelectionProvider
;
20 import org
.eclipse
.jface
.window
.Window
;
21 //import org.eclipse.nebula.widgets.richtext.RichTextEditor;
22 import org
.eclipse
.swt
.SWT
;
23 import org
.eclipse
.swt
.custom
.StyledText
;
24 import org
.eclipse
.swt
.events
.FocusAdapter
;
25 import org
.eclipse
.swt
.events
.FocusEvent
;
26 import org
.eclipse
.swt
.events
.FocusListener
;
27 import org
.eclipse
.swt
.events
.MouseAdapter
;
28 import org
.eclipse
.swt
.events
.MouseEvent
;
29 import org
.eclipse
.swt
.events
.MouseListener
;
30 import org
.eclipse
.swt
.events
.SelectionEvent
;
31 import org
.eclipse
.swt
.events
.SelectionListener
;
32 import org
.eclipse
.swt
.events
.TypedEvent
;
33 import org
.eclipse
.swt
.graphics
.Color
;
34 import org
.eclipse
.swt
.graphics
.Font
;
35 import org
.eclipse
.swt
.widgets
.Composite
;
36 import org
.eclipse
.swt
.widgets
.Control
;
37 import org
.eclipse
.swt
.widgets
.Display
;
38 import org
.eclipse
.swt
.widgets
.Event
;
39 import org
.eclipse
.swt
.widgets
.Label
;
40 import org
.eclipse
.ui
.forms
.IFormColors
;
41 import org
.eclipse
.ui
.forms
.widgets
.ExpandableComposite
;
42 import org
.eclipse
.ui
.forms
.widgets
.FormToolkit
;
43 import org
.eclipse
.ui
.forms
.widgets
.Section
;
44 import org
.eclipse
.ui
.forms
.widgets
.TableWrapData
;
45 import org
.eclipse
.ui
.internal
.forms
.widgets
.FormFonts
;
46 import org
.joda
.time
.DateTime
;
47 import org
.joda
.time
.Partial
;
48 import org
.springframework
.security
.core
.GrantedAuthority
;
50 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
51 import eu
.etaxonomy
.cdm
.api
.facade
.DerivedUnitFacade
;
52 import eu
.etaxonomy
.cdm
.hibernate
.HibernateProxyHelper
;
53 import eu
.etaxonomy
.cdm
.model
.agent
.Person
;
54 import eu
.etaxonomy
.cdm
.model
.agent
.Team
;
55 import eu
.etaxonomy
.cdm
.model
.common
.Annotation
;
56 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
57 import eu
.etaxonomy
.cdm
.model
.common
.Credit
;
58 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTerm
;
59 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTermBase
;
60 import eu
.etaxonomy
.cdm
.model
.common
.Extension
;
61 import eu
.etaxonomy
.cdm
.model
.common
.GrantedAuthorityImpl
;
62 import eu
.etaxonomy
.cdm
.model
.common
.Group
;
63 import eu
.etaxonomy
.cdm
.model
.common
.ICdmBase
;
64 import eu
.etaxonomy
.cdm
.model
.common
.IEnumTerm
;
65 import eu
.etaxonomy
.cdm
.model
.common
.IdentifiableSource
;
66 import eu
.etaxonomy
.cdm
.model
.common
.Identifier
;
67 import eu
.etaxonomy
.cdm
.model
.common
.LSID
;
68 import eu
.etaxonomy
.cdm
.model
.common
.Language
;
69 import eu
.etaxonomy
.cdm
.model
.common
.LanguageString
;
70 import eu
.etaxonomy
.cdm
.model
.common
.Marker
;
71 import eu
.etaxonomy
.cdm
.model
.common
.Representation
;
72 import eu
.etaxonomy
.cdm
.model
.common
.TermBase
;
73 import eu
.etaxonomy
.cdm
.model
.common
.TermType
;
74 import eu
.etaxonomy
.cdm
.model
.common
.TermVocabulary
;
75 import eu
.etaxonomy
.cdm
.model
.common
.TimePeriod
;
76 import eu
.etaxonomy
.cdm
.model
.common
.User
;
77 import eu
.etaxonomy
.cdm
.model
.common
.VersionableEntity
;
78 import eu
.etaxonomy
.cdm
.model
.description
.CategoricalData
;
79 import eu
.etaxonomy
.cdm
.model
.description
.CommonTaxonName
;
80 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionElementBase
;
81 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionElementSource
;
82 import eu
.etaxonomy
.cdm
.model
.description
.Distribution
;
83 import eu
.etaxonomy
.cdm
.model
.description
.Feature
;
84 import eu
.etaxonomy
.cdm
.model
.description
.IndividualsAssociation
;
85 import eu
.etaxonomy
.cdm
.model
.description
.KeyStatement
;
86 import eu
.etaxonomy
.cdm
.model
.description
.MeasurementUnit
;
87 import eu
.etaxonomy
.cdm
.model
.description
.PresenceAbsenceTerm
;
88 import eu
.etaxonomy
.cdm
.model
.description
.QuantitativeData
;
89 import eu
.etaxonomy
.cdm
.model
.description
.State
;
90 import eu
.etaxonomy
.cdm
.model
.description
.StateData
;
91 import eu
.etaxonomy
.cdm
.model
.description
.StatisticalMeasure
;
92 import eu
.etaxonomy
.cdm
.model
.description
.StatisticalMeasurementValue
;
93 import eu
.etaxonomy
.cdm
.model
.description
.TaxonInteraction
;
94 import eu
.etaxonomy
.cdm
.model
.description
.TextData
;
95 import eu
.etaxonomy
.cdm
.model
.location
.NamedArea
;
96 import eu
.etaxonomy
.cdm
.model
.location
.NamedAreaLevel
;
97 import eu
.etaxonomy
.cdm
.model
.location
.Point
;
98 import eu
.etaxonomy
.cdm
.model
.media
.ImageFile
;
99 import eu
.etaxonomy
.cdm
.model
.media
.Media
;
100 import eu
.etaxonomy
.cdm
.model
.media
.MediaRepresentation
;
101 import eu
.etaxonomy
.cdm
.model
.media
.MediaRepresentationPart
;
102 import eu
.etaxonomy
.cdm
.model
.media
.Rights
;
103 import eu
.etaxonomy
.cdm
.model
.molecular
.DnaSample
;
104 import eu
.etaxonomy
.cdm
.model
.name
.NameRelationship
;
105 import eu
.etaxonomy
.cdm
.model
.name
.NameTypeDesignation
;
106 import eu
.etaxonomy
.cdm
.model
.name
.NomenclaturalStatus
;
107 import eu
.etaxonomy
.cdm
.model
.name
.SpecimenTypeDesignation
;
108 import eu
.etaxonomy
.cdm
.model
.occurrence
.DerivedUnit
;
109 import eu
.etaxonomy
.cdm
.model
.occurrence
.DeterminationEvent
;
110 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
111 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
112 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonNode
;
113 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonNodeAgentRelation
;
114 import eu
.etaxonomy
.cdm
.strategy
.parser
.ParserProblem
;
115 import eu
.etaxonomy
.taxeditor
.model
.MessagingUtils
;
116 import eu
.etaxonomy
.taxeditor
.ui
.combo
.EnumComboElement
;
117 import eu
.etaxonomy
.taxeditor
.ui
.combo
.TermComboElement
;
118 import eu
.etaxonomy
.taxeditor
.ui
.combo
.VocabularyComboElement
;
119 import eu
.etaxonomy
.taxeditor
.ui
.dialog
.CloneClassificationDetailElement
;
120 import eu
.etaxonomy
.taxeditor
.ui
.element
.MinMaxTextSection
.UnitType
;
121 import eu
.etaxonomy
.taxeditor
.ui
.mvc
.element
.DateElement
;
122 import eu
.etaxonomy
.taxeditor
.ui
.openurl
.IOpenUrlEnabled
;
123 import eu
.etaxonomy
.taxeditor
.ui
.openurl
.OpenUrlSelectorElement
;
124 import eu
.etaxonomy
.taxeditor
.ui
.password
.EditPasswordElement
;
125 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailElement
;
126 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailSection
;
127 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionElement
;
128 import eu
.etaxonomy
.taxeditor
.ui
.section
.EmptyElement
;
129 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.InstitutionDetailElement
;
130 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.InstitutionDetailSection
;
131 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailElement
;
132 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailSection
;
133 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailElement
;
134 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailSection
;
135 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamMemberElement
;
136 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamMemberSection
;
137 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamOrPersonBaseDetailSection
;
138 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.ClassificationDetailElement
;
139 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.ClassificationDetailSection
;
140 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.TaxonNodeAgentRelationCollectionElement
;
141 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.TaxonNodeAgentRelationCollectionSection
;
142 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.TaxonNodeDetailElement
;
143 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.TaxonNodeDetailSection
;
144 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferenceEntityDetailElement
;
145 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferencedEntityDetailSection
;
146 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DerivedUnitElement
;
147 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescribedSpecimenSection
;
148 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailElement
;
149 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailSection
;
150 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailElement
;
151 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailSection
;
152 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementMediaSection
;
153 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceElement
;
154 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceSection
;
155 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceElement
;
156 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceSection
;
157 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.MediaDetailsSection
;
158 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ModifierElement
;
159 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ModifierSection
;
160 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageDetailElement
;
161 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageSection
;
162 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeElement
;
163 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeSection
;
164 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StateDataElement
;
165 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StateDataSection
;
166 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StatisticalMeasurementValueElement
;
167 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StatisticalMeasurementValueSection
;
168 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.AbstractDetailedDescriptionDetailElement
;
169 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.CategoricalDataDetailElement
;
170 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.CommonNameDetailElement
;
171 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.DistributionDetailElement
;
172 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.IndividualsAssociationDetailElement
;
173 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.QuantitativeDataDetailElement
;
174 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.TaxonInteractionDetailElement
;
175 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.TextDataDetailElement
;
176 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailElement
;
177 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailSection
;
178 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityCollectionElement
;
179 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailElement
;
180 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailSection
;
181 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailElement
;
182 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailSection
;
183 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailElement
;
184 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailSection
;
185 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailElement
;
186 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailSection
;
187 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailElement
;
188 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailSection
;
189 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.ScopeRestrictionSection
;
190 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.TaxonomicScopeSection
;
191 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.ImageFileElement
;
192 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaDetailElement
;
193 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaMetaElement
;
194 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationElement
;
195 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationPartElement
;
196 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationPartSection
;
197 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationSection
;
198 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaSection
;
199 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.AuthorshipDetailElement
;
200 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.AuthorshipDetailSection
;
201 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.HybridDetailElement
;
202 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.HybridDetailSection
;
203 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameDetailElement
;
204 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameDetailSection
;
205 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailElement
;
206 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailSection
;
207 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameTypeDesignationElement
;
208 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusElement
;
209 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusSection
;
210 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailElement
;
211 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailSection
;
212 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.ProtologueElement
;
213 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.ProtologueSection
;
214 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.SpecimenTypeDesignationElement
;
215 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.TypeDesignationSection
;
216 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CollectingAreasDetailSection
;
217 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CollectionDetailElement
;
218 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CurrentDeterminationDetailSection
;
219 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitBaseDetailElement
;
220 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitBaseDetailSection
;
221 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitGeneralDetailElement
;
222 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitGeneralDetailSection
;
223 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailElement
;
224 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailSection
;
225 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationEventDetailElement
;
226 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationHistoryDetailSection
;
227 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.EmptySection
;
228 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitDetailElement
;
229 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitDetailSection
;
230 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitGeneralDetailElement
;
231 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitGeneralDetailSection
;
232 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailElement
;
233 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailSection
;
234 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GeoScopeDetailSection
;
235 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GeoScopePolyKeyDetailSection
;
236 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.NamedAreaDetailElement
;
237 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.OriginalLabelDataSection
;
238 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SourceCollectionDetailSection
;
239 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SpecimenCollectionDetailElement
;
240 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SpecimenCollectionDetailSection
;
241 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SpecimenHierarchyDetailElement
;
242 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SpecimenHierarchyDetailSection
;
243 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.association
.DerivedUnitTypeDesignationElement
;
244 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.association
.DerivedUnitTypeDesignationSection
;
245 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.association
.TaxonAssociationDetailElement
;
246 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.association
.TaxonAssociationDetailSection
;
247 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenCurrentDeterminationDetailSection
;
248 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenDetailElement
;
249 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenDetailSection
;
250 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenGeneralDetailElement
;
251 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenGeneralDetailSection
;
252 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenSourceCollectionDetailSection
;
253 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AbstractSampleDesignationDetailSection
;
254 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationCloningDetailElement
;
255 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationCloningDetailSection
;
256 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationGelPhotoCollectionDetailSection
;
257 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationGelPhotoDetailElement
;
258 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationGeneralDetailElement
;
259 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationGeneralDetailSection
;
260 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationPrimerDetailElement
;
261 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationPrimerDetailSection
;
262 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.CurrentSampleDesignationDetailSection
;
263 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaQualityDetailElement
;
264 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaQualityDetailSection
;
265 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaSampleGeneralDetailElement
;
266 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaSampleGeneralDetailSection
;
267 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaSamplePreparationPreservationDetailElement
;
268 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaSamplePreparationPreservationSection
;
269 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.PrimerGeneralDetailElement
;
270 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SampleDesignationDetailElement
;
271 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SampleDesignationDetailSection
;
272 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SampleDesignationHistoryDetailSection
;
273 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SampleDesignationTextDetailElement
;
274 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceContigFileCollectionDetailSection
;
275 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceGeneralDetailElement
;
276 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceGeneralDetailSection
;
277 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceReferenceCollectionDetailElement
;
278 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceReferenceCollectionDetailSection
;
279 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SingleReadGeneralDetailElement
;
280 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SingleReadGeneralDetailSection
;
281 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SingleReadPherogramCollectionDetailSection
;
282 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.TissueSampleGeneralDetailElement
;
283 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.TissueSampleGeneralDetailSection
;
284 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.media
.MediaSpecimenGeneralDetailElement
;
285 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.media
.MediaSpecimenGeneralDetailSection
;
286 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailElement
;
287 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailSection
;
288 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailElement
;
289 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailSection
;
290 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.AnnotationElement
;
291 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.AnnotationSection
;
292 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CdmBaseElement
;
293 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CdmBaseSection
;
294 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CreditElement
;
295 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CreditSection
;
296 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.ExtensionElement
;
297 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.ExtensionSection
;
298 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.HeadlineSection
;
299 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.IdentifiableSourceElement
;
300 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.MarkerElement
;
301 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.MarkerSection
;
302 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.RightsElement
;
303 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.RightsSection
;
304 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.SourceSection
;
305 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.VersionElement
;
306 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.VersionSection
;
307 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.identifier
.DerivedUnitFacadeIdentifierSection
;
308 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.identifier
.IdentifierElement
;
309 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.identifier
.IdentifierSection
;
310 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessageElement
;
311 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessagesSection
;
312 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailElement
;
313 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailSection
;
314 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonDetailElement
;
315 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonDetailSection
;
316 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonOfRelationshipElement
;
317 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailElement
;
318 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailSection
;
319 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailElement
;
320 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailSection
;
321 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailElement
;
322 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailSection
;
323 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailElement
;
324 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailSection
;
325 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.DefinedTermDetailElement
;
326 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.DefinedTermDetailSection
;
327 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.FeatureDetailElement
;
328 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.MeasurementUnitCollectionElement
;
329 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.MeasurementUnitCollectionSection
;
330 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailSection
;
331 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.PresenceAbsenceTermDetailElement
;
332 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.RecommendedModifierVocabulariesCollectionSection
;
333 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.RecommendedModifierVocabulariesElement
;
334 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.StateVocabularyCollectionElement
;
335 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.StateVocabularyCollectionSection
;
336 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.StatisticalMeasureCollectionElement
;
337 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.StatisticalMeasureCollectionSection
;
338 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailElement
;
339 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailSection
;
340 import eu
.etaxonomy
.taxeditor
.ui
.selection
.EntitySelectionElement
;
341 import eu
.etaxonomy
.taxeditor
.ui
.selection
.EntitySelectionElementWithAbbreviatedTitle
;
342 import eu
.etaxonomy
.taxeditor
.ui
.selection
.NomenclaturalAuthorTeamSelectionElement
;
343 import eu
.etaxonomy
.taxeditor
.ui
.selection
.TaxonNodeSelectionElement
;
347 * CdmFormFactory class.
351 * @created Feb 24, 2010
354 public class CdmFormFactory
extends FormToolkit
{
356 private BoldFontHolder2 boldFontHolder2
;
357 private MouseListener selectionMouseHandler
;
358 private FocusListener selectionFocusHandler
;
361 private IEclipseContext context
;
363 private final Set
<SelectionListener
> selectionListenerList
= new HashSet
<SelectionListener
>();
365 private final List
<IPropertyChangeListener
> propertyChangeListeners
= new ArrayList
<IPropertyChangeListener
>();
367 private final int orientation
= Window
.getDefaultOrientation();
368 private ISelectionProvider selectionProvider
;
370 /** Constant <code>EMPTY_SELECTION</code> */
371 public static ISelection EMPTY_SELECTION
= new ISelection() {
373 public boolean isEmpty() {
384 private class SelectionMouseHandler
extends MouseAdapter
{
386 public void mouseDown(MouseEvent e
) {
387 notifySelectionListeners(e
);
397 private class SelectionFocusHandler
extends FocusAdapter
{
399 public void focusGained(FocusEvent e
) {
400 notifySelectionListeners(e
);
404 private void notifySelectionListeners(TypedEvent e
) {
405 Event event
= new Event();
406 event
.widget
= e
.widget
;
407 SelectionEvent selectionEvent
= new SelectionEvent(event
);
409 for (SelectionListener listener
: selectionListenerList
) {
410 listener
.widgetSelected(selectionEvent
);
414 public CdmFormFactory(Display display
) {
418 public CdmFormFactory(Display display
, ISelectionProvider selectionProvider
) {
420 this.selectionProvider
= selectionProvider
;
424 private void init() {
425 boldFontHolder2
= new BoldFontHolder2();
426 selectionMouseHandler
= new SelectionMouseHandler();
427 selectionFocusHandler
= new SelectionFocusHandler();
430 public IEclipseContext
getContext() {
435 * Creates an instance initialized with the correct selectionProvider
437 * Make sure to remove the instance when the entityComposite disposes via
438 * destroySelectionArbitrator(..)
440 * @param entityElement
441 * a {@link eu.etaxonomy.taxeditor.ui.element.IEntityElement}
443 * @return a {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator}
446 public SelectionArbitrator
createSelectionArbitrator(IEntityElement entityElement
) {
447 SelectionArbitrator selectionArbitrator
= new SelectionArbitrator(entityElement
);
448 selectionArbitrator
.addSelectionProvider(selectionProvider
);
449 selectionProvider
.addSelectionChangedListener(selectionArbitrator
);
450 addSelectionListener(selectionArbitrator
);
451 return selectionArbitrator
;
456 * destroySelectionArbitrator
459 * @param selectionArbitrator
461 * {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator}
464 public void destroySelectionArbitrator(SelectionArbitrator selectionArbitrator
) {
465 removeSelectionListener(selectionArbitrator
);
466 if (selectionProvider
!= null) {
467 selectionProvider
.removeSelectionChangedListener(selectionArbitrator
);
469 MessagingUtils
.error(this.getClass(),
470 "Tried to destroy a selection listener from this factories listeners but was null", null);
476 * Adapts the {@link AbstractCdmFormElement}:<br>
477 * - sets the {@link IPropertyChangeListener}s handled by this class
482 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement}
485 public void adapt(ICdmFormElement formElement
) {
486 formElement
.setPropertyChangeListeners(propertyChangeListeners
);
491 public void adapt(Control control
, boolean trackFocus
, boolean trackKeyboard
) {
493 control
.addFocusListener(selectionFocusHandler
);
495 super.adapt(control
, trackFocus
, trackKeyboard
);
500 public void adapt(Composite composite
) {
501 composite
.addMouseListener(selectionMouseHandler
);
503 super.adapt(composite
);
512 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
515 public void destroyElement(ICdmFormElement formElement
) {
516 // return if element was not initialized
517 if (formElement
== null) {
520 // destroy selection arbitrator, if any
521 if (formElement
instanceof ISelectableElement
) {
522 destroySelectionArbitrator(((ISelectableElement
) formElement
).getSelectionArbitrator());
524 // remove this element form its parents list of elements
525 // ICdmFormElement parentElement = formElement.getParentElement();
526 // if(parentElement != null){
527 // parentElement.removeElement(formElement);
529 // call destroy on child elements recursively
530 for (ICdmFormElement childElement
: formElement
.getElements()) {
531 destroyElement(childElement
);
533 // dispose of the controls
534 for (Control control
: formElement
.getControls()) {
535 // we added the layoutComposite of the parental element as the
536 // layout composite to this formElement
537 // but we do not want to destroy it.
538 if (control
.equals(formElement
.getLayoutComposite())) {
541 if (control
!= null && !control
.isDisposed()){
555 * a {@link org.eclipse.swt.widgets.Composite} object.
556 * @return a {@link org.eclipse.swt.widgets.Label} object.
558 public Label
createEmptyCell(Composite parent
) {
559 return this.createLabel(parent
, null);
564 * createMultiLanguageTextElement
567 * @param parentElement
568 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
571 * a {@link java.lang.String} object.
572 * @param multilanguageText
573 * a {@link java.util.Map} object.
579 * {@link eu.etaxonomy.taxeditor.ui.element.MultilanguageTextElement}
582 public MultilanguageTextElement
createMultiLanguageTextElement(ICdmFormElement parentElement
, String labelString
,
583 Map
<Language
, LanguageString
> multilanguageText
, int textHeight
, int style
) {
584 MultilanguageTextElement element
= new MultilanguageTextElement(this, parentElement
, labelString
,
585 multilanguageText
, textHeight
, style
);
587 parentElement
.addElement(element
);
593 * createMultiLanguageTextElement
596 * @param parentElement
597 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
600 * @param Representation
601 * a {@link eu.etaxonomy.cdm.model.common.Representation} object.
607 * {@link eu.etaxonomy.taxeditor.ui.element.RepresentationElement}
610 public RepresentationElement
createRepresentationElement(ICdmFormElement parentElement
, Representation representation
, TermBase term
,int textHeight
, int style
, boolean fillDetails
) {
611 RepresentationElement element
= new RepresentationElement(this, parentElement
, representation
, term
, textHeight
, style
, fillDetails
);
613 parentElement
.addElement(element
);
619 * createMultiLanguageTextElement
622 * @param parentElement
623 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
626 * @param Representation
627 * a {@link eu.etaxonomy.cdm.model.common.Representation} object.
633 * {@link eu.etaxonomy.taxeditor.ui.element.RepresentationElement}
636 public TranslatableRepresentationElement
createTranslatableRepresentationElement(ICdmFormElement parentElement
, Representation representation
, TermBase term
,int textHeight
, int style
, boolean fillDetails
) {
637 TranslatableRepresentationElement element
= new TranslatableRepresentationElement(this, parentElement
, representation
, term
, textHeight
, style
, fillDetails
);
639 parentElement
.addElement(element
);
645 * createMultiLanguageTextElement
648 * @param parentElement
649 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
653 * a {@link eu.etaxonomy.cdm.model.common.Representation} object.
659 * {@link eu.etaxonomy.taxeditor.ui.element.RepresentationElement}
662 public RepresentationElement
createRepresentationElement(ICdmFormElement parentElement
, TermBase term
, int textHeight
, int style
, boolean fillDetails
) {
663 RepresentationElement element
= new RepresentationElement(this, parentElement
, term
, textHeight
, style
, fillDetails
);
665 parentElement
.addElement(element
);
671 * createMultiLanguageTextElement
674 * @param parentElement
675 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
679 * a {@link eu.etaxonomy.cdm.model.common.Representation} object.
685 * {@link eu.etaxonomy.taxeditor.ui.element.RepresentationElement}
688 public TranslatableRepresentationElement
createTranslatableRepresentationElement(ICdmFormElement parentElement
, TermBase term
, int textHeight
, int style
, boolean fillDetails
) {
689 TranslatableRepresentationElement element
= new TranslatableRepresentationElement(this, parentElement
, term
, textHeight
, style
, fillDetails
);
691 parentElement
.addElement(element
);
695 public KeyStatementElement
createKeyStatementElement(ICdmFormElement parentElement
, String labelString
,
696 KeyStatement keyStatement
, int textHeight
, int style
) {
697 KeyStatementElement element
= new KeyStatementElement(this, parentElement
, labelString
, keyStatement
,
700 parentElement
.addElement(element
);
705 * Creates a text field with a label. The initial content will be the return value of the initalObject's {@link #toString()}
707 * <b>Note</b>: if initialObject is <code>null</code> then an empty string is used.
708 * @param parentElement the parent container
709 * @param labelString the label name
710 * @param initialObject the object from which the <code>toString()</code> method is called
711 * @param style {@link SWT} style constant
712 * @return the created textfield with label
714 public TextWithLabelElement
createTextWithLabelElement(ICdmFormElement parentElement
, String labelString
,
715 Object initialObject
, int style
) {
716 return createTextWithLabelElement(parentElement
, labelString
, initialObject
==null?
"":initialObject
.toString(), style
);
721 * createTextWithLabelElement
724 * @param parentElement
725 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
728 * a {@link java.lang.String} object.
730 * a {@link java.lang.String} object.
733 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
736 public TextWithLabelElement
createTextWithLabelElement(ICdmFormElement parentElement
, String labelString
,
737 String initialText
, int style
) {
738 return createTextWithLabelElement(parentElement
, labelString
, initialText
, null, style
);
742 * createTextWithLabelElement
745 * @param parentElement
746 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
749 * a {@link java.lang.String} object.
751 * a {@link java.lang.String} object.
752 * @param textLimit maximal number of characters allowed
755 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
758 public TextWithLabelElement
createTextWithLabelElement(ICdmFormElement parentElement
, String labelString
,
759 String initialText
, Integer textLimit
, int style
) {
760 if(initialText
==null){
764 TextWithLabelElement element
= new TextWithLabelElement(this, parentElement
, labelString
, initialText
, null,
767 parentElement
.addElement(element
);
771 public TextWithLabelElement
createMultiLineTextWithLabel(ICdmFormElement parentElement
, String labelString
,
772 int textHeight
, int style
) {
773 TextWithLabelElement element
= new TextWithLabelElement(this, parentElement
, labelString
, "", textHeight
, true, style
);
775 parentElement
.addElement(element
);
779 public LsidWithExceptionLabelElement
createLsidWithExceptionLabelElement(ICdmFormElement parentElement
, String labelString
,
780 LSID initialLsid
, int style
) {
781 LsidWithExceptionLabelElement element
= new LsidWithExceptionLabelElement(this, parentElement
, labelString
, initialLsid
, null, style
);
783 parentElement
.addElement(element
);
787 public UriWithLabelElement
createUriWithLabelElement(ICdmFormElement parentElement
, String labelString
,
788 URI initialUri
, int style
) {
789 UriWithLabelElement element
= new UriWithLabelElement(this, parentElement
, labelString
, initialUri
, null, style
);
791 parentElement
.addElement(element
);
802 public OpenUrlSelectorElement
createOpenUrlSelectorElement(ICdmFormElement parentElement
, String labelString
,
803 IOpenUrlEnabled openUrlEnabled
, int style
) {
804 OpenUrlSelectorElement element
= new OpenUrlSelectorElement(this, parentElement
, labelString
, openUrlEnabled
,
807 parentElement
.addElement(element
);
813 * @param parentElement
815 * @param conversationEnabled
820 public EditPasswordElement
createEditPasswordElement(ICdmFormElement parentElement
, String labelString
,
821 ConversationHolder conversation
, User user
, int style
) {
822 EditPasswordElement element
= new EditPasswordElement(this, parentElement
, labelString
, user
, conversation
);
824 parentElement
.addElement(element
);
830 * createIntegerTextWithLabelElement
833 * @param parentElement
834 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
837 * a {@link java.lang.String} object.
838 * @param initialInteger
839 * a {@link java.lang.Integer} object.
843 * {@link eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement}
846 public NumberWithLabelElement
createNumberTextWithLabelElement(
847 ICdmFormElement parentElement
, String labelString
,
848 Number initialNumber
, int style
) {
849 NumberWithLabelElement element
= new NumberWithLabelElement(this,
850 parentElement
, labelString
, initialNumber
, style
);
852 parentElement
.addElement(element
);
856 public LanguageStringWithLabelElement
createLanguageStringWithLabelElement(ICdmFormElement parentElement
,
857 String labelString
, LanguageString languageString
, int style
) {
858 return createLanguageStringWithLabelElement(parentElement
, labelString
, languageString
, null, false, style
);
861 public LanguageStringWithLabelElement
createLanguageStringWithLabelElement(ICdmFormElement parentElement
,
862 String labelString
, LanguageString languageString
, Integer height
, boolean isMultiLine
, int style
) {
863 LanguageStringWithLabelElement element
= new LanguageStringWithLabelElement(this, parentElement
, labelString
,
864 languageString
, height
, isMultiLine
, style
);
866 parentElement
.addElement(element
);
872 * createKeyValueViewerElement
875 * @param parentElement
876 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
879 * a {@link java.lang.String} object.
880 * @param valueHeading
881 * a {@link java.lang.String} object.
883 * a {@link java.util.Map} object.
884 * @return a {@link eu.etaxonomy.taxeditor.ui.element.KeyValueViewerElement}
887 public KeyValueViewerElement
createKeyValueViewerElement(ICdmFormElement parentElement
, String keyHeading
,
888 String valueHeading
, Map
<Object
, Object
> map
) {
889 KeyValueViewerElement element
= new KeyValueViewerElement(this, parentElement
, keyHeading
, valueHeading
, map
);
891 parentElement
.addElement(element
);
895 * @deprecated Use {@link #createDefinedTermComboElement(TermType, ICdmFormElement, String, DefinedTermBase, int)} instead
898 public <T
extends DefinedTermBase
> TermComboElement
<T
> createTermComboElement(Class
<T
> termComboType
,
899 ICdmFormElement parentElement
, String labelString
, T selection
, int style
) {
900 TermComboElement
<T
> element
= new TermComboElement
<T
>(this, parentElement
, termComboType
, labelString
, selection
, true, style
);
902 parentElement
.addElement(element
);
906 public <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
908 ICdmFormElement parentElement
,
912 Comparator
<T
> comparator
) {
913 return this.createDefinedTermComboElement(termType
, null, parentElement
, labelString
, selection
, true, style
, false, comparator
);
916 public <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
918 ICdmFormElement parentElement
,
921 boolean addEmptyElement
,
923 return this.createDefinedTermComboElement(termType
, null, parentElement
, labelString
, selection
, addEmptyElement
, style
, false, null);
926 public <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
928 ICdmFormElement parentElement
,
932 return this.createDefinedTermComboElement(termType
, null, parentElement
, labelString
, selection
, true, style
, false, null);
934 public <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
936 ICdmFormElement parentElement
,
939 boolean addEmptyElement
,
941 boolean useAbbrevLabel
) {
942 return createDefinedTermComboElement(termType
, null, parentElement
, labelString
, selection
, addEmptyElement
, style
, useAbbrevLabel
, null);
946 public <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
947 TermVocabulary
<?
> termVocabulary
,
948 ICdmFormElement parentElement
,
952 return this.createDefinedTermComboElement(null, termVocabulary
, parentElement
, labelString
, selection
, true, style
, false, null);
955 public <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
956 TermVocabulary
<?
> termVocabulary
,
957 ICdmFormElement parentElement
,
960 boolean addEmptyElement
,
962 boolean useAbbrevLabel
) {
963 return createDefinedTermComboElement(null, termVocabulary
, parentElement
, labelString
, selection
, addEmptyElement
, style
, useAbbrevLabel
, null);
966 private <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
968 TermVocabulary
<?
> termVocabulary
,
969 ICdmFormElement parentElement
,
972 boolean addEmptyElement
,
974 boolean useAbbrevLabel
,
975 Comparator
<T
> comparator
) {
977 TermComboElement
<T
> element
= new TermComboElement
<T
>(this, parentElement
, termType
, labelString
, selection
, addEmptyElement
, style
, useAbbrevLabel
, comparator
);
979 parentElement
.addElement(element
);
982 else if(termVocabulary
!=null){
983 TermComboElement
<T
> element
= new TermComboElement
<T
>(this, parentElement
, termVocabulary
, labelString
, selection
, addEmptyElement
, style
, useAbbrevLabel
, comparator
);
984 if (comparator
!= null){
985 element
.setTermComparator(comparator
);
988 parentElement
.addElement(element
);
992 //this should never happen
997 public <T
extends IEnumTerm
<T
>> EnumComboElement
<T
> createEnumComboElement(
998 Class
<T
> enumComboType
, ICdmFormElement parentElement
,
1000 return createEnumComboElement(enumComboType
, parentElement
, null, style
);
1003 public <T
extends IEnumTerm
<T
>> EnumComboElement
<T
> createEnumComboElement(
1004 Class
<T
> enumComboType
, ICdmFormElement parentElement
, Comparator
<T
> comparator
,
1006 EnumComboElement
<T
> element
= new EnumComboElement
<T
>(this, parentElement
, enumComboType
, comparator
, style
);
1008 parentElement
.addElement(element
);
1012 public <TERM
extends DefinedTermBase
<TERM
>, VOC
extends TermVocabulary
<TERM
>> VocabularyComboElement
<TERM
, VOC
> createVocabularyComboElement(
1013 TermType termType
, String label
, VOC selection
, ICdmFormElement parentElement
, int style
) {
1014 VocabularyComboElement
<TERM
, VOC
> element
= new VocabularyComboElement
<TERM
, VOC
>(this, parentElement
, termType
, label
, selection
, style
);
1016 parentElement
.addElement(element
);
1022 * createBrowserElement
1026 * a {@link java.net.URI} object.
1029 * @param parentElement
1030 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1032 * @return a {@link eu.etaxonomy.taxeditor.ui.element.BrowserElement}
1035 public BrowserElement
createBrowserElement(ICdmFormElement parentElement
, URI imageUri
, int style
) {
1036 BrowserElement element
= new BrowserElement(this, parentElement
, imageUri
, style
);
1038 parentElement
.addElement(element
);
1044 * createImageElement
1047 * @param parentElement
1048 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1051 * a {@link java.net.URI} object.
1054 * @return a {@link eu.etaxonomy.taxeditor.ui.element.ImageElement} object.
1056 public ImageElement
createImageElement(ICdmFormElement parentElement
, URI imageUri
, int style
) {
1057 ImageElement element
= new ImageElement(this, parentElement
, imageUri
, style
);
1059 parentElement
.addElement(element
);
1065 * createTextActionElement
1068 * @param labelString
1069 * a {@link java.lang.String} object.
1070 * @param initialText
1071 * a {@link java.lang.String} object.
1074 * @param parentElement
1075 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1077 * @param buttonLabel
1078 * a {@link java.lang.String} object.
1079 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextActionElement}
1082 public TextActionElement
createTextActionElement(ICdmFormElement parentElement
, String labelString
,
1083 String buttonLabel
, String initialText
, int style
) {
1084 TextActionElement element
= new TextActionElement(this, parentElement
, labelString
, buttonLabel
, initialText
,
1087 parentElement
.addElement(element
);
1096 * @param parentElement
1097 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1100 * a {@link java.lang.String} object.
1101 * @param initialState
1105 * @return a {@link eu.etaxonomy.taxeditor.ui.element.CheckboxElement}
1108 public CheckboxElement
createCheckbox(ICdmFormElement parentElement
, String label
, Boolean initialState
, int style
) {
1109 if(initialState
==null){
1110 initialState
= Boolean
.FALSE
;
1112 CheckboxElement element
= new CheckboxElement(this, parentElement
, label
, initialState
, style
| orientation
);
1114 parentElement
.addElement(element
);
1119 * Creates a section as a part of the form.
1121 * @return the section widget
1124 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
1127 public Section
adapt(AbstractFormSection section
) {
1128 section
.setMenu(section
.getLayoutComposite().getMenu());
1129 adapt(section
, true, true);
1131 // handle focus and property change events for cdm use
1132 section
.addFocusListener(selectionFocusHandler
);
1133 section
.setPropertyChangeListeners(propertyChangeListeners
);
1135 if (section
.getToggle() != null) {
1136 section
.getToggle().setHoverDecorationColor(getColors().getColor(IFormColors
.TB_TOGGLE_HOVER
));
1137 section
.getToggle().setDecorationColor(getColors().getColor(IFormColors
.TB_TOGGLE
));
1140 section
.setFont(boldFontHolder2
.getBoldFont(section
.getLayoutComposite().getFont()));
1142 if ((section
.getStyle() & ExpandableComposite
.TITLE_BAR
) != 0
1143 || (section
.getStyle() & ExpandableComposite
.SHORT_TITLE_BAR
) != 0) {
1144 getColors().initializeSectionToolBarColors();
1145 section
.setTitleBarBackground(getColors().getColor(IFormColors
.TB_BG
));
1146 section
.setTitleBarBorderColor(getColors().getColor(IFormColors
.TB_BORDER
));
1148 // call setTitleBarForeground regardless as it also sets the label color
1149 section
.setTitleBarForeground(getColors().getColor(IFormColors
.TB_TOGGLE
));
1153 private class BoldFontHolder2
{
1154 private Font normalFont
;
1156 private Font boldFont
;
1158 public BoldFontHolder2() {
1161 public Font
getBoldFont(Font font
) {
1162 createBoldFont(font
);
1166 private void createBoldFont(Font font
) {
1167 if (normalFont
== null || !normalFont
.equals(font
)) {
1171 if (boldFont
== null) {
1172 boldFont
= FormFonts
.getInstance().getBoldFont(getColors().getDisplay(), normalFont
);
1176 public void dispose() {
1177 if (boldFont
!= null) {
1178 FormFonts
.getInstance().markFinished(boldFont
, getColors().getDisplay());
1186 * createToggleableTextField
1189 * @param parentElement
1190 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1192 * @param labelString
1193 * a {@link java.lang.String} object.
1194 * @param initialText
1195 * a {@link java.lang.String} object.
1196 * @param initialState
1200 * @return a {@link eu.etaxonomy.taxeditor.ui.element.ToggleableTextElement}
1203 public ToggleableTextElement
createToggleableTextField(ICdmFormElement parentElement
, String labelString
,
1204 String initialText
, boolean initialState
, int style
) {
1205 ToggleableTextElement element
= new ToggleableTextElement(this, parentElement
, labelString
, initialText
,
1206 initialState
, style
| orientation
);
1208 parentElement
.addElement(element
);
1214 * createTimePeriodElement
1217 * @param parentElement
1218 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1220 * @param labelString
1221 * a {@link java.lang.String} object.
1223 * a {@link eu.etaxonomy.cdm.model.common.TimePeriod} object.
1226 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TimePeriodElement}
1229 public TimePeriodElement
createTimePeriodElement(ICdmFormElement parentElement
, String labelString
,
1230 TimePeriod timePeriod
, int style
) {
1231 TimePeriodElement element
= new TimePeriodElement(this, parentElement
, labelString
, timePeriod
, style
);
1233 parentElement
.addElement(element
);
1239 * createGatheringEventUnitElement
1242 * @param parentElement
1243 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1245 * @param labelString
1246 * a {@link java.lang.String} object.
1248 * a {@link eu.etaxonomy.cdm.model.common.GatheringEvent} object.
1251 * @return a {@link eu.etaxonomy.taxeditor.ui.element.GatheringEventUnitElement}
1254 public GatheringEventUnitElement
createGatheringEventUnitElement(
1255 ICdmFormElement parentElement
,
1257 DerivedUnitFacade gatheringEvent
,
1258 MinMaxTextSection
.UnitType unitType
,
1260 GatheringEventUnitElement element
= new GatheringEventUnitElement(this,
1267 parentElement
.addElement(element
);
1273 * createPointElement
1278 * @param parentElement
1279 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1282 * a {@link eu.etaxonomy.cdm.model.location.Point} object.
1283 * @return a {@link eu.etaxonomy.taxeditor.ui.element.PointElement} object.
1285 public PointElement
createPointElement(ICdmFormElement parentElement
, Point point
, int style
) {
1286 PointElement element
= new PointElement(this, parentElement
, point
, style
);
1288 parentElement
.addElement(element
);
1295 * @param conversationHolder
1297 * @param detailsViewer
1301 public EmptySection
createEmptySection(CdmFormFactory formFactory
, ICdmFormElement parentElement
, int style
) {
1302 EmptySection section
= new EmptySection(formFactory
, parentElement
, style
);
1303 parentElement
.addElement(section
);
1310 * createDateDetailSection
1313 * @param parentElement
1314 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1318 * @return a {@link eu.etaxonomy.taxeditor.ui.element.DateDetailSection}
1321 public DateDetailSection
createDateDetailSection(ICdmFormElement parentElement
, int style
) {
1322 DateDetailSection section
= new DateDetailSection(this, parentElement
, style
);
1323 parentElement
.addElement(section
);
1330 * createDateDetailSection
1333 * @param parentElement
1334 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1338 * @return a {@link eu.etaxonomy.taxeditor.ui.element.MinMaxTextSection}
1341 public MinMaxTextSection
createMinMaxTextSection(ICdmFormElement parentElement
, UnitType unitType
, int style
) {
1342 MinMaxTextSection section
= new MinMaxTextSection(this, parentElement
, unitType
, style
);
1343 parentElement
.addElement(section
);
1350 * createPartialElement
1353 * @param parentElement
1354 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1356 * @param labelString
1357 * a {@link java.lang.String} object.
1359 * a {@link org.joda.time.Partial} object.
1362 * @return a {@link eu.etaxonomy.taxeditor.ui.element.PartialElement}
1365 public PartialElement
createPartialElement(ICdmFormElement parentElement
, String labelString
, Partial partial
,
1367 PartialElement element
= new PartialElement(this, parentElement
, labelString
, style
);
1369 parentElement
.addElement(element
);
1375 * addSelectionListener
1379 * a {@link org.eclipse.swt.events.SelectionListener} object.
1381 public void addSelectionListener(SelectionListener listener
) {
1382 selectionListenerList
.add(listener
);
1387 * removeSelectionListener
1391 * a {@link org.eclipse.swt.events.SelectionListener} object.
1393 public void removeSelectionListener(SelectionListener listener
) {
1394 if (listener
== null) {
1395 MessagingUtils
.error(this.getClass(),
1396 "Tried to remove a selection listener from this factories listeners but was null", null);
1398 selectionListenerList
.remove(listener
);
1404 * addPropertyChangeListener
1408 * a {@link org.eclipse.jface.util.IPropertyChangeListener}
1411 public void addPropertyChangeListener(IPropertyChangeListener listener
) {
1412 if (propertyChangeListeners
.contains(listener
)) {
1415 propertyChangeListeners
.add(0, listener
);
1420 * removePropertyChangeListener
1424 * a {@link org.eclipse.jface.util.IPropertyChangeListener}
1427 public void removePropertyChangeListener(IPropertyChangeListener listener
) {
1428 propertyChangeListeners
.remove(listener
);
1432 * @return the propertyChangeListeners
1434 public List
<IPropertyChangeListener
> getPropertyChangeListeners() {
1435 return propertyChangeListeners
;
1440 * createHorizontalSeparator
1443 * @param parentElement
1444 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1448 * @return a {@link org.eclipse.swt.widgets.Label} object.
1450 public Label
createHorizontalSeparator(ICdmFormElement parentElement
, int style
) {
1451 Label separator
= this.createSeparator(parentElement
.getLayoutComposite(), SWT
.HORIZONTAL
| style
);
1452 separator
.setLayoutData(LayoutConstants
.FILL_HORIZONTALLY());
1458 * createVersionElement
1461 * @param parentElement
1462 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1465 * a {@link eu.etaxonomy.cdm.model.common.VersionableEntity}
1470 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.VersionElement}
1473 public VersionElement
createVersionElement(ICdmFormElement parentElement
, VersionableEntity entity
, int style
) {
1474 VersionElement element
= new VersionElement(this, parentElement
, entity
, style
);
1476 parentElement
.addElement(element
);
1481 * @param cdmBaseSection
1486 public CdmBaseElement
createCdmBaseElement(ICdmFormElement parentElement
, CdmBase entity
, int style
) {
1487 CdmBaseElement element
= new CdmBaseElement(this, parentElement
, entity
, style
);
1489 parentElement
.addElement(element
);
1495 * createVersionSection
1498 * @param parentElement
1499 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1504 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.VersionSection}
1507 public VersionSection
createVersionSection(ICdmFormElement parentElement
, int style
) {
1508 VersionSection section
= new VersionSection(this, parentElement
, style
);
1509 parentElement
.addElement(section
);
1519 public CdmBaseSection
createCdmBaseSection(ICdmFormElement parentElement
, int style
) {
1520 CdmBaseSection section
= new CdmBaseSection(this, parentElement
, style
);
1521 parentElement
.addElement(section
);
1528 * createEmptyElement
1531 * @param parentElement
1532 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1534 * @return a {@link eu.etaxonomy.taxeditor.ui.section.EmptyElement} object.
1536 public EmptyElement
createEmptyElement(ICdmFormElement parentElement
, String emptyText
) {
1537 EmptyElement element
= new EmptyElement(this, parentElement
, emptyText
, SWT
.NULL
);
1539 parentElement
.addElement(element
);
1545 * createHeadlineSection
1548 * @param parentElement
1549 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1552 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.HeadlineSection}
1555 public HeadlineSection
createHeadlineSection(ICdmFormElement parentElement
) {
1556 HeadlineSection section
= new HeadlineSection(this, parentElement
, SWT
.NULL
);
1557 parentElement
.addElement(section
);
1564 * createParsingMessageElement
1567 * @param parentElement
1568 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1570 * @param parserProblem
1571 * a {@link eu.etaxonomy.cdm.strategy.parser.ParserProblem}
1576 * {@link eu.etaxonomy.taxeditor.ui.section.taxon.ParsingMessageElement}
1579 public ParsingMessageElement
createParsingMessageElement(ICdmFormElement parentElement
,
1580 ParserProblem parserProblem
, int style
) {
1581 ParsingMessageElement element
= new ParsingMessageElement(this, parentElement
, parserProblem
, style
);
1583 parentElement
.addElement(element
);
1587 public AbstractFormSection
createDefinedTermDetailSection(Class definedTermClass
, ConversationHolder conversation
,
1588 ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
1590 AbstractFormSection section
= new DefinedTermDetailSection(this, definedTermClass
, conversation
, parentElement
,
1591 selectionProvider
, style
);
1593 parentElement
.addElement(section
);
1600 * @param definedTermClass
1601 * @param formElement
1605 public AbstractCdmDetailElement
createDefinedTermDetailElement(Class definedTermClass
,
1606 AbstractCdmDetailSection parentElement
, int style
) {
1607 AbstractCdmDetailElement element
= null;
1609 if (NamedArea
.class.isAssignableFrom(definedTermClass
)) {
1610 element
= new eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement(this, parentElement
);
1611 } else if (definedTermClass
.equals(Feature
.class)) {
1612 element
= new FeatureDetailElement(this, parentElement
);
1613 } else if(definedTermClass
.equals(PresenceAbsenceTerm
.class)){
1614 element
= new PresenceAbsenceTermDetailElement(this, parentElement
);
1616 element
= new DefinedTermDetailElement(this, parentElement
);
1621 parentElement
.addElement(element
);
1626 //--------DetailSections---------
1627 public NameDetailSection
createNameDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1628 NameDetailSection section
= new NameDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1629 addAndAdaptSection(parentElement
, section
);
1633 public ReferenceDetailSection
createReferenceDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1634 ReferenceDetailSection section
= new ReferenceDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1635 addAndAdaptSection(parentElement
, section
);
1639 public NomenclaturalReferenceDetailSection
createNomenclaturalReferenceDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1640 NomenclaturalReferenceDetailSection section
= new NomenclaturalReferenceDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1641 addAndAdaptSection(parentElement
, section
);
1645 public TaxonBaseDetailSection
createTaxonBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1646 TaxonBaseDetailSection section
= new TaxonBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1647 addAndAdaptSection(parentElement
, section
);
1651 public AuthorshipDetailSection
createAuthorshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1652 AuthorshipDetailSection section
= new AuthorshipDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1653 addAndAdaptSection(parentElement
, section
);
1657 public TeamOrPersonBaseDetailSection
createTeamOrPersonBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1658 TeamOrPersonBaseDetailSection section
= new TeamOrPersonBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1659 addAndAdaptSection(parentElement
, section
);
1663 public TeamDetailSection
createTeamDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1664 TeamDetailSection section
= new TeamDetailSection(this, conversation
, parentElement
, null, style
);
1665 addAndAdaptSection(parentElement
, section
);
1669 public PersonDetailSection
createPersonDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1670 PersonDetailSection section
= new PersonDetailSection(this, conversation
, parentElement
, null, style
);
1671 addAndAdaptSection(parentElement
, section
);
1675 public DescriptionDetailSection
createDescriptionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1676 DescriptionDetailSection section
= new DescriptionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1677 addAndAdaptSection(parentElement
, section
);
1681 public DescriptionElementDetailSection
createDescriptionElementDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1682 DescriptionElementDetailSection section
= new DescriptionElementDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1683 addAndAdaptSection(parentElement
, section
);
1687 public ParsingMessagesSection
createParsingMessagesSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1688 ParsingMessagesSection section
= new ParsingMessagesSection(this, conversation
, parentElement
, selectionProvider
, style
);
1689 addAndAdaptSection(parentElement
, section
);
1695 public NonViralNameDetailSection
createNonViralNameDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, boolean nameChoosable
, int style
){
1696 NonViralNameDetailSection section
= new NonViralNameDetailSection(this, conversation
, parentElement
, selectionProvider
, nameChoosable
, style
);
1697 addAndAdaptSection(parentElement
, section
);
1701 public MediaDetailsSection
createMediaDetailsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1702 MediaDetailsSection section
= new MediaDetailsSection(this, conversation
, parentElement
, selectionProvider
, style
);
1703 addAndAdaptSection(parentElement
, section
);
1707 public FieldUnitDetailSection
createFieldUnitDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1708 FieldUnitDetailSection section
= new FieldUnitDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1709 addAndAdaptSection(parentElement
, section
);
1713 public GatheringEventDetailSection
createGatheringEventDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1714 GatheringEventDetailSection section
= new GatheringEventDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1715 addAndAdaptSection(parentElement
, section
);
1719 public SpecimenHierarchyDetailSection
createSpecimenHierarchyDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1720 SpecimenHierarchyDetailSection section
= new SpecimenHierarchyDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1721 addAndAdaptSection(parentElement
, section
);
1725 public DerivedUnitBaseDetailSection
createDerivedUnitBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1726 DerivedUnitBaseDetailSection section
= new DerivedUnitBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1727 addAndAdaptSection(parentElement
, section
);
1731 public DerivedUnitTypeDesignationSection
createDerivedUnitTypeDesignationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1732 DerivedUnitTypeDesignationSection section
= new DerivedUnitTypeDesignationSection(this, conversation
, parentElement
, style
);
1733 addAndAdaptSection(parentElement
, section
);
1737 public TaxonAssociationDetailSection
createTaxonAssociationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1738 TaxonAssociationDetailSection section
= new TaxonAssociationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1739 addAndAdaptSection(parentElement
, section
);
1743 public OriginalLabelDataSection
createOriginalLabelDataSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1744 OriginalLabelDataSection section
= new OriginalLabelDataSection(this, conversation
, parentElement
, selectionProvider
, style
);
1745 addAndAdaptSection(parentElement
, section
);
1749 public NaturalLanguageSection
createNaturalLanguageSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1750 NaturalLanguageSection section
= new NaturalLanguageSection(this, conversation
, parentElement
, selectionProvider
, style
);
1751 addAndAdaptSection(parentElement
, section
);
1755 public FeatureDistributionDetailSection
createFeatureDistributionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1756 FeatureDistributionDetailSection section
= new FeatureDistributionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1757 addAndAdaptSection(parentElement
, section
);
1761 public ClassificationDetailSection
createClassificationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1762 ClassificationDetailSection section
= new ClassificationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1763 addAndAdaptSection(parentElement
, section
);
1767 public TaxonNodeDetailSection
createTaxonNodeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1768 TaxonNodeDetailSection section
= new TaxonNodeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1769 addAndAdaptSection(parentElement
, section
);
1773 public PolytomousKeyDetailSection
createPolytomousKeyDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1774 PolytomousKeyDetailSection section
= new PolytomousKeyDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1775 addAndAdaptSection(parentElement
, section
);
1779 public PolytomousKeyNodeDetailSection
createPolytomousKeyNodeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1780 PolytomousKeyNodeDetailSection section
= new PolytomousKeyNodeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1781 addAndAdaptSection(parentElement
, section
);
1785 public InstitutionDetailSection
createInstitutionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1786 InstitutionDetailSection section
= new InstitutionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1787 addAndAdaptSection(parentElement
, section
);
1791 public FieldUnitGeneralDetailSection
createFieldUnitGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1792 FieldUnitGeneralDetailSection section
= new FieldUnitGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1793 addAndAdaptSection(parentElement
, section
);
1797 public DerivedUnitGeneralDetailSection
createDerivedUnitGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1798 DerivedUnitGeneralDetailSection section
= new DerivedUnitGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1799 addAndAdaptSection(parentElement
, section
);
1803 public PreservedSpecimenGeneralDetailSection
createPreservedSpecimenGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1804 PreservedSpecimenGeneralDetailSection section
= new PreservedSpecimenGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1805 addAndAdaptSection(parentElement
, section
);
1809 public TissueSampleGeneralDetailSection
createTissueSampleGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1810 TissueSampleGeneralDetailSection section
= new TissueSampleGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1811 addAndAdaptSection(parentElement
, section
);
1815 public DnaSampleGeneralDetailSection
createDnaSampleGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1816 DnaSampleGeneralDetailSection section
= new DnaSampleGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1817 addAndAdaptSection(parentElement
, section
);
1821 public DnaSamplePreparationPreservationSection
createDnaSamplePreparationPreservationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1822 DnaSamplePreparationPreservationSection section
= new DnaSamplePreparationPreservationSection(this, conversation
, parentElement
, selectionProvider
, style
);
1823 addAndAdaptSection(parentElement
, section
);
1827 public DnaQualityDetailSection
createDnaQualityDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1828 DnaQualityDetailSection section
= new DnaQualityDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1829 addAndAdaptSection(parentElement
, section
);
1833 public SequenceGeneralDetailSection
createSequenceGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1834 SequenceGeneralDetailSection section
= new SequenceGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1835 addAndAdaptSection(parentElement
, section
);
1839 public SequenceContigFileCollectionDetailSection
createSequenceContigFileCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1840 SequenceContigFileCollectionDetailSection section
= new SequenceContigFileCollectionDetailSection(this, conversation
, parentElement
, style
);
1841 addAndAdaptSection(parentElement
, section
);
1845 public SingleReadPherogramCollectionDetailSection
createSingleReadPherogramCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1846 SingleReadPherogramCollectionDetailSection section
= new SingleReadPherogramCollectionDetailSection(this, conversation
, parentElement
, style
);
1847 addAndAdaptSection(parentElement
, section
);
1851 public SequenceReferenceCollectionDetailSection
createSequenceReferenceCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1852 SequenceReferenceCollectionDetailSection section
= new SequenceReferenceCollectionDetailSection(this, conversation
, parentElement
, style
);
1853 addAndAdaptSection(parentElement
, section
);
1857 public SingleReadGeneralDetailSection
createSingleReadGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1858 SingleReadGeneralDetailSection section
= new SingleReadGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1859 addAndAdaptSection(parentElement
, section
);
1863 public AmplificationGeneralDetailSection
createAmplificationGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1864 AmplificationGeneralDetailSection section
= new AmplificationGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1865 addAndAdaptSection(parentElement
, section
);
1869 public AmplificationPrimerDetailSection
createAmplificationPrimerDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1870 AmplificationPrimerDetailSection section
= new AmplificationPrimerDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1871 addAndAdaptSection(parentElement
, section
);
1875 public AmplificationCloningDetailSection
createAmplificationCloningDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1876 AmplificationCloningDetailSection section
= new AmplificationCloningDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1877 addAndAdaptSection(parentElement
, section
);
1881 public AmplificationGelPhotoCollectionDetailSection
createAmplificationGelPhotoCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1882 AmplificationGelPhotoCollectionDetailSection section
= new AmplificationGelPhotoCollectionDetailSection(this, conversation
, parentElement
, style
);
1883 addAndAdaptSection(parentElement
, section
);
1887 public MediaSpecimenGeneralDetailSection
createMediaSpecimenGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1888 MediaSpecimenGeneralDetailSection section
= new MediaSpecimenGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1889 addAndAdaptSection(parentElement
, section
);
1893 public HybridDetailSection
createHybridDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1894 HybridDetailSection section
= new HybridDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1895 addAndAdaptSection(parentElement
, section
);
1899 public UserDetailSection
createUserDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1900 UserDetailSection section
= new UserDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1901 addAndAdaptSection(parentElement
, section
);
1905 public GroupDetailSection
createGroupDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1906 GroupDetailSection section
= new GroupDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1907 addAndAdaptSection(parentElement
, section
);
1911 public DeterminationDetailSection
createDeterminationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1912 DeterminationDetailSection section
= new DeterminationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1913 addAndAdaptSection(parentElement
, section
);
1917 public SampleDesignationDetailSection
createSampleDesignationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1918 SampleDesignationDetailSection section
= new SampleDesignationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1919 addAndAdaptSection(parentElement
, section
);
1923 public TaxonRelationshipDetailSection
createTaxonRelationshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1924 TaxonRelationshipDetailSection section
= new TaxonRelationshipDetailSection(this, conversation
, parentElement
, selectionProvider
, style
, true);
1925 addAndAdaptSection(parentElement
, section
);
1929 public ReferencedEntityDetailSection
createReferencedEntityDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1930 ReferencedEntityDetailSection section
= new ReferencedEntityDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1931 addAndAdaptSection(parentElement
, section
);
1935 public TermVocabularyDetailSection
createTermVocabularyDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1936 TermVocabularyDetailSection section
= new TermVocabularyDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1937 addAndAdaptSection(parentElement
, section
);
1941 public GatheringEventDetailSection
createGatheringSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1942 GatheringEventDetailSection section
= new GatheringEventDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1943 addAndAdaptSection(parentElement
, section
);
1947 public NamedAreaDetailSection
createNamedAreaDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1948 NamedAreaDetailSection section
= new NamedAreaDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1949 addAndAdaptSection(parentElement
, section
);
1953 public UseRecordDetailSection
createUseRecordDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1954 UseRecordDetailSection section
= new UseRecordDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1955 addAndAdaptSection(parentElement
, section
);
1959 private void addAndAdaptSection(ICdmFormElement parentElement
, AbstractFormSection
<?
> section
) {
1960 parentElement
.addElement(section
);
1964 //--------DetailElements------------
1966 public UseRecordDetailElement
createUseRecordDetailElement(ICdmFormElement parentElement
){
1967 UseRecordDetailElement element
= new UseRecordDetailElement(this, parentElement
);
1968 addAndAdaptElement(parentElement
, element
);
1972 public DefinedTermDetailElement
<NamedAreaLevel
> createNamedAreaLevelElement(ICdmFormElement parentElement
){
1973 DefinedTermDetailElement
<NamedAreaLevel
> element
= new DefinedTermDetailElement
<NamedAreaLevel
>(this, parentElement
);
1974 addAndAdaptElement(parentElement
, element
);
1978 public eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement
createNamedAreaDetailElement(ICdmFormElement parentElement
){
1979 eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement element
= new eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement(this, parentElement
);
1980 addAndAdaptElement(parentElement
, element
);
1984 public TermVocabularyDetailElement
createTermVocabularyDetailElement(ICdmFormElement parentElement
){
1985 TermVocabularyDetailElement element
= new TermVocabularyDetailElement(this, parentElement
);
1986 addAndAdaptElement(parentElement
, element
);
1990 public ReferenceEntityDetailElement
createReferenceEntityDetailElement(ICdmFormElement parentElement
){
1991 ReferenceEntityDetailElement element
= new ReferenceEntityDetailElement(this, parentElement
);
1992 addAndAdaptElement(parentElement
, element
);
1996 public TaxonRelationshipDetailElement
createTaxonRelationshipDetailElement(ICdmFormElement parentElement
){
1997 TaxonRelationshipDetailElement element
= new TaxonRelationshipDetailElement(this, parentElement
);
1998 addAndAdaptElement(parentElement
, element
);
2002 public GrantedAuthorityDetailElement
createGrantedAuthorityDetailElement(ICdmFormElement parentElement
){
2003 GrantedAuthorityDetailElement element
= new GrantedAuthorityDetailElement(this, parentElement
);
2004 addAndAdaptElement(parentElement
, element
);
2008 public GroupDetailElement
createGroupDetailElement(ICdmFormElement parentElement
){
2009 GroupDetailElement element
= new GroupDetailElement(this, parentElement
);
2010 addAndAdaptElement(parentElement
, element
);
2014 public UserDetailElement
createUserDetailElement(ICdmFormElement parentElement
){
2015 UserDetailElement element
= new UserDetailElement(this, parentElement
);
2016 addAndAdaptElement(parentElement
, element
);
2020 public HybridDetailElement
createHybridDetailElement(ICdmFormElement parentElement
){
2021 HybridDetailElement element
= new HybridDetailElement(this, parentElement
);
2022 addAndAdaptElement(parentElement
, element
);
2026 public InstitutionDetailElement
createInstitutionDetailElement(ICdmFormElement parentElement
){
2027 InstitutionDetailElement element
= new InstitutionDetailElement(this, parentElement
);
2028 addAndAdaptElement(parentElement
, element
);
2032 public PolytomousKeyNodeDetailElement
createPolytomousKeyNodeDetailElement(ICdmFormElement parentElement
){
2033 PolytomousKeyNodeDetailElement element
= new PolytomousKeyNodeDetailElement(this, parentElement
);
2034 addAndAdaptElement(parentElement
, element
);
2038 public PolytomousKeyDetailElement
createPolytomousKeyDetailElement(ICdmFormElement parentElement
){
2039 PolytomousKeyDetailElement element
= new PolytomousKeyDetailElement(this, parentElement
);
2040 addAndAdaptElement(parentElement
, element
);
2044 public CollectionDetailElement
createCollectionDetailElement(ICdmFormElement parentElement
){
2045 CollectionDetailElement element
= new CollectionDetailElement(this, parentElement
);
2046 addAndAdaptElement(parentElement
, element
);
2050 public TaxonNodeAgentRelationCollectionSection
createTaxonNodeAgentRelationCollectionElement(ICdmFormElement parentElement
, ConversationHolder conversation
, int style
){
2051 TaxonNodeAgentRelationCollectionSection element
= new TaxonNodeAgentRelationCollectionSection(this, conversation
, parentElement
, style
);
2053 parentElement
.addElement(element
);
2058 public TaxonNodeDetailElement
createTaxonNodeDetailElement(ICdmFormElement parentElement
, boolean createNew
){
2059 TaxonNodeDetailElement element
= new TaxonNodeDetailElement(this, parentElement
, createNew
);
2060 addAndAdaptElement(parentElement
, element
);
2064 public ClassificationDetailElement
createClassificationDetailElement(ICdmFormElement parentElement
){
2065 ClassificationDetailElement element
= new ClassificationDetailElement(this, parentElement
);
2066 addAndAdaptElement(parentElement
, element
);
2070 public CloneClassificationDetailElement
createCloneClassificationDetailElement(ICdmFormElement parentElement
){
2071 CloneClassificationDetailElement element
= new CloneClassificationDetailElement(this, parentElement
);
2072 addAndAdaptElement(parentElement
, element
);
2076 public FeatureDistributionDetailElement
createFeatureDistributionDetailElement(ICdmFormElement parentElement
){
2077 FeatureDistributionDetailElement element
= new FeatureDistributionDetailElement(this, parentElement
);
2078 addAndAdaptElement(parentElement
, element
);
2082 public NaturalLanguageDetailElement
createNaturalLanguageDetailElement(ICdmFormElement parentElement
){
2083 NaturalLanguageDetailElement element
= new NaturalLanguageDetailElement(this, parentElement
);
2084 addAndAdaptElement(parentElement
, element
);
2088 public NonViralNameDetailElement
createNonViralNameDetailElement(ICdmFormElement parentElement
){
2089 NonViralNameDetailElement element
= new NonViralNameDetailElement(this, parentElement
);
2090 addAndAdaptElement(parentElement
, element
);
2094 public DescriptionElementDetailElement
createDescriptionElementDetailElement(ICdmFormElement parentElement
, int style
){
2095 DescriptionElementDetailElement element
= new DescriptionElementDetailElement(this, parentElement
, style
);
2096 addAndAdaptElement(parentElement
, element
);
2100 public DescriptionDetailElement
createDescriptionDetailElement(ICdmFormElement parentElement
, int style
){
2101 DescriptionDetailElement element
= new DescriptionDetailElement(this, parentElement
, style
);
2102 addAndAdaptElement(parentElement
, element
);
2106 public PersonDetailElement
createPersonDetailElement(ICdmFormElement parentElement
, int style
){
2107 PersonDetailElement element
= new PersonDetailElement(this, parentElement
, style
);
2108 addAndAdaptElement(parentElement
, element
);
2112 public TeamDetailElement
createTeamDetailElement(ICdmFormElement parentElement
, int style
, boolean isNomenclatural
){
2113 TeamDetailElement element
= new TeamDetailElement(this, parentElement
, style
, isNomenclatural
);
2114 addAndAdaptElement(parentElement
, element
);
2118 public AuthorshipDetailElement
createAuthorshipDetailElement(ICdmFormElement parentElement
, int style
){
2119 AuthorshipDetailElement element
= new AuthorshipDetailElement(this, parentElement
, style
);
2120 addAndAdaptElement(parentElement
, element
);
2124 public TaxonBaseDetailElement
createTaxonBaseDetailElement(ICdmFormElement parentElement
, int style
){
2125 TaxonBaseDetailElement element
= new TaxonBaseDetailElement(this, parentElement
, style
);
2126 addAndAdaptElement(parentElement
, element
);
2130 public NameDetailElement
createNameDetailElement(ICdmFormElement parentElement
, int style
){
2131 NameDetailElement element
= new NameDetailElement(this, parentElement
, style
);
2132 addAndAdaptElement(parentElement
, element
);
2136 public ReferenceDetailElement
createReferenceDetailElement(ICdmFormElement parentElement
, int style
, boolean isWizard
){
2137 ReferenceDetailElement element
= new ReferenceDetailElement(this, parentElement
, style
, isWizard
);
2138 addAndAdaptElement(parentElement
, element
);
2142 public NomenclaturalReferenceDetailElement
createNomenclaturalReferenceDetailElement(ICdmFormElement parentElement
, int style
){
2143 NomenclaturalReferenceDetailElement element
= new NomenclaturalReferenceDetailElement(this, parentElement
, style
);
2144 addAndAdaptElement(parentElement
, element
);
2149 public FieldUnitGeneralDetailElement
createFieldUnitGeneralDetailElement(ICdmFormElement parentElement
){
2150 FieldUnitGeneralDetailElement element
= new FieldUnitGeneralDetailElement(this, parentElement
);
2151 addAndAdaptElement(parentElement
, element
);
2155 public DerivedUnitGeneralDetailElement
createDerivedUnitGeneralDetailElement(ICdmFormElement parentElement
){
2156 DerivedUnitGeneralDetailElement element
= new DerivedUnitGeneralDetailElement(this, parentElement
);
2157 addAndAdaptElement(parentElement
, element
);
2161 public TaxonAssociationDetailElement
createTaxonAssociationDetailElement(ICdmFormElement parentElement
){
2162 TaxonAssociationDetailElement element
= new TaxonAssociationDetailElement(this, parentElement
);
2163 addAndAdaptElement(parentElement
, element
);
2167 public PreservedSpecimenGeneralDetailElement
createPreservedSpecimenGeneralDetailElement(ICdmFormElement parentElement
){
2168 PreservedSpecimenGeneralDetailElement element
= new PreservedSpecimenGeneralDetailElement(this, parentElement
);
2169 addAndAdaptElement(parentElement
, element
);
2173 public TissueSampleGeneralDetailElement
createTissueSampleGeneralDetailElement(ICdmFormElement parentElement
){
2174 TissueSampleGeneralDetailElement element
= new TissueSampleGeneralDetailElement(this, parentElement
);
2175 addAndAdaptElement(parentElement
, element
);
2179 public DnaSampleGeneralDetailElement
createDnaSampleGeneralDetailElement(ICdmFormElement parentElement
){
2180 DnaSampleGeneralDetailElement element
= new DnaSampleGeneralDetailElement(this, parentElement
);
2181 addAndAdaptElement(parentElement
, element
);
2185 public DnaSamplePreparationPreservationDetailElement
createDnaSamplePreparationPreservationDetailElement(ICdmFormElement parentElement
){
2186 DnaSamplePreparationPreservationDetailElement element
= new DnaSamplePreparationPreservationDetailElement(this, parentElement
);
2187 addAndAdaptElement(parentElement
, element
);
2191 public DnaQualityDetailElement
createDnaQualityDetailElement(ICdmFormElement parentElement
){
2192 DnaQualityDetailElement element
= new DnaQualityDetailElement(this, parentElement
);
2193 addAndAdaptElement(parentElement
, element
);
2197 public SequenceGeneralDetailElement
createSequenceGeneralDetailElement(ICdmFormElement parentElement
){
2198 SequenceGeneralDetailElement element
= new SequenceGeneralDetailElement(this, parentElement
);
2199 addAndAdaptElement(parentElement
, element
);
2203 public SingleReadGeneralDetailElement
createSingleReadGeneralDetailElement(ICdmFormElement parentElement
){
2204 SingleReadGeneralDetailElement element
= new SingleReadGeneralDetailElement(this, parentElement
);
2205 addAndAdaptElement(parentElement
, element
);
2209 public PrimerGeneralDetailElement
createPrimerGeneralDetailElement(ICdmFormElement parentElement
){
2210 PrimerGeneralDetailElement element
= new PrimerGeneralDetailElement(this, parentElement
);
2211 addAndAdaptElement(parentElement
, element
);
2215 public AmplificationGeneralDetailElement
createAmplificationGeneralDetailElement(ICdmFormElement parentElement
){
2216 AmplificationGeneralDetailElement element
= new AmplificationGeneralDetailElement(this, parentElement
);
2217 addAndAdaptElement(parentElement
, element
);
2221 public AmplificationPrimerDetailElement
createAmplificationPrimerDetailElement(ICdmFormElement parentElement
){
2222 AmplificationPrimerDetailElement element
= new AmplificationPrimerDetailElement(this, parentElement
);
2223 addAndAdaptElement(parentElement
, element
);
2227 public AmplificationCloningDetailElement
createAmplificationCloningDetailElement(ICdmFormElement parentElement
){
2228 AmplificationCloningDetailElement element
= new AmplificationCloningDetailElement(this, parentElement
);
2229 addAndAdaptElement(parentElement
, element
);
2233 public AmplificationGelPhotoDetailElement
createAmplificationGelPhotoDetailElement(ICdmFormElement parentElement
){
2234 AmplificationGelPhotoDetailElement element
= new AmplificationGelPhotoDetailElement(this, parentElement
);
2235 addAndAdaptElement(parentElement
, element
);
2239 public MediaSpecimenGeneralDetailElement
createMediaSpecimenGeneralDetailElement(ICdmFormElement parentElement
){
2240 MediaSpecimenGeneralDetailElement element
= new MediaSpecimenGeneralDetailElement(this, parentElement
);
2241 addAndAdaptElement(parentElement
, element
);
2245 public MediaDetailElement
createMediaDetailElement(ICdmFormElement parentElement
){
2246 MediaDetailElement mediaDetailElement
= new MediaDetailElement(this, parentElement
);
2247 addAndAdaptElement(parentElement
, mediaDetailElement
);
2248 return mediaDetailElement
;
2251 public GatheringEventDetailElement
createGatheringEventDetailElement(ICdmFormElement parentElement
) {
2252 GatheringEventDetailElement element
= new GatheringEventDetailElement(this, parentElement
);
2253 addAndAdaptElement(parentElement
, element
);
2257 public FieldUnitDetailElement
createFieldUnitDetailElement(ICdmFormElement parentElement
) {
2258 FieldUnitDetailElement element
= new FieldUnitDetailElement(this, parentElement
);
2259 addAndAdaptElement(parentElement
, element
);
2263 public SpecimenHierarchyDetailElement
createSpecimenHierarchyDetailElement(ICdmFormElement parentElement
) {
2264 SpecimenHierarchyDetailElement element
= new SpecimenHierarchyDetailElement(this, parentElement
);
2265 addAndAdaptElement(parentElement
, element
);
2269 public DerivedUnitBaseDetailElement
createDerivedUnitBaseDetailElement(ICdmFormElement parentElement
) {
2270 DerivedUnitBaseDetailElement element
= new DerivedUnitBaseDetailElement(this, parentElement
);
2271 addAndAdaptElement(parentElement
, element
);
2275 public OriginalLabelDataElement
createOriginalLabelDataElement(ICdmFormElement parentElement
) {
2276 OriginalLabelDataElement element
= new OriginalLabelDataElement(this, parentElement
);
2277 addAndAdaptElement(parentElement
, element
);
2281 public PreservedSpecimenDetailElement
createPreservedSpecimenDetailElement(ICdmFormElement parentElement
) {
2282 PreservedSpecimenDetailElement element
= new PreservedSpecimenDetailElement(this, parentElement
);
2283 addAndAdaptElement(parentElement
, element
);
2287 public DeterminationDetailElement
createDeterminationDetailElement(ICdmFormElement parentElement
) {
2288 DeterminationDetailElement element
= new DeterminationDetailElement(this, parentElement
);
2289 addAndAdaptElement(parentElement
, element
);
2293 public SampleDesignationDetailElement
createSampleDesignationDetailElement(ICdmFormElement parentElement
) {
2294 SampleDesignationDetailElement element
= new SampleDesignationDetailElement(this, parentElement
);
2295 addAndAdaptElement(parentElement
, element
);
2300 * @param parentElement
2303 private void addAndAdaptElement(ICdmFormElement parentElement
, AbstractCdmDetailElement
<?
> element
) {
2305 parentElement
.addElement(element
);
2308 //--------EntityCollectionSection----------
2309 public TeamMemberSection
createTeamMemberSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
, boolean isNomenclatural
){
2310 TeamMemberSection section
= new TeamMemberSection(this, conversation
, parentElement
, style
, isNomenclatural
);
2311 addAndAdaptSection(parentElement
, section
);
2315 public AnnotationSection
createAnnotationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2316 AnnotationSection section
= new AnnotationSection(this, conversation
, parentElement
, style
);
2317 addAndAdaptSection(parentElement
, section
);
2321 public CreditSection
createCreditSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2322 CreditSection section
= new CreditSection(this, conversation
, parentElement
, style
);
2323 addAndAdaptSection(parentElement
, section
);
2327 public DescriptionElementSourceSection
createDescriptionElementSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2328 DescriptionElementSourceSection section
= new DescriptionElementSourceSection(this, conversation
, parentElement
, style
);
2329 addAndAdaptSection(parentElement
, section
);
2333 public ExtensionSection
createExtensionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2334 ExtensionSection section
= new ExtensionSection(this, conversation
, parentElement
, style
);
2335 addAndAdaptSection(parentElement
, section
);
2339 public MarkerSection
createMarkerSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2340 MarkerSection section
= new MarkerSection(this, conversation
, parentElement
, style
);
2341 addAndAdaptSection(parentElement
, section
);
2345 public MediaSection
createMediaSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2346 MediaSection section
= new MediaSection(this, conversation
, parentElement
, style
);
2347 addAndAdaptSection(parentElement
, section
);
2351 public DescriptionElementMediaSection
createDescriptionElementMediaSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2352 DescriptionElementMediaSection section
= new DescriptionElementMediaSection(this, conversation
, parentElement
, style
);
2353 addAndAdaptSection(parentElement
, section
);
2357 public MediaRepresentationSection
createMediaRepresentationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2358 MediaRepresentationSection section
= new MediaRepresentationSection(this, conversation
, parentElement
, style
);
2359 addAndAdaptSection(parentElement
, section
);
2363 public MediaRepresentationPartSection
createMediaRepresentationPartSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2364 MediaRepresentationPartSection section
= new MediaRepresentationPartSection(this, conversation
, parentElement
, style
);
2365 addAndAdaptSection(parentElement
, section
);
2369 public ModifierSection
createModifierSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2370 ModifierSection section
= new ModifierSection(this, conversation
, parentElement
, style
);
2371 addAndAdaptSection(parentElement
, section
);
2375 public NomenclaturalStatusSection
createNomenclaturalStatusSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2376 NomenclaturalStatusSection section
= new NomenclaturalStatusSection(this, conversation
, parentElement
, style
);
2377 addAndAdaptSection(parentElement
, section
);
2381 public NameRelationshipDetailSection
createNameRelationshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2382 NameRelationshipDetailSection section
= new NameRelationshipDetailSection(this, conversation
, parentElement
, style
);
2383 addAndAdaptSection(parentElement
, section
);
2387 public ProtologueSection
createProtologueSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2388 ProtologueSection section
= new ProtologueSection(this, conversation
, parentElement
, style
);
2389 addAndAdaptSection(parentElement
, section
);
2393 public RightsSection
createRightsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2394 RightsSection section
= new RightsSection(this, conversation
, parentElement
, style
);
2395 addAndAdaptSection(parentElement
, section
);
2399 public SourceSection
createSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2400 SourceSection section
= new SourceSection(this, conversation
, parentElement
, style
);
2401 addAndAdaptSection(parentElement
, section
);
2405 public ScopeSection
createScopeSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2406 ScopeSection section
= new ScopeSection(this, conversation
, parentElement
, style
);
2407 addAndAdaptSection(parentElement
, section
);
2411 public DescriptionSourceSection
createDescriptionSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2412 DescriptionSourceSection section
= new DescriptionSourceSection(this, conversation
, parentElement
, style
);
2413 addAndAdaptSection(parentElement
, section
);
2417 public TypeDesignationSection
createTypeDesignationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2418 TypeDesignationSection section
= new TypeDesignationSection(this, conversation
, parentElement
, style
);
2419 addAndAdaptSection(parentElement
, section
);
2423 public StateDataSection
createStateDataSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2424 StateDataSection section
= new StateDataSection(this, conversation
, parentElement
, style
);
2425 addAndAdaptSection(parentElement
, section
);
2429 public StatisticalMeasurementValueSection
createStatisticalMeasurementValueSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2430 StatisticalMeasurementValueSection section
= new StatisticalMeasurementValueSection(this, conversation
, parentElement
, style
);
2431 addAndAdaptSection(parentElement
, section
);
2435 public DescribedSpecimenSection
createDescribedSpecimenSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2436 DescribedSpecimenSection section
= new DescribedSpecimenSection(this, conversation
, parentElement
, style
);
2437 addAndAdaptSection(parentElement
, section
);
2441 public StateVocabularyCollectionSection
createStateVocabulariesSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2442 StateVocabularyCollectionSection section
= new StateVocabularyCollectionSection(this, conversation
, parentElement
, style
);
2443 addAndAdaptSection(parentElement
, section
);
2447 public RecommendedModifierVocabulariesCollectionSection
createRecommendedModifierVocabulariesCollectionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2448 RecommendedModifierVocabulariesCollectionSection section
= new RecommendedModifierVocabulariesCollectionSection(this, conversation
, parentElement
, style
);
2449 addAndAdaptSection(parentElement
, section
);
2453 public MeasurementUnitCollectionSection
createMeasurementUnitCollectionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2454 MeasurementUnitCollectionSection section
= new MeasurementUnitCollectionSection(this, conversation
, parentElement
, style
);
2455 addAndAdaptSection(parentElement
, section
);
2459 public StatisticalMeasureCollectionSection
createStatisticalMeasureCollectionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2460 StatisticalMeasureCollectionSection section
= new StatisticalMeasureCollectionSection(this, conversation
, parentElement
, style
);
2461 addAndAdaptSection(parentElement
, section
);
2465 public CollectingAreasDetailSection
createCollectingAreasDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2466 CollectingAreasDetailSection section
= new CollectingAreasDetailSection(this, conversation
, parentElement
, style
);
2467 addAndAdaptSection(parentElement
, section
);
2471 public GeoScopeDetailSection
createGeoScopeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2472 GeoScopeDetailSection section
= new GeoScopeDetailSection(this, conversation
, parentElement
, style
);
2473 addAndAdaptSection(parentElement
, section
);
2477 public GeoScopePolyKeyDetailSection
createGeoScopePolyKeyDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2478 GeoScopePolyKeyDetailSection section
= new GeoScopePolyKeyDetailSection(this, conversation
, parentElement
, style
);
2479 addAndAdaptSection(parentElement
, section
);
2483 public IdentifierSection
createIdentifierDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2484 IdentifierSection section
= new IdentifierSection(this, conversation
, parentElement
, style
);
2485 addAndAdaptSection(parentElement
, section
);
2489 public DerivedUnitFacadeIdentifierSection
createDerivedUnitFacadeIdentifierSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2490 DerivedUnitFacadeIdentifierSection section
= new DerivedUnitFacadeIdentifierSection(this, conversation
, parentElement
, style
);
2491 addAndAdaptSection(parentElement
, section
);
2495 public CurrentSampleDesignationDetailSection
createCurrentSampleDesignationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2496 CurrentSampleDesignationDetailSection section
= new CurrentSampleDesignationDetailSection(this, conversation
, parentElement
, style
);
2497 addAndAdaptSection(parentElement
, section
);
2501 public CurrentDeterminationDetailSection
createCurrentDeterminationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2502 CurrentDeterminationDetailSection section
= new CurrentDeterminationDetailSection(this, conversation
, parentElement
, style
);
2503 addAndAdaptSection(parentElement
, section
);
2507 public PreservedSpecimenCurrentDeterminationDetailSection
createPreservedSpecimenCurrentDeterminationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2508 PreservedSpecimenCurrentDeterminationDetailSection section
= new PreservedSpecimenCurrentDeterminationDetailSection(this, conversation
, parentElement
, style
);
2509 addAndAdaptSection(parentElement
, section
);
2513 public SampleDesignationHistoryDetailSection
createSampleDesignationHistoryDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2514 SampleDesignationHistoryDetailSection section
= new SampleDesignationHistoryDetailSection(this, conversation
, parentElement
, style
);
2515 addAndAdaptSection(parentElement
, section
);
2519 public DeterminationHistoryDetailSection
createDeterminationHistoryDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2520 DeterminationHistoryDetailSection section
= new DeterminationHistoryDetailSection(this, conversation
, parentElement
, style
);
2521 addAndAdaptSection(parentElement
, section
);
2525 public SpecimenCollectionDetailSection
createSpecimenCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2526 SpecimenCollectionDetailSection section
= new SpecimenCollectionDetailSection(this, conversation
, parentElement
, style
);
2527 addAndAdaptSection(parentElement
, section
);
2531 public PreservedSpecimenSourceCollectionDetailSection
createPreservedSpecimenSourceCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2532 PreservedSpecimenSourceCollectionDetailSection section
= new PreservedSpecimenSourceCollectionDetailSection(this, conversation
, parentElement
, style
);
2533 addAndAdaptSection(parentElement
, section
);
2537 public SourceCollectionDetailSection
createSourceCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2538 SourceCollectionDetailSection section
= new SourceCollectionDetailSection(this, conversation
, parentElement
, style
);
2539 addAndAdaptSection(parentElement
, section
);
2543 public ScopeRestrictionSection
createScopeRestrictionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2544 ScopeRestrictionSection section
= new ScopeRestrictionSection(this, conversation
, parentElement
, style
);
2545 addAndAdaptSection(parentElement
, section
);
2549 public MemberDetailSection
createMemberDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2550 MemberDetailSection section
= new MemberDetailSection(this, conversation
, parentElement
, style
);
2551 addAndAdaptSection(parentElement
, section
);
2555 public GrantedAuthorityDetailSection
createGrantedAuthorityDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2556 GrantedAuthorityDetailSection section
= new GrantedAuthorityDetailSection(this, conversation
, parentElement
, style
);
2557 addAndAdaptSection(parentElement
, section
);
2561 public GroupsByUserDetailSection
createGroupsByUserDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2562 GroupsByUserDetailSection section
= new GroupsByUserDetailSection(this, conversation
, parentElement
, style
);
2563 addAndAdaptSection(parentElement
, section
);
2567 public TaxonomicScopeSection
createTaxonomicScopeSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2568 TaxonomicScopeSection section
= new TaxonomicScopeSection(this, conversation
, parentElement
, style
);
2569 addAndAdaptSection(parentElement
, section
);
2574 public AbstractEntityCollectionElement
createEntityCollectionElement(AbstractFormSection parentElement
,
2575 Object versionableEntity
, SelectionListener removeListener
, Color backgroundColor
, int style
) {
2576 AbstractEntityCollectionElement element
= null;
2578 Object entity
= HibernateProxyHelper
.deproxy(versionableEntity
);
2580 if (entity
instanceof Annotation
) {
2581 element
= new AnnotationElement(this, parentElement
, (Annotation
) entity
, removeListener
, style
);
2582 }else if (entity
instanceof Person
) {
2583 boolean isNomenclatural
= false;
2584 if (parentElement
instanceof TeamMemberSection
){
2585 isNomenclatural
= ((TeamMemberSection
) parentElement
).isNomenclaturalTeam();
2587 element
= new TeamMemberElement(this, parentElement
, (Person
) entity
, removeListener
, style
, isNomenclatural
);
2588 } else if (entity
instanceof Credit
) {
2589 element
= new CreditElement(this, parentElement
, (Credit
) entity
, removeListener
, style
);
2590 } else if (entity
instanceof Extension
) {
2591 element
= new ExtensionElement(this, parentElement
, (Extension
) entity
, removeListener
, style
);
2592 } else if (entity
instanceof Marker
) {
2593 element
= new MarkerElement(this, parentElement
, (Marker
) entity
, removeListener
, style
);
2594 } else if (entity
instanceof TaxonNodeAgentRelation
) {
2595 element
= new TaxonNodeAgentRelationCollectionElement(this, parentElement
, (TaxonNodeAgentRelation
) entity
, removeListener
, backgroundColor
, style
);
2596 }else if (entity
instanceof Media
) {
2597 element
= new MediaMetaElement(this, parentElement
, (Media
) entity
, removeListener
, style
);
2598 } else if (entity
instanceof MediaRepresentation
) {
2599 element
= new MediaRepresentationElement(this, parentElement
, (MediaRepresentation
) entity
, removeListener
,
2601 } else if (entity
instanceof ImageFile
) {
2602 element
= new ImageFileElement(this, parentElement
, (ImageFile
) entity
, removeListener
, style
);
2603 } else if (entity
instanceof MediaRepresentationPart
) {
2604 element
= new MediaRepresentationPartElement
<>(this, parentElement
, (MediaRepresentationPart
) entity
,
2605 removeListener
, style
);
2606 } else if (entity
instanceof NomenclaturalStatus
) {
2607 element
= new NomenclaturalStatusElement(this, parentElement
, (NomenclaturalStatus
) entity
, removeListener
,
2609 } else if (entity
instanceof Rights
) {
2610 element
= new RightsElement(this, parentElement
, (Rights
) entity
, removeListener
, style
);
2611 } else if (entity
instanceof DescriptionElementSource
) {
2612 element
= new DescriptionElementSourceElement(this, parentElement
, (DescriptionElementSource
) entity
,
2613 removeListener
, style
);
2614 } else if (entity
instanceof TaxonNodeAgentRelation
) {
2615 element
= new TaxonNodeAgentRelationCollectionElement(this, parentElement
, (TaxonNodeAgentRelation
) entity
,
2616 removeListener
,backgroundColor
, style
);
2618 else if (entity
instanceof IdentifiableSource
) {
2619 element
= new IdentifiableSourceElement(this, parentElement
, (IdentifiableSource
) entity
, removeListener
,
2621 } else if (entity
instanceof DefinedTerm
) {
2622 switch(((DefinedTerm
)entity
).getTermType()) {
2624 element
= new ScopeElement(this,
2626 (DefinedTerm
) entity
,
2631 element
= new ModifierElement(this,
2633 (DefinedTerm
) entity
,
2641 } else if (entity
instanceof Reference
) {
2642 if(parentElement
instanceof SequenceReferenceCollectionDetailSection
){
2643 element
= new SequenceReferenceCollectionDetailElement(this, parentElement
, (Reference
) entity
, removeListener
, style
);
2646 element
= new DescriptionSourceElement(this, parentElement
, (Reference
) entity
, removeListener
, style
);
2648 } else if (entity
instanceof NameTypeDesignation
) {
2649 element
= new NameTypeDesignationElement(this, parentElement
, (NameTypeDesignation
) entity
, removeListener
,
2651 } else if (entity
instanceof NameRelationship
) {
2652 element
= new NameRelationshipDetailElement(this, parentElement
, (NameRelationship
) entity
, removeListener
,
2654 } else if (entity
instanceof SpecimenTypeDesignation
) {
2655 if(parentElement
instanceof DerivedUnitTypeDesignationSection
){
2656 element
= new DerivedUnitTypeDesignationElement(this, parentElement
, (SpecimenTypeDesignation
) entity
,
2657 removeListener
, style
);
2660 element
= new SpecimenTypeDesignationElement(this, parentElement
, (SpecimenTypeDesignation
) entity
,
2661 removeListener
, style
);
2663 } else if (entity
instanceof StateData
) {
2664 element
= new StateDataElement(this, parentElement
, (StateData
) entity
, removeListener
, style
);
2665 } else if (entity
instanceof StatisticalMeasurementValue
) {
2666 element
= new StatisticalMeasurementValueElement(this, parentElement
, (StatisticalMeasurementValue
) entity
,
2667 removeListener
, style
);
2668 } else if (entity
instanceof DerivedUnit
) {
2669 switch(((DerivedUnit
)entity
).getRecordBasis()) {
2670 case LivingSpecimen
:
2671 case PreservedSpecimen
:
2673 element
= new SpecimenCollectionDetailElement(this,
2675 (DerivedUnit
) entity
,
2680 element
= new DerivedUnitElement(this,
2682 (DerivedUnit
) entity
,
2687 } else if (entity
instanceof NamedArea
) {
2688 element
= new NamedAreaDetailElement(this, parentElement
, (NamedArea
) entity
, removeListener
, style
);
2689 } else if (entity
instanceof DeterminationEvent
) {
2690 element
= new DeterminationEventDetailElement(this, parentElement
, (DeterminationEvent
) entity
, removeListener
, style
);
2691 } else if (entity
instanceof User
) {
2692 element
= new MemberDetailElement(this, parentElement
, (User
) entity
, removeListener
, style
);
2693 } else if (entity
instanceof GrantedAuthority
) {
2694 element
= new GrantedAuthorityCollectionElement(this, parentElement
, (GrantedAuthorityImpl
) entity
, ((Group
)parentElement
.getEntity()),
2695 removeListener
, style
);
2696 } else if (entity
instanceof Group
) {
2697 element
= new GroupsByUserDetailElement(this, parentElement
, (Group
) entity
, removeListener
, style
);
2698 } else if (entity
instanceof Taxon
) {
2699 element
= new TaxonDetailElement(this, parentElement
, (Taxon
) entity
, removeListener
, style
);
2700 } else if (entity
instanceof DescriptionElementBase
) {
2701 // this is the special case for protologs, maybe we can do this
2702 // differently when API improves
2703 DescriptionElementBase descriptionElement
= (DescriptionElementBase
) entity
;
2704 if (descriptionElement
.getFeature().equals(Feature
.PROTOLOGUE())) {
2705 element
= new ProtologueElement(this, parentElement
, descriptionElement
, removeListener
, style
);
2707 } else if (entity
instanceof Identifier
) {
2708 if(parentElement
instanceof AbstractSampleDesignationDetailSection
){
2709 element
= new SampleDesignationTextDetailElement(this, parentElement
, (Identifier
<DnaSample
>) entity
, removeListener
, backgroundColor
, style
);
2712 element
= new IdentifierElement(this, parentElement
, (Identifier
) entity
, removeListener
, style
);
2714 } else if (entity
instanceof TermVocabulary
) {
2715 TermVocabulary
<?
> termVocabulary
= (TermVocabulary
<?
>)entity
;
2716 switch (termVocabulary
.getTermType()) {
2718 element
= new StateVocabularyCollectionElement(this, parentElement
, (TermVocabulary
<State
>) entity
, removeListener
, backgroundColor
, style
);
2721 element
= new RecommendedModifierVocabulariesElement(this, parentElement
, (TermVocabulary
<DefinedTerm
>) entity
, removeListener
, backgroundColor
, style
);
2726 } else if (entity
instanceof MeasurementUnit
) {
2727 element
= new MeasurementUnitCollectionElement(this, parentElement
, (MeasurementUnit
) entity
, removeListener
, backgroundColor
, style
);
2728 } else if (entity
instanceof StatisticalMeasure
) {
2729 element
= new StatisticalMeasureCollectionElement(this, parentElement
, (StatisticalMeasure
) entity
, removeListener
, backgroundColor
, style
);
2732 //check for parent section when entity is null
2733 //this happens when AbstractUnboundEntityCollectionSection is used
2735 if(parentElement
instanceof ScopeSection
|| parentElement
instanceof ScopeRestrictionSection
){
2736 element
= new ScopeElement(this,
2738 (DefinedTerm
) entity
,
2742 else if(parentElement
instanceof ModifierSection
){
2743 element
= new ModifierElement(this,
2745 (DefinedTerm
) entity
,
2752 if (element
== null) {
2753 MessagingUtils
.messageDialog("No element for entity", this,
2754 "Could not generate element for entity. Looks like the case is not handled already. Check implementation. Entity: "
2759 if (backgroundColor
!= null && !backgroundColor
.isDisposed()) {
2760 element
.setPersistentBackground(backgroundColor
);
2763 parentElement
.addElement(element
);
2771 * Creates a selection element for the given type T.
2774 * <strong>Selection elements not handled by this method:</strong>
2776 * <li>{@link TaxonNodeSelectionElement} see
2777 * {@link #createTaxonNodeSelectionElement(ConversationHolder, ICdmFormElement, String, TaxonNode, int, int)}
2779 * <li>{@link NomenclaturalAuthorTeamSelectionElement} see
2780 * {@link #createNomenclaturalAuthorTeamSelectionElement(ConversationHolder, ICdmFormElement, String, Team, int, int)}
2786 * a {@link Class} object of the type that you want the selection
2788 * @param parentElement
2789 * a {@link ICdmFormElement} object.
2790 * @param labelString
2791 * a {@link String} object.
2792 * @param selectionType
2794 * a {@link ICdmBase} object.
2797 * @param conversation
2798 * a {@link ConversationHolder} object.
2799 * @return a {@link EntitySelectionElement} object.
2801 public <T
extends CdmBase
> EntitySelectionElement
<T
> createSelectionElement(Class
<T
> clazz
,
2802 ConversationHolder conversation
, ICdmFormElement parentElement
, String labelString
, T selection
, int mode
,
2803 int style
, boolean filterElement
) {
2804 EntitySelectionElement
<T
> element
= new EntitySelectionElement
<T
>(this, //conversation,
2805 parentElement
, clazz
,
2806 labelString
, selection
, mode
, style
, filterElement
);
2808 parentElement
.addElement(element
);
2812 public <T
extends CdmBase
> EntitySelectionElement
<T
> createSelectionElement(Class
<T
> clazz
,
2813 // ConversationHolder conversation,
2814 ICdmFormElement parentElement
, String labelString
, T selection
, int mode
,
2816 EntitySelectionElement
<T
> element
= new EntitySelectionElement
<T
>(this, //conversation,
2817 parentElement
, clazz
,
2818 labelString
, selection
, mode
, style
);
2820 parentElement
.addElement(element
);
2826 * Creates a selection element for the given type T which shows only the <b>abbreviated</b> title as the label.
2829 * <strong>Selection elements not handled by this method:</strong>
2831 * <li>{@link TaxonNodeSelectionElement} see
2832 * {@link #createTaxonNodeSelectionElement(ConversationHolder, ICdmFormElement, String, TaxonNode, int, int)}
2834 * <li>{@link NomenclaturalAuthorTeamSelectionElement} see
2835 * {@link #createNomenclaturalAuthorTeamSelectionElement(ConversationHolder, ICdmFormElement, String, Team, int, int)}
2841 * a {@link Class} object of the type that you want the selection
2843 * @param parentElement
2844 * a {@link ICdmFormElement} object.
2845 * @param labelString
2846 * a {@link String} object.
2847 * @param selectionType
2849 * a {@link ICdmBase} object.
2852 * @param conversation
2853 * a {@link ConversationHolder} object.
2854 * @return a {@link EntitySelectionElement} object.
2856 public <T
extends CdmBase
> EntitySelectionElementWithAbbreviatedTitle
<T
> createSelectionElementWithAbbreviatedTitle(
2857 Class
<T
> clazz
, ConversationHolder conversation
, ICdmFormElement parentElement
, String labelString
,
2858 T selection
, int mode
, int style
) {
2859 EntitySelectionElementWithAbbreviatedTitle
<T
> element
= new EntitySelectionElementWithAbbreviatedTitle
<T
>(this, //conversation,
2860 parentElement
, clazz
,
2861 labelString
, selection
, mode
, style
);
2863 parentElement
.addElement(element
);
2867 public TaxonNodeSelectionElement
createTaxonNodeSelectionElement(ConversationHolder conversation
,
2868 ICdmFormElement parentElement
, String labelString
, TaxonNode selection
, int mode
, int style
) {
2869 TaxonNodeSelectionElement element
= new TaxonNodeSelectionElement(this, //conversation,
2871 labelString
, selection
, mode
, style
);
2873 parentElement
.addElement(element
);
2877 // public NomenclaturalAuthorTeamSelectionElement createNomenclaturalAuthorTeamSelectionElement(
2878 // ConversationHolder conversation, ICdmFormElement parentElement, String labelString, Team selection,
2879 // int mode, int style) {
2880 // NomenclaturalAuthorTeamSelectionElement element = new NomenclaturalAuthorTeamSelectionElement(this,
2881 // conversation, parentElement, labelString, selection, mode, style);
2883 // parentElement.addElement(element);
2887 /** {@inheritDoc} */
2888 public LabelElement
createLabel(ICdmFormElement parentElement
, String text
) {
2889 LabelElement labelElement
= new LabelElement(this, parentElement
, text
);
2890 adapt(labelElement
);
2891 parentElement
.addElement(labelElement
);
2892 return labelElement
;
2895 // public DateElementFormElement createDateElementForm(ICdmFormElement formElement, String labelText, DateTime dateTime, int style){
2896 // Label label = new Label(formElement.getLayoutComposite(), style);
2897 // label.setText(labelText+" (yyyy-MM-dd)");
2898 // DateElementFormElement dateElement = new DateElementFormElement(this, dateTime, style, formElement.getLayoutComposite());
2899 // dateElement.initInternalController();
2901 // return dateElement;
2904 public DateElement
createDateElement(ICdmFormElement formElement
, String labelText
, DateTime dateTime
, int style
, boolean editableText
){
2905 Label label
= new Label(formElement
.getLayoutComposite(), style
);
2906 label
.setText(labelText
);
2907 label
.setLayoutData(new TableWrapData(TableWrapData
.LEFT
, TableWrapData
.MIDDLE
, 1, 1));
2908 DateElement dateElement
= new DateElement(this, formElement
.getLayoutComposite(), dateTime
, labelText
, style
, editableText
);
2909 dateElement
.initController(this, formElement
);
2910 dateElement
.setLayoutData(new TableWrapData(TableWrapData
.LEFT
, TableWrapData
.MIDDLE
, 1, 1));
2916 * Getter for the field <code>selectionProvider</code>.
2919 * @return a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
2921 public ISelectionProvider
getSelectionProvider() {
2922 return selectionProvider
;
2927 * createDetailedDescriptionDetailElement
2930 * @param parentElement
2931 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
2935 * {@link eu.etaxonomy.cdm.model.description.DescriptionElementBase}
2940 * {@link eu.etaxonomy.taxeditor.ui.section.description.detail.AbstractDetailedDescriptionDetailElement}
2943 public AbstractDetailedDescriptionDetailElement
createDetailedDescriptionDetailElement(
2944 ICdmFormElement parentElement
, DescriptionElementBase entity
, int style
) {
2945 AbstractDetailedDescriptionDetailElement detailedDescriptionElement
= null;
2947 if (entity
instanceof CategoricalData
) {
2948 detailedDescriptionElement
= new CategoricalDataDetailElement(this, parentElement
,
2949 (CategoricalData
) entity
, style
);
2950 } else if (entity
instanceof CommonTaxonName
) {
2951 detailedDescriptionElement
= new CommonNameDetailElement(this, parentElement
, (CommonTaxonName
) entity
,
2953 } else if (entity
instanceof Distribution
) {
2954 detailedDescriptionElement
= new DistributionDetailElement(this, parentElement
, (Distribution
) entity
,
2956 } else if (entity
instanceof IndividualsAssociation
) {
2957 detailedDescriptionElement
= new IndividualsAssociationDetailElement(this, parentElement
,
2958 (IndividualsAssociation
) entity
, style
);
2959 } else if (entity
instanceof QuantitativeData
) {
2960 detailedDescriptionElement
= new QuantitativeDataDetailElement(this, parentElement
,
2961 (QuantitativeData
) entity
, style
);
2962 } else if (entity
instanceof TaxonInteraction
) {
2963 detailedDescriptionElement
= new TaxonInteractionDetailElement(this, parentElement
,
2964 (TaxonInteraction
) entity
, style
);
2965 } else if (entity
instanceof TextData
) {
2966 detailedDescriptionElement
= new TextDataDetailElement(this, parentElement
, (TextData
) entity
, style
);
2968 throw new IllegalStateException("There is no interface for the given description element");
2970 adapt(detailedDescriptionElement
);
2971 parentElement
.addElement(detailedDescriptionElement
);
2972 return detailedDescriptionElement
;
2977 * Creates a styled text as a part of the form.
2982 * the text initial value
2985 * @return the text widget
2987 public StyledText
createStyledText(Composite parent
, String value
, int style
) {
2988 StyledText text
= new StyledText(parent
, getBorderStyle() | style
| getOrientation());
2989 if (value
!= null) {
2990 text
.setText(value
);
2992 text
.setForeground(getColors().getForeground());
2993 text
.setBackground(getColors().getBackground());
2994 // text.addFocusListener(visibilityHandler);
2998 public PreservedSpecimenDetailSection
createPreservedSpecimenDetailsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
2999 PreservedSpecimenDetailSection section
= new PreservedSpecimenDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
3000 addAndAdaptSection(parentElement
, section
);
3005 * @param formElement
3006 * @param conversationHolder
3010 public TaxonNodeAgentRelationCollectionSection
createTaxonNodeAgentRelationCollectionSection(
3011 ICdmFormElement formElement
, ConversationHolder conversationHolder
, int style
) {
3012 TaxonNodeAgentRelationCollectionSection section
= new TaxonNodeAgentRelationCollectionSection(this, conversationHolder
, formElement
, style
);
3013 addAndAdaptSection(formElement
, section
);
3018 public TaxonOfRelationshipElement
createTaxonOfRelationshipDetailElement(
3019 ICdmFormElement parentElement
, int style
) {
3020 TaxonOfRelationshipElement section
= new TaxonOfRelationshipElement(this, parentElement
, style
);
3021 addAndAdaptElement(parentElement
, section
);
3025 public TaxonDetailSection
createTaxonDetailSection(ConversationHolder conversationHolder
,
3026 ICdmFormElement formElement
, ISelectionProvider selectionProvider
, int style
) {
3027 TaxonDetailSection section
= new TaxonDetailSection(this, conversationHolder
, formElement
, selectionProvider
, style
);
3028 addAndAdaptSection(formElement
, section
);
3034 // public RichTextWithLabelElement createRichTextLabelElement(ICdmFormElement parentElement, String labelString, String initialText, int textHeight, int style) {
3035 // RichTextWithLabelElement element = new RichTextWithLabelElement(this, parentElement, labelString,
3036 // initialText, textHeight, style);
3038 // parentElement.addElement(element);