4 package eu
.etaxonomy
.taxeditor
.ui
.element
;
7 import java
.util
.ArrayList
;
8 import java
.util
.HashSet
;
13 import org
.eclipse
.jface
.util
.IPropertyChangeListener
;
14 import org
.eclipse
.jface
.viewers
.ISelection
;
15 import org
.eclipse
.jface
.viewers
.ISelectionProvider
;
16 import org
.eclipse
.jface
.window
.Window
;
17 import org
.eclipse
.swt
.SWT
;
18 import org
.eclipse
.swt
.custom
.StyledText
;
19 import org
.eclipse
.swt
.events
.FocusAdapter
;
20 import org
.eclipse
.swt
.events
.FocusEvent
;
21 import org
.eclipse
.swt
.events
.FocusListener
;
22 import org
.eclipse
.swt
.events
.MouseAdapter
;
23 import org
.eclipse
.swt
.events
.MouseEvent
;
24 import org
.eclipse
.swt
.events
.MouseListener
;
25 import org
.eclipse
.swt
.events
.SelectionEvent
;
26 import org
.eclipse
.swt
.events
.SelectionListener
;
27 import org
.eclipse
.swt
.events
.TypedEvent
;
28 import org
.eclipse
.swt
.graphics
.Color
;
29 import org
.eclipse
.swt
.graphics
.Font
;
30 import org
.eclipse
.swt
.widgets
.Composite
;
31 import org
.eclipse
.swt
.widgets
.Control
;
32 import org
.eclipse
.swt
.widgets
.Display
;
33 import org
.eclipse
.swt
.widgets
.Event
;
34 import org
.eclipse
.swt
.widgets
.Label
;
35 import org
.eclipse
.ui
.forms
.IFormColors
;
36 import org
.eclipse
.ui
.forms
.widgets
.ExpandableComposite
;
37 import org
.eclipse
.ui
.forms
.widgets
.FormToolkit
;
38 import org
.eclipse
.ui
.forms
.widgets
.Section
;
39 import org
.eclipse
.ui
.internal
.forms
.widgets
.FormFonts
;
40 import org
.joda
.time
.Partial
;
41 import org
.springframework
.security
.core
.GrantedAuthority
;
43 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
44 import eu
.etaxonomy
.cdm
.api
.facade
.DerivedUnitFacade
;
45 import eu
.etaxonomy
.cdm
.hibernate
.HibernateProxyHelper
;
46 import eu
.etaxonomy
.cdm
.model
.agent
.Person
;
47 import eu
.etaxonomy
.cdm
.model
.agent
.Team
;
48 import eu
.etaxonomy
.cdm
.model
.common
.Annotation
;
49 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
50 import eu
.etaxonomy
.cdm
.model
.common
.Credit
;
51 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTerm
;
52 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTermBase
;
53 import eu
.etaxonomy
.cdm
.model
.common
.Extension
;
54 import eu
.etaxonomy
.cdm
.model
.common
.GrantedAuthorityImpl
;
55 import eu
.etaxonomy
.cdm
.model
.common
.Group
;
56 import eu
.etaxonomy
.cdm
.model
.common
.ICdmBase
;
57 import eu
.etaxonomy
.cdm
.model
.common
.IEnumTerm
;
58 import eu
.etaxonomy
.cdm
.model
.common
.IdentifiableSource
;
59 import eu
.etaxonomy
.cdm
.model
.common
.Language
;
60 import eu
.etaxonomy
.cdm
.model
.common
.LanguageString
;
61 import eu
.etaxonomy
.cdm
.model
.common
.Marker
;
62 import eu
.etaxonomy
.cdm
.model
.common
.TermType
;
63 import eu
.etaxonomy
.cdm
.model
.common
.TimePeriod
;
64 import eu
.etaxonomy
.cdm
.model
.common
.User
;
65 import eu
.etaxonomy
.cdm
.model
.common
.VersionableEntity
;
66 import eu
.etaxonomy
.cdm
.model
.description
.CategoricalData
;
67 import eu
.etaxonomy
.cdm
.model
.description
.CommonTaxonName
;
68 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionElementBase
;
69 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionElementSource
;
70 import eu
.etaxonomy
.cdm
.model
.description
.Distribution
;
71 import eu
.etaxonomy
.cdm
.model
.description
.Feature
;
72 import eu
.etaxonomy
.cdm
.model
.description
.IndividualsAssociation
;
73 import eu
.etaxonomy
.cdm
.model
.description
.KeyStatement
;
74 import eu
.etaxonomy
.cdm
.model
.description
.QuantitativeData
;
75 import eu
.etaxonomy
.cdm
.model
.description
.StateData
;
76 import eu
.etaxonomy
.cdm
.model
.description
.StatisticalMeasurementValue
;
77 import eu
.etaxonomy
.cdm
.model
.description
.TaxonInteraction
;
78 import eu
.etaxonomy
.cdm
.model
.description
.TextData
;
79 import eu
.etaxonomy
.cdm
.model
.location
.NamedArea
;
80 import eu
.etaxonomy
.cdm
.model
.location
.NamedAreaLevel
;
81 import eu
.etaxonomy
.cdm
.model
.location
.Point
;
82 import eu
.etaxonomy
.cdm
.model
.media
.ImageFile
;
83 import eu
.etaxonomy
.cdm
.model
.media
.Media
;
84 import eu
.etaxonomy
.cdm
.model
.media
.MediaRepresentation
;
85 import eu
.etaxonomy
.cdm
.model
.media
.MediaRepresentationPart
;
86 import eu
.etaxonomy
.cdm
.model
.media
.Rights
;
87 import eu
.etaxonomy
.cdm
.model
.name
.NameRelationship
;
88 import eu
.etaxonomy
.cdm
.model
.name
.NameTypeDesignation
;
89 import eu
.etaxonomy
.cdm
.model
.name
.NomenclaturalStatus
;
90 import eu
.etaxonomy
.cdm
.model
.name
.SpecimenTypeDesignation
;
91 import eu
.etaxonomy
.cdm
.model
.occurrence
.DerivedUnit
;
92 import eu
.etaxonomy
.cdm
.model
.occurrence
.DeterminationEvent
;
93 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
94 import eu
.etaxonomy
.cdm
.model
.taxon
.SynonymRelationship
;
95 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
96 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonNode
;
97 import eu
.etaxonomy
.cdm
.strategy
.parser
.ParserProblem
;
98 import eu
.etaxonomy
.taxeditor
.model
.AbstractUtility
;
99 import eu
.etaxonomy
.taxeditor
.ui
.combo
.EnumComboElement
;
100 import eu
.etaxonomy
.taxeditor
.ui
.combo
.TermComboElement
;
101 import eu
.etaxonomy
.taxeditor
.ui
.element
.MinMaxTextSection
.UnitType
;
102 import eu
.etaxonomy
.taxeditor
.ui
.openurl
.IOpenUrlEnabled
;
103 import eu
.etaxonomy
.taxeditor
.ui
.openurl
.OpenUrlSelectorElement
;
104 import eu
.etaxonomy
.taxeditor
.ui
.password
.EditPasswordElement
;
105 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailElement
;
106 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailSection
;
107 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionElement
;
108 import eu
.etaxonomy
.taxeditor
.ui
.section
.EmptyElement
;
109 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.InstitutionDetailElement
;
110 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.InstitutionDetailSection
;
111 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailElement
;
112 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailSection
;
113 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailElement
;
114 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailSection
;
115 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamMemberElement
;
116 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamMemberSection
;
117 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamOrPersonBaseDetailSection
;
118 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.ClassificationDetailElement
;
119 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.ClassificationDetailSection
;
120 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.TaxonNodeDetailElement
;
121 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.TaxonNodeDetailSection
;
122 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferenceEntityDetailElement
;
123 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferencedEntityDetailSection
;
124 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DerivedUnitElement
;
125 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescribedSpecimenSection
;
126 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailElement
;
127 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailSection
;
128 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailElement
;
129 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailSection
;
130 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementMediaSection
;
131 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceElement
;
132 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceSection
;
133 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceElement
;
134 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceSection
;
135 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.MediaDetailsSection
;
136 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ModifierElement
;
137 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ModifierSection
;
138 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageDetailElement
;
139 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageSection
;
140 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeElement
;
141 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeSection
;
142 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StateDataElement
;
143 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StateDataSection
;
144 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StatisticalMeasurementValueElement
;
145 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StatisticalMeasurementValueSection
;
146 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.AbstractDetailedDescriptionDetailElement
;
147 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.CategoricalDataDetailElement
;
148 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.CommonNameDetailElement
;
149 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.DistributionDetailElement
;
150 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.IndividualsAssociationDetailElement
;
151 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.QuantitativeDataDetailElement
;
152 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.TaxonInteractionDetailElement
;
153 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.TextDataDetailElement
;
154 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailElement
;
155 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailSection
;
156 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityCollectionElement
;
157 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailElement
;
158 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailSection
;
159 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailElement
;
160 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailSection
;
161 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailElement
;
162 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailSection
;
163 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.GeographicalScopeDetailSection
;
164 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailElement
;
165 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailSection
;
166 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailElement
;
167 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailSection
;
168 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.ScopeRestrictionSection
;
169 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.TaxonomicScopeSection
;
170 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.ImageFileElement
;
171 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaElement
;
172 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationElement
;
173 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationPartElement
;
174 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationPartSection
;
175 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationSection
;
176 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaSection
;
177 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.AuthorshipDetailElement
;
178 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.AuthorshipDetailSection
;
179 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.HybridDetailElement
;
180 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.HybridDetailSection
;
181 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameDetailElement
;
182 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameDetailSection
;
183 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailElement
;
184 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailSection
;
185 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameTypeDesignationElement
;
186 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusElement
;
187 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusSection
;
188 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailElement
;
189 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailSection
;
190 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.ProtologueElement
;
191 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.ProtologueSection
;
192 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.SpecimenTypeDesignationElement
;
193 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.SynonymRelationshipDetailElement
;
194 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.SynonymRelationshipDetailSection
;
195 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.TypeDesignationSection
;
196 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CollectingAreasDetailSection
;
197 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CollectionDetailElement
;
198 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CurrentDeterminationDetailSection
;
199 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitBaseDetailElement
;
200 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitBaseDetailSection
;
201 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitFacadeDetailElement
;
202 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitFacadeDetailSection
;
203 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitGeneralDetailElement
;
204 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitGeneralDetailSection
;
205 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailElement
;
206 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailSection
;
207 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationEventDetailElement
;
208 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationHistoryDetailSection
;
209 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.EmptySection
;
210 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitDetailElement
;
211 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitDetailSection
;
212 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitGeneralDetailElement
;
213 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitGeneralDetailSection
;
214 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailElement
;
215 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailSection
;
216 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.NamedAreaDetailElement
;
217 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SourceCollectionDetailSection
;
218 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SpecimenCollectionDetailElement
;
219 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SpecimenCollectionDetailSection
;
220 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenCurrentDeterminationDetailSection
;
221 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenDetailElement
;
222 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenDetailSection
;
223 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenDeterminationDetailElement
;
224 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenDeterminationDetailSection
;
225 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenDeterminationHistoryDetailSection
;
226 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenGeneralDetailElement
;
227 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenGeneralDetailSection
;
228 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenSourceCollectionDetailSection
;
229 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationCloningDetailElement
;
230 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationCloningDetailSection
;
231 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationGelPhotoCollectionDetailSection
;
232 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationGelPhotoDetailElement
;
233 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationGeneralDetailElement
;
234 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationGeneralDetailSection
;
235 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationPrimerDetailElement
;
236 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationPrimerDetailSection
;
237 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaQualityDetailElement
;
238 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaQualityDetailSection
;
239 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaSampleGeneralDetailElement
;
240 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaSampleGeneralDetailSection
;
241 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.PrimerGeneralDetailElement
;
242 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceContigFileCollectionDetailSection
;
243 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceGeneralDetailElement
;
244 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceGeneralDetailSection
;
245 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceReferenceCollectionDetailElement
;
246 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceReferenceCollectionDetailSection
;
247 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SingleReadGeneralDetailElement
;
248 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SingleReadGeneralDetailSection
;
249 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SingleReadPherogramCollectionDetailSection
;
250 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.TissueSampleGeneralDetailElement
;
251 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.TissueSampleGeneralDetailSection
;
252 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.media
.LivingPlantPhotoGeneralDetailElement
;
253 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.media
.LivingPlantPhotoGeneralDetailSection
;
254 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.media
.MediaSpecimenGeneralDetailElement
;
255 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.media
.MediaSpecimenGeneralDetailSection
;
256 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.media
.SpecimenScanGeneralDetailElement
;
257 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.media
.SpecimenScanGeneralDetailSection
;
258 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailElement
;
259 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailSection
;
260 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailElement
;
261 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailSection
;
262 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.AnnotationElement
;
263 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.AnnotationSection
;
264 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CdmBaseElement
;
265 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CdmBaseSection
;
266 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CreditElement
;
267 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CreditSection
;
268 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.ExtensionElement
;
269 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.ExtensionSection
;
270 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.HeadlineSection
;
271 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.IdentifiableSourceElement
;
272 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.MarkerElement
;
273 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.MarkerSection
;
274 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.RightsElement
;
275 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.RightsSection
;
276 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.SourceSection
;
277 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.VersionElement
;
278 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.VersionSection
;
279 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessageElement
;
280 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessagesSection
;
281 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailElement
;
282 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailSection
;
283 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonDetailElement
;
284 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailElement
;
285 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailSection
;
286 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailElement
;
287 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailSection
;
288 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailElement
;
289 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailSection
;
290 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailElement
;
291 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailSection
;
292 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.DefinedTermDetailElement
;
293 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.DefinedTermDetailSection
;
294 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.FeatureDetailElement
;
295 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailSection
;
296 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailElement
;
297 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailSection
;
298 import eu
.etaxonomy
.taxeditor
.ui
.selection
.EntitySelectionElement
;
299 import eu
.etaxonomy
.taxeditor
.ui
.selection
.NomenclaturalAuthorTeamSelectionElement
;
300 import eu
.etaxonomy
.taxeditor
.ui
.selection
.TaxonNodeSelectionElement
;
304 * CdmFormFactory class.
308 * @created Feb 24, 2010
311 public class CdmFormFactory
extends FormToolkit
{
313 private BoldFontHolder2 boldFontHolder2
;
314 private MouseListener selectionMouseHandler
;
315 private FocusListener selectionFocusHandler
;
317 private final Set
<SelectionListener
> selectionListenerList
= new HashSet
<SelectionListener
>();
319 private final List
<IPropertyChangeListener
> propertyChangeListeners
= new ArrayList
<IPropertyChangeListener
>();
321 private final int orientation
= Window
.getDefaultOrientation();
322 private ISelectionProvider selectionProvider
;
324 /** Constant <code>EMPTY_SELECTION</code> */
325 public static ISelection EMPTY_SELECTION
= new ISelection() {
327 public boolean isEmpty() {
338 private class SelectionMouseHandler
extends MouseAdapter
{
340 public void mouseDown(MouseEvent e
) {
341 notifySelectionListeners(e
);
351 private class SelectionFocusHandler
extends FocusAdapter
{
353 public void focusGained(FocusEvent e
) {
354 notifySelectionListeners(e
);
358 private void notifySelectionListeners(TypedEvent e
) {
359 Event event
= new Event();
360 event
.widget
= e
.widget
;
361 SelectionEvent selectionEvent
= new SelectionEvent(event
);
363 for (SelectionListener listener
: selectionListenerList
) {
364 listener
.widgetSelected(selectionEvent
);
370 * Constructor for CdmFormFactory.
374 * a {@link org.eclipse.swt.widgets.Display} object.
375 * @param selectionProvider
376 * a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
378 public CdmFormFactory(Display display
, ISelectionProvider selectionProvider
) {
380 this.selectionProvider
= selectionProvider
;
386 * Constructor for CdmFormFactory.
390 * a {@link org.eclipse.swt.widgets.Display} object.
392 public CdmFormFactory(Display display
) {
400 private void init() {
401 boldFontHolder2
= new BoldFontHolder2();
402 selectionMouseHandler
= new SelectionMouseHandler();
403 selectionFocusHandler
= new SelectionFocusHandler();
407 * Creates an instance initialized with the correct selectionProvider
409 * Make sure to remove the instance when the entityComposite disposes via
410 * destroySelectionArbitrator(..)
412 * @param entityElement
413 * a {@link eu.etaxonomy.taxeditor.ui.element.IEntityElement}
415 * @return a {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator}
418 public SelectionArbitrator
createSelectionArbitrator(IEntityElement entityElement
) {
419 SelectionArbitrator selectionArbitrator
= new SelectionArbitrator(entityElement
);
420 selectionArbitrator
.addSelectionProvider(selectionProvider
);
421 selectionProvider
.addSelectionChangedListener(selectionArbitrator
);
422 addSelectionListener(selectionArbitrator
);
423 return selectionArbitrator
;
428 * destroySelectionArbitrator
431 * @param selectionArbitrator
433 * {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator}
436 public void destroySelectionArbitrator(SelectionArbitrator selectionArbitrator
) {
437 removeSelectionListener(selectionArbitrator
);
438 if (selectionProvider
!= null) {
439 selectionProvider
.removeSelectionChangedListener(selectionArbitrator
);
441 AbstractUtility
.error(this.getClass(),
442 "Tried to destroy a selection listener from this factories listeners but was null", null);
448 * Adapts the {@link AbstractCdmFormElement}:<br>
449 * - sets the {@link IPropertyChangeListener}s handled by this class
454 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement}
457 public void adapt(ICdmFormElement formElement
) {
458 formElement
.setPropertyChangeListeners(propertyChangeListeners
);
463 public void adapt(Control control
, boolean trackFocus
, boolean trackKeyboard
) {
465 control
.addFocusListener(selectionFocusHandler
);
467 super.adapt(control
, trackFocus
, trackKeyboard
);
472 public void adapt(Composite composite
) {
473 composite
.addMouseListener(selectionMouseHandler
);
474 super.adapt(composite
);
483 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
486 public void destroyElement(ICdmFormElement formElement
) {
487 // return if element was not initialized
488 if (formElement
== null) {
491 // destroy selection arbitrator, if any
492 if (formElement
instanceof ISelectableElement
) {
493 destroySelectionArbitrator(((ISelectableElement
) formElement
).getSelectionArbitrator());
495 // remove this element form its parents list of elements
496 // ICdmFormElement parentElement = formElement.getParentElement();
497 // if(parentElement != null){
498 // parentElement.removeElement(formElement);
500 // call destroy on child elements recursively
501 for (ICdmFormElement childElement
: formElement
.getElements()) {
502 destroyElement(childElement
);
504 // dispose of the controls
505 for (Control control
: formElement
.getControls()) {
506 // we added the layoutComposite of the parental element as the
507 // layout composite to this formElement
508 // but we do not want to destroy it.
509 if (control
.equals(formElement
.getLayoutComposite())) {
524 * a {@link org.eclipse.swt.widgets.Composite} object.
525 * @return a {@link org.eclipse.swt.widgets.Label} object.
527 public Label
createEmptyCell(Composite parent
) {
528 return this.createLabel(parent
, null);
533 * createMultilineTextWithLabel
537 * a {@link java.lang.String} object.
542 * @param parentElement
543 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
545 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
548 public TextWithLabelElement
createMultilineTextWithLabel(ICdmFormElement parentElement
, String labelString
,
549 int textHeight
, int style
) {
550 TextWithLabelElement element
= new TextWithLabelElement(this, parentElement
, labelString
, "", textHeight
, style
);
552 parentElement
.addElement(element
);
558 * createMultiLanguageTextElement
561 * @param parentElement
562 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
565 * a {@link java.lang.String} object.
566 * @param multilanguageText
567 * a {@link java.util.Map} object.
573 * {@link eu.etaxonomy.taxeditor.ui.element.MultilanguageTextElement}
576 public MultilanguageTextElement
createMultiLanguageTextElement(ICdmFormElement parentElement
, String labelString
,
577 Map
<Language
, LanguageString
> multilanguageText
, int textHeight
, int style
) {
578 MultilanguageTextElement element
= new MultilanguageTextElement(this, parentElement
, labelString
,
579 multilanguageText
, textHeight
, style
);
581 parentElement
.addElement(element
);
585 public KeyStatementElement
createKeyStatementElement(ICdmFormElement parentElement
, String labelString
,
586 KeyStatement keyStatement
, int textHeight
, int style
) {
587 KeyStatementElement element
= new KeyStatementElement(this, parentElement
, labelString
, keyStatement
,
590 parentElement
.addElement(element
);
595 * Creates a text field with a label. The initial content will be the return value of the initalObject's {@link #toString()}
597 * <b>Note</b>: if initialObject is <code>null</code> then an empty string is used.
598 * @param parentElement the parent container
599 * @param labelString the label name
600 * @param initialObject the object from which the <code>toString()</code> method is called
601 * @param style {@link SWT} style constant
602 * @return the created textfield with label
604 public TextWithLabelElement
createTextWithLabelElement(ICdmFormElement parentElement
, String labelString
,
605 Object initialObject
, int style
) {
606 return createTextWithLabelElement(parentElement
, labelString
, initialObject
==null?
"":initialObject
.toString(), style
);
611 * createTextWithLabelElement
614 * @param parentElement
615 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
618 * a {@link java.lang.String} object.
620 * a {@link java.lang.String} object.
623 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
626 public TextWithLabelElement
createTextWithLabelElement(ICdmFormElement parentElement
, String labelString
,
627 String initialText
, int style
) {
628 return createTextWithLabelElement(parentElement
, labelString
, initialText
, null, style
);
632 * createTextWithLabelElement
635 * @param parentElement
636 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
639 * a {@link java.lang.String} object.
641 * a {@link java.lang.String} object.
642 * @param textLimit maximal number of characters allowed
645 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
648 public TextWithLabelElement
createTextWithLabelElement(ICdmFormElement parentElement
, String labelString
,
649 String initialText
, Integer textLimit
, int style
) {
650 if(initialText
==null){
654 TextWithLabelElement element
= new TextWithLabelElement(this, parentElement
, labelString
, initialText
, null, textLimit
, style
);
656 parentElement
.addElement(element
);
660 public UriWithLabelElement
createUriWithLabelElement(ICdmFormElement parentElement
, String labelString
,
661 URI initialUri
, int style
) {
662 UriWithLabelElement element
= new UriWithLabelElement(this, parentElement
, labelString
, initialUri
, null, style
);
664 parentElement
.addElement(element
);
675 public OpenUrlSelectorElement
createOpenUrlSelectorElement(ICdmFormElement parentElement
, String labelString
,
676 IOpenUrlEnabled openUrlEnabled
, int style
) {
677 OpenUrlSelectorElement element
= new OpenUrlSelectorElement(this, parentElement
, labelString
, openUrlEnabled
,
680 parentElement
.addElement(element
);
686 * @param parentElement
688 * @param conversationEnabled
693 public EditPasswordElement
createEditPasswordElement(ICdmFormElement parentElement
, String labelString
,
694 ConversationHolder conversation
, User user
, int style
) {
695 EditPasswordElement element
= new EditPasswordElement(this, parentElement
, labelString
, user
, conversation
);
697 parentElement
.addElement(element
);
703 * createIntegerTextWithLabelElement
706 * @param parentElement
707 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
710 * a {@link java.lang.String} object.
711 * @param initialInteger
712 * a {@link java.lang.Integer} object.
716 * {@link eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement}
719 public NumberWithLabelElement
createNumberTextWithLabelElement(
720 ICdmFormElement parentElement
, String labelString
,
721 Number initialNumber
, int style
) {
722 NumberWithLabelElement element
= new NumberWithLabelElement(this,
723 parentElement
, labelString
, initialNumber
, style
);
725 parentElement
.addElement(element
);
731 * createLanguageStringWithLabelElement
734 * @param parentElement
735 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
738 * a {@link java.lang.String} object.
739 * @param languageString
740 * a {@link eu.etaxonomy.cdm.model.common.LanguageString} object.
744 * {@link eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement}
747 public LanguageStringWithLabelElement
createLanguageStringWithLabelElement(ICdmFormElement parentElement
,
748 String labelString
, LanguageString languageString
, int style
) {
749 LanguageStringWithLabelElement element
= new LanguageStringWithLabelElement(this, parentElement
, labelString
,
750 languageString
, style
);
752 parentElement
.addElement(element
);
758 * createLanguageStringWithLabelElement
761 * @param parentElement
762 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
765 * a {@link java.lang.String} object.
766 * @param languageString
767 * a {@link eu.etaxonomy.cdm.model.common.LanguageString} object.
773 * {@link eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement}
776 public LanguageStringWithLabelElement
createLanguageStringWithLabelElement(ICdmFormElement parentElement
,
777 String labelString
, LanguageString languageString
, int height
, int style
) {
778 LanguageStringWithLabelElement element
= new LanguageStringWithLabelElement(this, parentElement
, labelString
,
779 languageString
, height
, style
);
781 parentElement
.addElement(element
);
790 * @param parentElement
791 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
794 * a {@link java.lang.String} object.
797 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
800 public TextWithLabelElement
createTextElement(ICdmFormElement parentElement
, String initialText
, int style
) {
801 TextWithLabelElement element
= new TextWithLabelElement(this, parentElement
, null, initialText
, null, style
);
803 parentElement
.addElement(element
);
809 * createKeyValueViewerElement
812 * @param parentElement
813 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
816 * a {@link java.lang.String} object.
817 * @param valueHeading
818 * a {@link java.lang.String} object.
820 * a {@link java.util.Map} object.
821 * @return a {@link eu.etaxonomy.taxeditor.ui.element.KeyValueViewerElement}
824 public KeyValueViewerElement
createKeyValueViewerElement(ICdmFormElement parentElement
, String keyHeading
,
825 String valueHeading
, Map
<Object
, Object
> map
) {
826 KeyValueViewerElement element
= new KeyValueViewerElement(this, parentElement
, keyHeading
, valueHeading
, map
);
828 parentElement
.addElement(element
);
834 * createTermComboElement
837 * @param termComboType
839 * {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.TermComboType}
841 * @param parentElement
842 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
845 * a {@link java.lang.String} object.
847 * a {@link eu.etaxonomy.cdm.model.common.DefinedTermBase}
851 * @return a {@link eu.etaxonomy.taxeditor.ui.combo.TermComboElement}
855 public <T
extends DefinedTermBase
> TermComboElement
<T
> createTermComboElement(Class
<T
> termComboType
,
856 ICdmFormElement parentElement
, String labelString
, T selection
, int style
) {
857 TermComboElement
<T
> element
= new TermComboElement
<T
>(this, parentElement
, termComboType
, labelString
,
860 parentElement
.addElement(element
);
866 * createTermComboElement
869 * @param termComboType
871 * {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.TermComboType}
873 * @param parentElement
874 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
877 * a {@link java.lang.String} object.
879 * a {@link eu.etaxonomy.cdm.model.common.DefinedTermBase}
883 * @return a {@link eu.etaxonomy.taxeditor.ui.combo.TermComboElement}
887 public <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
889 ICdmFormElement parentElement
,
893 TermComboElement
<T
> element
= new TermComboElement
<T
>(this, parentElement
, termType
, labelString
, selection
, style
);
895 parentElement
.addElement(element
);
901 * createEnumComboElement
904 * @param enumComboType
906 * {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EnumComboType}
908 * @param parentElement
909 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
913 * @return a {@link eu.etaxonomy.taxeditor.ui.term.AbstractEnumComboElement}
916 public <T
extends IEnumTerm
<T
>> EnumComboElement
<T
> createEnumComboElement(
917 Class
<T
> enumComboType
, ICdmFormElement parentElement
,
919 EnumComboElement
<T
> element
= new EnumComboElement
<T
>(this, parentElement
, enumComboType
, style
);
921 parentElement
.addElement(element
);
927 * createBrowserElement
931 * a {@link java.net.URI} object.
934 * @param parentElement
935 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
937 * @return a {@link eu.etaxonomy.taxeditor.ui.element.BrowserElement}
940 public BrowserElement
createBrowserElement(ICdmFormElement parentElement
, URI imageUri
, int style
) {
941 BrowserElement element
= new BrowserElement(this, parentElement
, imageUri
, style
);
943 parentElement
.addElement(element
);
952 * @param parentElement
953 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
956 * a {@link java.net.URI} object.
959 * @return a {@link eu.etaxonomy.taxeditor.ui.element.ImageElement} object.
961 public ImageElement
createImageElement(ICdmFormElement parentElement
, URI imageUri
, int style
) {
962 ImageElement element
= new ImageElement(this, parentElement
, imageUri
, style
);
964 parentElement
.addElement(element
);
970 * createTextActionElement
974 * a {@link java.lang.String} object.
976 * a {@link java.lang.String} object.
979 * @param parentElement
980 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
983 * a {@link java.lang.String} object.
984 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextActionElement}
987 public TextActionElement
createTextActionElement(ICdmFormElement parentElement
, String labelString
,
988 String buttonLabel
, String initialText
, int style
) {
989 TextActionElement element
= new TextActionElement(this, parentElement
, labelString
, buttonLabel
, initialText
,
992 parentElement
.addElement(element
);
1001 * @param parentElement
1002 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1005 * a {@link java.lang.String} object.
1006 * @param initialState
1010 * @return a {@link eu.etaxonomy.taxeditor.ui.element.CheckboxElement}
1013 public CheckboxElement
createCheckbox(ICdmFormElement parentElement
, String label
, Boolean initialState
, int style
) {
1014 if(initialState
==null){
1015 initialState
= Boolean
.FALSE
;
1017 CheckboxElement element
= new CheckboxElement(this, parentElement
, label
, initialState
, style
| orientation
);
1019 parentElement
.addElement(element
);
1024 * Creates a section as a part of the form.
1026 * @return the section widget
1029 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
1032 public Section
adapt(AbstractFormSection section
) {
1033 section
.setMenu(section
.getLayoutComposite().getMenu());
1034 adapt(section
, true, true);
1036 // handle focus and property change events for cdm use
1037 section
.addFocusListener(selectionFocusHandler
);
1038 section
.setPropertyChangeListeners(propertyChangeListeners
);
1040 if (section
.getToggle() != null) {
1041 section
.getToggle().setHoverDecorationColor(getColors().getColor(IFormColors
.TB_TOGGLE_HOVER
));
1042 section
.getToggle().setDecorationColor(getColors().getColor(IFormColors
.TB_TOGGLE
));
1045 section
.setFont(boldFontHolder2
.getBoldFont(section
.getLayoutComposite().getFont()));
1047 if ((section
.getStyle() & ExpandableComposite
.TITLE_BAR
) != 0
1048 || (section
.getStyle() & ExpandableComposite
.SHORT_TITLE_BAR
) != 0) {
1049 getColors().initializeSectionToolBarColors();
1050 section
.setTitleBarBackground(getColors().getColor(IFormColors
.TB_BG
));
1051 section
.setTitleBarBorderColor(getColors().getColor(IFormColors
.TB_BORDER
));
1053 // call setTitleBarForeground regardless as it also sets the label color
1054 section
.setTitleBarForeground(getColors().getColor(IFormColors
.TB_TOGGLE
));
1058 private class BoldFontHolder2
{
1059 private Font normalFont
;
1061 private Font boldFont
;
1063 public BoldFontHolder2() {
1066 public Font
getBoldFont(Font font
) {
1067 createBoldFont(font
);
1071 private void createBoldFont(Font font
) {
1072 if (normalFont
== null || !normalFont
.equals(font
)) {
1076 if (boldFont
== null) {
1077 boldFont
= FormFonts
.getInstance().getBoldFont(getColors().getDisplay(), normalFont
);
1081 public void dispose() {
1082 if (boldFont
!= null) {
1083 FormFonts
.getInstance().markFinished(boldFont
, getColors().getDisplay());
1091 * createToggleableTextField
1094 * @param parentElement
1095 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1097 * @param labelString
1098 * a {@link java.lang.String} object.
1099 * @param initialText
1100 * a {@link java.lang.String} object.
1101 * @param initialState
1105 * @return a {@link eu.etaxonomy.taxeditor.ui.element.ToggleableTextElement}
1108 public ToggleableTextElement
createToggleableTextField(ICdmFormElement parentElement
, String labelString
,
1109 String initialText
, boolean initialState
, int style
) {
1110 ToggleableTextElement element
= new ToggleableTextElement(this, parentElement
, labelString
, initialText
,
1111 initialState
, style
| orientation
);
1113 parentElement
.addElement(element
);
1119 * createTimePeriodElement
1122 * @param parentElement
1123 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1125 * @param labelString
1126 * a {@link java.lang.String} object.
1128 * a {@link eu.etaxonomy.cdm.model.common.TimePeriod} object.
1131 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TimePeriodElement}
1134 public TimePeriodElement
createTimePeriodElement(ICdmFormElement parentElement
, String labelString
,
1135 TimePeriod timePeriod
, int style
) {
1136 TimePeriodElement element
= new TimePeriodElement(this, parentElement
, labelString
, timePeriod
, style
);
1138 parentElement
.addElement(element
);
1144 * createGatheringEventUnitElement
1147 * @param parentElement
1148 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1150 * @param labelString
1151 * a {@link java.lang.String} object.
1153 * a {@link eu.etaxonomy.cdm.model.common.GatheringEvent} object.
1156 * @return a {@link eu.etaxonomy.taxeditor.ui.element.GatheringEventUnitElement}
1159 public GatheringEventUnitElement
createGatheringEventUnitElement(
1160 ICdmFormElement parentElement
,
1162 DerivedUnitFacade gatheringEvent
,
1163 MinMaxTextSection
.UnitType unitType
,
1165 GatheringEventUnitElement element
= new GatheringEventUnitElement(this,
1172 parentElement
.addElement(element
);
1178 * createPointElement
1183 * @param parentElement
1184 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1187 * a {@link eu.etaxonomy.cdm.model.location.Point} object.
1188 * @return a {@link eu.etaxonomy.taxeditor.ui.element.PointElement} object.
1190 public PointElement
createPointElement(ICdmFormElement parentElement
, Point point
, int style
) {
1191 PointElement element
= new PointElement(this, parentElement
, point
, style
);
1193 parentElement
.addElement(element
);
1200 * @param conversationHolder
1202 * @param detailsViewer
1206 public EmptySection
createEmptySection(CdmFormFactory formFactory
, ICdmFormElement parentElement
, int style
) {
1207 EmptySection section
= new EmptySection(formFactory
, parentElement
, style
);
1208 parentElement
.addElement(section
);
1215 * createDateDetailSection
1218 * @param parentElement
1219 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1223 * @return a {@link eu.etaxonomy.taxeditor.ui.element.DateDetailSection}
1226 public DateDetailSection
createDateDetailSection(ICdmFormElement parentElement
, int style
) {
1227 DateDetailSection section
= new DateDetailSection(this, parentElement
, style
);
1228 parentElement
.addElement(section
);
1235 * createDateDetailSection
1238 * @param parentElement
1239 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1243 * @return a {@link eu.etaxonomy.taxeditor.ui.element.MinMaxTextSection}
1246 public MinMaxTextSection
createMinMaxTextSection(ICdmFormElement parentElement
, UnitType unitType
, int style
) {
1247 MinMaxTextSection section
= new MinMaxTextSection(this, parentElement
, unitType
, style
);
1248 parentElement
.addElement(section
);
1255 * createPartialElement
1258 * @param parentElement
1259 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1261 * @param labelString
1262 * a {@link java.lang.String} object.
1264 * a {@link org.joda.time.Partial} object.
1267 * @return a {@link eu.etaxonomy.taxeditor.ui.element.PartialElement}
1270 public PartialElement
createPartialElement(ICdmFormElement parentElement
, String labelString
, Partial partial
,
1272 PartialElement element
= new PartialElement(this, parentElement
, labelString
, style
);
1274 parentElement
.addElement(element
);
1280 * addSelectionListener
1284 * a {@link org.eclipse.swt.events.SelectionListener} object.
1286 public void addSelectionListener(SelectionListener listener
) {
1287 selectionListenerList
.add(listener
);
1292 * removeSelectionListener
1296 * a {@link org.eclipse.swt.events.SelectionListener} object.
1298 public void removeSelectionListener(SelectionListener listener
) {
1299 if (listener
== null) {
1300 AbstractUtility
.error(this.getClass(),
1301 "Tried to remove a selection listener from this factories listeners but was null", null);
1303 selectionListenerList
.remove(listener
);
1309 * addPropertyChangeListener
1313 * a {@link org.eclipse.jface.util.IPropertyChangeListener}
1316 public void addPropertyChangeListener(IPropertyChangeListener listener
) {
1317 if (propertyChangeListeners
.contains(listener
)) {
1320 propertyChangeListeners
.add(0, listener
);
1325 * removePropertyChangeListener
1329 * a {@link org.eclipse.jface.util.IPropertyChangeListener}
1332 public void removePropertyChangeListener(IPropertyChangeListener listener
) {
1333 propertyChangeListeners
.remove(listener
);
1337 * @return the propertyChangeListeners
1339 public List
<IPropertyChangeListener
> getPropertyChangeListeners() {
1340 return propertyChangeListeners
;
1345 * createHorizontalSeparator
1348 * @param parentElement
1349 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1353 * @return a {@link org.eclipse.swt.widgets.Label} object.
1355 public Label
createHorizontalSeparator(ICdmFormElement parentElement
, int style
) {
1356 Label separator
= this.createSeparator(parentElement
.getLayoutComposite(), SWT
.HORIZONTAL
| style
);
1357 separator
.setLayoutData(LayoutConstants
.FILL_HORIZONTALLY());
1363 * createVersionElement
1366 * @param parentElement
1367 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1370 * a {@link eu.etaxonomy.cdm.model.common.VersionableEntity}
1375 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.VersionElement}
1378 public VersionElement
createVersionElement(ICdmFormElement parentElement
, VersionableEntity entity
, int style
) {
1379 VersionElement element
= new VersionElement(this, parentElement
, entity
, style
);
1381 parentElement
.addElement(element
);
1386 * @param cdmBaseSection
1391 public CdmBaseElement
createCdmBaseElement(ICdmFormElement parentElement
, CdmBase entity
, int style
) {
1392 CdmBaseElement element
= new CdmBaseElement(this, parentElement
, entity
, style
);
1394 parentElement
.addElement(element
);
1400 * createVersionSection
1403 * @param parentElement
1404 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1409 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.VersionSection}
1412 public VersionSection
createVersionSection(ICdmFormElement parentElement
, int style
) {
1413 VersionSection section
= new VersionSection(this, parentElement
, style
);
1414 parentElement
.addElement(section
);
1424 public CdmBaseSection
createCdmBaseSection(ICdmFormElement parentElement
, int style
) {
1425 CdmBaseSection section
= new CdmBaseSection(this, parentElement
, style
);
1426 parentElement
.addElement(section
);
1433 * createEmptyElement
1436 * @param parentElement
1437 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1439 * @return a {@link eu.etaxonomy.taxeditor.ui.section.EmptyElement} object.
1441 public EmptyElement
createEmptyElement(ICdmFormElement parentElement
) {
1442 EmptyElement element
= new EmptyElement(this, parentElement
, null, SWT
.NULL
);
1444 parentElement
.addElement(element
);
1450 * createHeadlineSection
1453 * @param parentElement
1454 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1457 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.HeadlineSection}
1460 public HeadlineSection
createHeadlineSection(ICdmFormElement parentElement
) {
1461 HeadlineSection section
= new HeadlineSection(this, parentElement
, SWT
.NULL
);
1462 parentElement
.addElement(section
);
1469 * createParsingMessageElement
1472 * @param parentElement
1473 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1475 * @param parserProblem
1476 * a {@link eu.etaxonomy.cdm.strategy.parser.ParserProblem}
1481 * {@link eu.etaxonomy.taxeditor.ui.section.taxon.ParsingMessageElement}
1484 public ParsingMessageElement
createParsingMessageElement(ICdmFormElement parentElement
,
1485 ParserProblem parserProblem
, int style
) {
1486 ParsingMessageElement element
= new ParsingMessageElement(this, parentElement
, parserProblem
, style
);
1488 parentElement
.addElement(element
);
1492 public AbstractFormSection
createDefinedTermDetailSection(Class definedTermClass
, ConversationHolder conversation
,
1493 ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
1495 AbstractFormSection section
= new DefinedTermDetailSection(this, definedTermClass
, conversation
, parentElement
,
1496 selectionProvider
, style
);
1498 parentElement
.addElement(section
);
1505 * @param definedTermClass
1506 * @param formElement
1510 public AbstractCdmDetailElement
createDefinedTermDetailElement(Class definedTermClass
,
1511 AbstractCdmDetailSection parentElement
, int style
) {
1512 AbstractCdmDetailElement element
= null;
1514 if (NamedArea
.class.isAssignableFrom(definedTermClass
)) {
1515 element
= new eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement(this, parentElement
);
1516 } else if (definedTermClass
.equals(Feature
.class)) {
1517 element
= new FeatureDetailElement(this, parentElement
);
1519 element
= new DefinedTermDetailElement(this, parentElement
);
1523 parentElement
.addElement(element
);
1528 //--------DetailSections---------
1529 public NameDetailSection
createNameDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1530 NameDetailSection section
= new NameDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1531 addAndAdaptSection(parentElement
, section
);
1535 public ReferenceDetailSection
createReferenceDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1536 ReferenceDetailSection section
= new ReferenceDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1537 addAndAdaptSection(parentElement
, section
);
1541 public NomenclaturalReferenceDetailSection
createNomenclaturalReferenceDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1542 NomenclaturalReferenceDetailSection section
= new NomenclaturalReferenceDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1543 addAndAdaptSection(parentElement
, section
);
1547 public TaxonBaseDetailSection
createTaxonBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1548 TaxonBaseDetailSection section
= new TaxonBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1549 addAndAdaptSection(parentElement
, section
);
1553 public AuthorshipDetailSection
createAuthorshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1554 AuthorshipDetailSection section
= new AuthorshipDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1555 addAndAdaptSection(parentElement
, section
);
1559 public TeamOrPersonBaseDetailSection
createTeamOrPersonBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1560 TeamOrPersonBaseDetailSection section
= new TeamOrPersonBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1561 addAndAdaptSection(parentElement
, section
);
1565 public TeamDetailSection
createTeamDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1566 TeamDetailSection section
= new TeamDetailSection(this, conversation
, parentElement
, null, style
);
1567 addAndAdaptSection(parentElement
, section
);
1571 public PersonDetailSection
createPersonDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1572 PersonDetailSection section
= new PersonDetailSection(this, conversation
, parentElement
, null, style
);
1573 addAndAdaptSection(parentElement
, section
);
1577 public DescriptionDetailSection
createDescriptionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1578 DescriptionDetailSection section
= new DescriptionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1579 addAndAdaptSection(parentElement
, section
);
1583 public DescriptionElementDetailSection
createDescriptionElementDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1584 DescriptionElementDetailSection section
= new DescriptionElementDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1585 addAndAdaptSection(parentElement
, section
);
1589 public ParsingMessagesSection
createParsingMessagesSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1590 ParsingMessagesSection section
= new ParsingMessagesSection(this, conversation
, parentElement
, selectionProvider
, style
);
1591 addAndAdaptSection(parentElement
, section
);
1595 public NonViralNameDetailSection
createNonViralNameDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1596 NonViralNameDetailSection section
= new NonViralNameDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1597 addAndAdaptSection(parentElement
, section
);
1601 public MediaDetailsSection
createMediaDetailsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1602 MediaDetailsSection section
= new MediaDetailsSection(this, conversation
, parentElement
, selectionProvider
, style
);
1603 addAndAdaptSection(parentElement
, section
);
1607 public DerivedUnitFacadeDetailSection
createDerivedUnitFacadeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1608 DerivedUnitFacadeDetailSection section
= new DerivedUnitFacadeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1609 addAndAdaptSection(parentElement
, section
);
1613 public FieldUnitDetailSection
createFieldUnitDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1614 FieldUnitDetailSection section
= new FieldUnitDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1615 addAndAdaptSection(parentElement
, section
);
1619 public GatheringEventDetailSection
createGatheringEventDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1620 GatheringEventDetailSection section
= new GatheringEventDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1621 addAndAdaptSection(parentElement
, section
);
1625 public DerivedUnitBaseDetailSection
createDerivedUnitBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1626 DerivedUnitBaseDetailSection section
= new DerivedUnitBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1627 addAndAdaptSection(parentElement
, section
);
1631 public NaturalLanguageSection
createNaturalLanguageSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1632 NaturalLanguageSection section
= new NaturalLanguageSection(this, conversation
, parentElement
, selectionProvider
, style
);
1633 addAndAdaptSection(parentElement
, section
);
1637 public FeatureDistributionDetailSection
createFeatureDistributionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1638 FeatureDistributionDetailSection section
= new FeatureDistributionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1639 addAndAdaptSection(parentElement
, section
);
1643 public ClassificationDetailSection
createClassificationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1644 ClassificationDetailSection section
= new ClassificationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1645 addAndAdaptSection(parentElement
, section
);
1649 public TaxonNodeDetailSection
createTaxonNodeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1650 TaxonNodeDetailSection section
= new TaxonNodeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1651 addAndAdaptSection(parentElement
, section
);
1655 public PolytomousKeyDetailSection
createPolytomousKeyDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1656 PolytomousKeyDetailSection section
= new PolytomousKeyDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1657 addAndAdaptSection(parentElement
, section
);
1661 public PolytomousKeyNodeDetailSection
createPolytomousKeyNodeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1662 PolytomousKeyNodeDetailSection section
= new PolytomousKeyNodeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1663 addAndAdaptSection(parentElement
, section
);
1667 public InstitutionDetailSection
createInstitutionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1668 InstitutionDetailSection section
= new InstitutionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1669 addAndAdaptSection(parentElement
, section
);
1673 public FieldUnitGeneralDetailSection
createFieldUnitGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1674 FieldUnitGeneralDetailSection section
= new FieldUnitGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1675 addAndAdaptSection(parentElement
, section
);
1679 public DerivedUnitGeneralDetailSection
createDerivedUnitGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1680 DerivedUnitGeneralDetailSection section
= new DerivedUnitGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1681 addAndAdaptSection(parentElement
, section
);
1685 public PreservedSpecimenGeneralDetailSection
createPreservedSpecimenGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1686 PreservedSpecimenGeneralDetailSection section
= new PreservedSpecimenGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1687 addAndAdaptSection(parentElement
, section
);
1691 public TissueSampleGeneralDetailSection
createTissueSampleGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1692 TissueSampleGeneralDetailSection section
= new TissueSampleGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1693 addAndAdaptSection(parentElement
, section
);
1697 public DnaSampleGeneralDetailSection
createDnaSampleGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1698 DnaSampleGeneralDetailSection section
= new DnaSampleGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1699 addAndAdaptSection(parentElement
, section
);
1703 public DnaQualityDetailSection
createDnaQualityDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1704 DnaQualityDetailSection section
= new DnaQualityDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1705 addAndAdaptSection(parentElement
, section
);
1709 public SequenceGeneralDetailSection
createSequenceGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1710 SequenceGeneralDetailSection section
= new SequenceGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1711 addAndAdaptSection(parentElement
, section
);
1715 public SequenceContigFileCollectionDetailSection
createSequenceContigFileCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1716 SequenceContigFileCollectionDetailSection section
= new SequenceContigFileCollectionDetailSection(this, conversation
, parentElement
, style
);
1717 addAndAdaptSection(parentElement
, section
);
1721 public SingleReadPherogramCollectionDetailSection
createSingleReadPherogramCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1722 SingleReadPherogramCollectionDetailSection section
= new SingleReadPherogramCollectionDetailSection(this, conversation
, parentElement
, style
);
1723 addAndAdaptSection(parentElement
, section
);
1727 public SequenceReferenceCollectionDetailSection
createSequenceReferenceCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1728 SequenceReferenceCollectionDetailSection section
= new SequenceReferenceCollectionDetailSection(this, conversation
, parentElement
, style
);
1729 addAndAdaptSection(parentElement
, section
);
1733 public SingleReadGeneralDetailSection
createSingleReadGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1734 SingleReadGeneralDetailSection section
= new SingleReadGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1735 addAndAdaptSection(parentElement
, section
);
1739 public AmplificationGeneralDetailSection
createAmplificationGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1740 AmplificationGeneralDetailSection section
= new AmplificationGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1741 addAndAdaptSection(parentElement
, section
);
1745 public AmplificationPrimerDetailSection
createAmplificationPrimerDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1746 AmplificationPrimerDetailSection section
= new AmplificationPrimerDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1747 addAndAdaptSection(parentElement
, section
);
1751 public AmplificationCloningDetailSection
createAmplificationCloningDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1752 AmplificationCloningDetailSection section
= new AmplificationCloningDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1753 addAndAdaptSection(parentElement
, section
);
1757 public AmplificationGelPhotoCollectionDetailSection
createAmplificationGelPhotoCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1758 AmplificationGelPhotoCollectionDetailSection section
= new AmplificationGelPhotoCollectionDetailSection(this, conversation
, parentElement
, style
);
1759 addAndAdaptSection(parentElement
, section
);
1763 public SpecimenScanGeneralDetailSection
createSpecimenScanGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1764 SpecimenScanGeneralDetailSection section
= new SpecimenScanGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1765 addAndAdaptSection(parentElement
, section
);
1769 public LivingPlantPhotoGeneralDetailSection
createLivingPlantPhotoGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1770 LivingPlantPhotoGeneralDetailSection section
= new LivingPlantPhotoGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1771 addAndAdaptSection(parentElement
, section
);
1775 public MediaSpecimenGeneralDetailSection
createMediaSpecimenGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1776 MediaSpecimenGeneralDetailSection section
= new MediaSpecimenGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1777 addAndAdaptSection(parentElement
, section
);
1781 public HybridDetailSection
createHybridDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1782 HybridDetailSection section
= new HybridDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1783 addAndAdaptSection(parentElement
, section
);
1787 public UserDetailSection
createUserDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1788 UserDetailSection section
= new UserDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1789 addAndAdaptSection(parentElement
, section
);
1793 public GroupDetailSection
createGroupDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1794 GroupDetailSection section
= new GroupDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1795 addAndAdaptSection(parentElement
, section
);
1799 public DeterminationDetailSection
createDeterminationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1800 DeterminationDetailSection section
= new DeterminationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1801 addAndAdaptSection(parentElement
, section
);
1805 public PreservedSpecimenDeterminationDetailSection
createPreservedSpecimenDeterminationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1806 PreservedSpecimenDeterminationDetailSection section
= new PreservedSpecimenDeterminationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1807 addAndAdaptSection(parentElement
, section
);
1811 public TaxonRelationshipDetailSection
createTaxonRelationshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1812 TaxonRelationshipDetailSection section
= new TaxonRelationshipDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1813 addAndAdaptSection(parentElement
, section
);
1817 public ReferencedEntityDetailSection
createReferencedEntityDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1818 ReferencedEntityDetailSection section
= new ReferencedEntityDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1819 addAndAdaptSection(parentElement
, section
);
1823 public TermVocabularyDetailSection
createTermVocabularyDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1824 TermVocabularyDetailSection section
= new TermVocabularyDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1825 addAndAdaptSection(parentElement
, section
);
1829 public GatheringEventDetailSection
createGatheringSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1830 GatheringEventDetailSection section
= new GatheringEventDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1831 addAndAdaptSection(parentElement
, section
);
1835 public NamedAreaDetailSection
createNamedAreaDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1836 NamedAreaDetailSection section
= new NamedAreaDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1837 addAndAdaptSection(parentElement
, section
);
1841 public UseRecordDetailSection
createUseRecordDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1842 UseRecordDetailSection section
= new UseRecordDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1843 addAndAdaptSection(parentElement
, section
);
1847 private void addAndAdaptSection(ICdmFormElement parentElement
, AbstractFormSection
<?
> section
) {
1848 parentElement
.addElement(section
);
1852 //--------DetailElements------------
1854 public UseRecordDetailElement
createUseRecordDetailElement(ICdmFormElement parentElement
){
1855 UseRecordDetailElement element
= new UseRecordDetailElement(this, parentElement
);
1856 addAndAdaptElement(parentElement
, element
);
1860 public DefinedTermDetailElement
<NamedAreaLevel
> createNamedAreaLevelElement(ICdmFormElement parentElement
){
1861 DefinedTermDetailElement
<NamedAreaLevel
> element
= new DefinedTermDetailElement
<NamedAreaLevel
>(this, parentElement
);
1862 addAndAdaptElement(parentElement
, element
);
1866 public eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement
createNamedAreaDetailElement(ICdmFormElement parentElement
){
1867 eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement element
= new eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement(this, parentElement
);
1868 addAndAdaptElement(parentElement
, element
);
1872 public TermVocabularyDetailElement
createTermVocabularyDetailElement(ICdmFormElement parentElement
){
1873 TermVocabularyDetailElement element
= new TermVocabularyDetailElement(this, parentElement
);
1874 addAndAdaptElement(parentElement
, element
);
1878 public ReferenceEntityDetailElement
createReferenceEntityDetailElement(ICdmFormElement parentElement
){
1879 ReferenceEntityDetailElement element
= new ReferenceEntityDetailElement(this, parentElement
);
1880 addAndAdaptElement(parentElement
, element
);
1884 public TaxonRelationshipDetailElement
createTaxonRelationshipDetailElement(ICdmFormElement parentElement
){
1885 TaxonRelationshipDetailElement element
= new TaxonRelationshipDetailElement(this, parentElement
);
1886 addAndAdaptElement(parentElement
, element
);
1890 public GrantedAuthorityDetailElement
createGrantedAuthorityDetailElement(ICdmFormElement parentElement
){
1891 GrantedAuthorityDetailElement element
= new GrantedAuthorityDetailElement(this, parentElement
);
1892 addAndAdaptElement(parentElement
, element
);
1896 public GroupDetailElement
createGroupDetailElement(ICdmFormElement parentElement
){
1897 GroupDetailElement element
= new GroupDetailElement(this, parentElement
);
1898 addAndAdaptElement(parentElement
, element
);
1902 public UserDetailElement
createUserDetailElement(ICdmFormElement parentElement
){
1903 UserDetailElement element
= new UserDetailElement(this, parentElement
);
1904 addAndAdaptElement(parentElement
, element
);
1908 public HybridDetailElement
createHybridDetailElement(ICdmFormElement parentElement
){
1909 HybridDetailElement element
= new HybridDetailElement(this, parentElement
);
1910 addAndAdaptElement(parentElement
, element
);
1914 public InstitutionDetailElement
createInstitutionDetailElement(ICdmFormElement parentElement
){
1915 InstitutionDetailElement element
= new InstitutionDetailElement(this, parentElement
);
1916 addAndAdaptElement(parentElement
, element
);
1920 public PolytomousKeyNodeDetailElement
createPolytomousKeyNodeDetailElement(ICdmFormElement parentElement
){
1921 PolytomousKeyNodeDetailElement element
= new PolytomousKeyNodeDetailElement(this, parentElement
);
1922 addAndAdaptElement(parentElement
, element
);
1926 public PolytomousKeyDetailElement
createPolytomousKeyDetailElement(ICdmFormElement parentElement
){
1927 PolytomousKeyDetailElement element
= new PolytomousKeyDetailElement(this, parentElement
);
1928 addAndAdaptElement(parentElement
, element
);
1932 public CollectionDetailElement
createCollectionDetailElement(ICdmFormElement parentElement
){
1933 CollectionDetailElement element
= new CollectionDetailElement(this, parentElement
);
1934 addAndAdaptElement(parentElement
, element
);
1938 public TaxonNodeDetailElement
createTaxonNodeDetailElement(ICdmFormElement parentElement
){
1939 TaxonNodeDetailElement element
= new TaxonNodeDetailElement(this, parentElement
);
1940 addAndAdaptElement(parentElement
, element
);
1944 public ClassificationDetailElement
createClassificationDetailElement(ICdmFormElement parentElement
){
1945 ClassificationDetailElement element
= new ClassificationDetailElement(this, parentElement
);
1946 addAndAdaptElement(parentElement
, element
);
1950 public FeatureDistributionDetailElement
createFeatureDistributionDetailElement(ICdmFormElement parentElement
){
1951 FeatureDistributionDetailElement element
= new FeatureDistributionDetailElement(this, parentElement
);
1952 addAndAdaptElement(parentElement
, element
);
1956 public NaturalLanguageDetailElement
createNaturalLanguageDetailElement(ICdmFormElement parentElement
){
1957 NaturalLanguageDetailElement element
= new NaturalLanguageDetailElement(this, parentElement
);
1958 addAndAdaptElement(parentElement
, element
);
1962 public DerivedUnitFacadeDetailElement
createDerivedUnitFacadeDetailElement(ICdmFormElement parentElement
){
1963 DerivedUnitFacadeDetailElement element
= new DerivedUnitFacadeDetailElement(this, parentElement
);
1964 addAndAdaptElement(parentElement
, element
);
1968 public NonViralNameDetailElement
createNonViralNameDetailElement(ICdmFormElement parentElement
){
1969 NonViralNameDetailElement element
= new NonViralNameDetailElement(this, parentElement
);
1970 addAndAdaptElement(parentElement
, element
);
1974 public DescriptionElementDetailElement
createDescriptionElementDetailElement(ICdmFormElement parentElement
, int style
){
1975 DescriptionElementDetailElement element
= new DescriptionElementDetailElement(this, parentElement
, style
);
1976 addAndAdaptElement(parentElement
, element
);
1980 public DescriptionDetailElement
createDescriptionDetailElement(ICdmFormElement parentElement
, int style
){
1981 DescriptionDetailElement element
= new DescriptionDetailElement(this, parentElement
, style
);
1982 addAndAdaptElement(parentElement
, element
);
1986 public PersonDetailElement
createPersonDetailElement(ICdmFormElement parentElement
, int style
){
1987 PersonDetailElement element
= new PersonDetailElement(this, parentElement
, style
);
1988 addAndAdaptElement(parentElement
, element
);
1992 public TeamDetailElement
createTeamDetailElement(ICdmFormElement parentElement
, int style
){
1993 TeamDetailElement element
= new TeamDetailElement(this, parentElement
, style
);
1994 addAndAdaptElement(parentElement
, element
);
1998 public AuthorshipDetailElement
createAuthorshipDetailElement(ICdmFormElement parentElement
, int style
){
1999 AuthorshipDetailElement element
= new AuthorshipDetailElement(this, parentElement
, style
);
2000 addAndAdaptElement(parentElement
, element
);
2004 public TaxonBaseDetailElement
createTaxonBaseDetailElement(ICdmFormElement parentElement
, int style
){
2005 TaxonBaseDetailElement element
= new TaxonBaseDetailElement(this, parentElement
, style
);
2006 addAndAdaptElement(parentElement
, element
);
2010 public NameDetailElement
createNameDetailElement(ICdmFormElement parentElement
, int style
){
2011 NameDetailElement element
= new NameDetailElement(this, parentElement
, style
);
2012 addAndAdaptElement(parentElement
, element
);
2016 public ReferenceDetailElement
createReferenceDetailElement(ICdmFormElement parentElement
, int style
){
2017 ReferenceDetailElement element
= new ReferenceDetailElement(this, parentElement
, style
);
2018 addAndAdaptElement(parentElement
, element
);
2022 public NomenclaturalReferenceDetailElement
createNomenclaturalReferenceDetailElement(ICdmFormElement parentElement
, int style
){
2023 NomenclaturalReferenceDetailElement element
= new NomenclaturalReferenceDetailElement(this, parentElement
, style
);
2024 addAndAdaptElement(parentElement
, element
);
2029 public FieldUnitGeneralDetailElement
createFieldUnitGeneralDetailElement(ICdmFormElement parentElement
){
2030 FieldUnitGeneralDetailElement element
= new FieldUnitGeneralDetailElement(this, parentElement
);
2031 addAndAdaptElement(parentElement
, element
);
2035 public DerivedUnitGeneralDetailElement
createDerivedUnitGeneralDetailElement(ICdmFormElement parentElement
){
2036 DerivedUnitGeneralDetailElement element
= new DerivedUnitGeneralDetailElement(this, parentElement
);
2037 addAndAdaptElement(parentElement
, element
);
2041 public PreservedSpecimenGeneralDetailElement
createPreservedSpecimenGeneralDetailElement(ICdmFormElement parentElement
){
2042 PreservedSpecimenGeneralDetailElement element
= new PreservedSpecimenGeneralDetailElement(this, parentElement
);
2043 addAndAdaptElement(parentElement
, element
);
2047 public TissueSampleGeneralDetailElement
createTissueSampleGeneralDetailElement(ICdmFormElement parentElement
){
2048 TissueSampleGeneralDetailElement element
= new TissueSampleGeneralDetailElement(this, parentElement
);
2049 addAndAdaptElement(parentElement
, element
);
2053 public DnaSampleGeneralDetailElement
createDnaSampleGeneralDetailElement(ICdmFormElement parentElement
){
2054 DnaSampleGeneralDetailElement element
= new DnaSampleGeneralDetailElement(this, parentElement
);
2055 addAndAdaptElement(parentElement
, element
);
2059 public DnaQualityDetailElement
createDnaQualityDetailElement(ICdmFormElement parentElement
){
2060 DnaQualityDetailElement element
= new DnaQualityDetailElement(this, parentElement
);
2061 addAndAdaptElement(parentElement
, element
);
2065 public SequenceGeneralDetailElement
createSequenceGeneralDetailElement(ICdmFormElement parentElement
){
2066 SequenceGeneralDetailElement element
= new SequenceGeneralDetailElement(this, parentElement
);
2067 addAndAdaptElement(parentElement
, element
);
2071 public SingleReadGeneralDetailElement
createSingleReadGeneralDetailElement(ICdmFormElement parentElement
){
2072 SingleReadGeneralDetailElement element
= new SingleReadGeneralDetailElement(this, parentElement
);
2073 addAndAdaptElement(parentElement
, element
);
2077 public PrimerGeneralDetailElement
createPrimerGeneralDetailElement(ICdmFormElement parentElement
){
2078 PrimerGeneralDetailElement element
= new PrimerGeneralDetailElement(this, parentElement
);
2079 addAndAdaptElement(parentElement
, element
);
2083 public AmplificationGeneralDetailElement
createAmplificationGeneralDetailElement(ICdmFormElement parentElement
){
2084 AmplificationGeneralDetailElement element
= new AmplificationGeneralDetailElement(this, parentElement
);
2085 addAndAdaptElement(parentElement
, element
);
2089 public AmplificationPrimerDetailElement
createAmplificationPrimerDetailElement(ICdmFormElement parentElement
){
2090 AmplificationPrimerDetailElement element
= new AmplificationPrimerDetailElement(this, parentElement
);
2091 addAndAdaptElement(parentElement
, element
);
2095 public AmplificationCloningDetailElement
createAmplificationCloningDetailElement(ICdmFormElement parentElement
){
2096 AmplificationCloningDetailElement element
= new AmplificationCloningDetailElement(this, parentElement
);
2097 addAndAdaptElement(parentElement
, element
);
2101 public AmplificationGelPhotoDetailElement
createAmplificationGelPhotoDetailElement(ICdmFormElement parentElement
){
2102 AmplificationGelPhotoDetailElement element
= new AmplificationGelPhotoDetailElement(this, parentElement
);
2103 addAndAdaptElement(parentElement
, element
);
2107 public SpecimenScanGeneralDetailElement
createSpecimenScanGeneralDetailElement(ICdmFormElement parentElement
){
2108 SpecimenScanGeneralDetailElement element
= new SpecimenScanGeneralDetailElement(this, parentElement
);
2109 addAndAdaptElement(parentElement
, element
);
2113 public LivingPlantPhotoGeneralDetailElement
createLivingPlantPhotoGeneralDetailElement(ICdmFormElement parentElement
){
2114 LivingPlantPhotoGeneralDetailElement element
= new LivingPlantPhotoGeneralDetailElement(this, parentElement
);
2115 addAndAdaptElement(parentElement
, element
);
2119 public MediaSpecimenGeneralDetailElement
createMediaSpecimenGeneralDetailElement(ICdmFormElement parentElement
){
2120 MediaSpecimenGeneralDetailElement element
= new MediaSpecimenGeneralDetailElement(this, parentElement
);
2121 addAndAdaptElement(parentElement
, element
);
2126 public GatheringEventDetailElement
createGatheringEventDetailElement(ICdmFormElement parentElement
) {
2127 GatheringEventDetailElement element
= new GatheringEventDetailElement(this, parentElement
);
2128 addAndAdaptElement(parentElement
, element
);
2132 public FieldUnitDetailElement
createFieldUnitDetailElement(ICdmFormElement parentElement
) {
2133 FieldUnitDetailElement element
= new FieldUnitDetailElement(this, parentElement
);
2134 addAndAdaptElement(parentElement
, element
);
2139 public DerivedUnitBaseDetailElement
createDerivedUnitBaseDetailElement(ICdmFormElement parentElement
) {
2140 DerivedUnitBaseDetailElement element
= new DerivedUnitBaseDetailElement(this, parentElement
);
2141 addAndAdaptElement(parentElement
, element
);
2145 public PreservedSpecimenDetailElement
createPreservedSpecimenDetailElement(ICdmFormElement parentElement
) {
2146 PreservedSpecimenDetailElement element
= new PreservedSpecimenDetailElement(this, parentElement
);
2147 addAndAdaptElement(parentElement
, element
);
2151 public PreservedSpecimenDeterminationDetailElement
createPreservedSpecimenDeterminationDetailElement(ICdmFormElement parentElement
) {
2152 PreservedSpecimenDeterminationDetailElement element
= new PreservedSpecimenDeterminationDetailElement(this, parentElement
);
2153 addAndAdaptElement(parentElement
, element
);
2157 public DeterminationDetailElement
createDeterminationDetailElement(ICdmFormElement parentElement
) {
2158 DeterminationDetailElement element
= new DeterminationDetailElement(this, parentElement
);
2159 addAndAdaptElement(parentElement
, element
);
2164 * @param parentElement
2167 private void addAndAdaptElement(ICdmFormElement parentElement
, AbstractCdmDetailElement
<?
> element
) {
2169 parentElement
.addElement(element
);
2172 //--------EntityCollectionSection----------
2173 public TeamMemberSection
createTeamMemberSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2174 TeamMemberSection section
= new TeamMemberSection(this, conversation
, parentElement
, style
);
2175 addAndAdaptSection(parentElement
, section
);
2179 public AnnotationSection
createAnnotationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2180 AnnotationSection section
= new AnnotationSection(this, conversation
, parentElement
, style
);
2181 addAndAdaptSection(parentElement
, section
);
2185 public CreditSection
createCreditSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2186 CreditSection section
= new CreditSection(this, conversation
, parentElement
, style
);
2187 addAndAdaptSection(parentElement
, section
);
2191 public DescriptionElementSourceSection
createDescriptionElementSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2192 DescriptionElementSourceSection section
= new DescriptionElementSourceSection(this, conversation
, parentElement
, style
);
2193 addAndAdaptSection(parentElement
, section
);
2197 public ExtensionSection
createExtensionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2198 ExtensionSection section
= new ExtensionSection(this, conversation
, parentElement
, style
);
2199 addAndAdaptSection(parentElement
, section
);
2203 public MarkerSection
createMarkerSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2204 MarkerSection section
= new MarkerSection(this, conversation
, parentElement
, style
);
2205 addAndAdaptSection(parentElement
, section
);
2209 public MediaSection
createMediaSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2210 MediaSection section
= new MediaSection(this, conversation
, parentElement
, style
);
2211 addAndAdaptSection(parentElement
, section
);
2215 public DescriptionElementMediaSection
createDescriptionElementMediaSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2216 DescriptionElementMediaSection section
= new DescriptionElementMediaSection(this, conversation
, parentElement
, style
);
2217 addAndAdaptSection(parentElement
, section
);
2221 public MediaRepresentationSection
createMediaRepresentationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2222 MediaRepresentationSection section
= new MediaRepresentationSection(this, conversation
, parentElement
, style
);
2223 addAndAdaptSection(parentElement
, section
);
2227 public MediaRepresentationPartSection
createMediaRepresentationPartSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2228 MediaRepresentationPartSection section
= new MediaRepresentationPartSection(this, conversation
, parentElement
, style
);
2229 addAndAdaptSection(parentElement
, section
);
2233 public ModifierSection
createModifierSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2234 ModifierSection section
= new ModifierSection(this, conversation
, parentElement
, style
);
2235 addAndAdaptSection(parentElement
, section
);
2239 public NomenclaturalStatusSection
createNomenclaturalStatusSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2240 NomenclaturalStatusSection section
= new NomenclaturalStatusSection(this, conversation
, parentElement
, style
);
2241 addAndAdaptSection(parentElement
, section
);
2245 public NameRelationshipDetailSection
createNameRelationshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2246 NameRelationshipDetailSection section
= new NameRelationshipDetailSection(this, conversation
, parentElement
, style
);
2247 addAndAdaptSection(parentElement
, section
);
2251 public SynonymRelationshipDetailSection
createSynonymRelationshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2252 SynonymRelationshipDetailSection section
= new SynonymRelationshipDetailSection(this, conversation
, parentElement
, style
);
2253 addAndAdaptSection(parentElement
, section
);
2257 public ProtologueSection
createProtologueSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2258 ProtologueSection section
= new ProtologueSection(this, conversation
, parentElement
, style
);
2259 addAndAdaptSection(parentElement
, section
);
2263 public RightsSection
createRightsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2264 RightsSection section
= new RightsSection(this, conversation
, parentElement
, style
);
2265 addAndAdaptSection(parentElement
, section
);
2269 public SourceSection
createSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2270 SourceSection section
= new SourceSection(this, conversation
, parentElement
, style
);
2271 addAndAdaptSection(parentElement
, section
);
2275 public ScopeSection
createScopeSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2276 ScopeSection section
= new ScopeSection(this, conversation
, parentElement
, style
);
2277 addAndAdaptSection(parentElement
, section
);
2281 public DescriptionSourceSection
createDescriptionSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2282 DescriptionSourceSection section
= new DescriptionSourceSection(this, conversation
, parentElement
, style
);
2283 addAndAdaptSection(parentElement
, section
);
2287 public TypeDesignationSection
createTypeDesignationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2288 TypeDesignationSection section
= new TypeDesignationSection(this, conversation
, parentElement
, style
);
2289 addAndAdaptSection(parentElement
, section
);
2293 public StateDataSection
createStateDataSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2294 StateDataSection section
= new StateDataSection(this, conversation
, parentElement
, style
);
2295 addAndAdaptSection(parentElement
, section
);
2299 public StatisticalMeasurementValueSection
createStatisticalMeasurementValueSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2300 StatisticalMeasurementValueSection section
= new StatisticalMeasurementValueSection(this, conversation
, parentElement
, style
);
2301 addAndAdaptSection(parentElement
, section
);
2305 public DescribedSpecimenSection
createDescribedSpecimenSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2306 DescribedSpecimenSection section
= new DescribedSpecimenSection(this, conversation
, parentElement
, style
);
2307 addAndAdaptSection(parentElement
, section
);
2311 public CollectingAreasDetailSection
createCollectingAreasDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2312 CollectingAreasDetailSection section
= new CollectingAreasDetailSection(this, conversation
, parentElement
, style
);
2313 addAndAdaptSection(parentElement
, section
);
2317 public CurrentDeterminationDetailSection
createCurrentDeterminationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2318 CurrentDeterminationDetailSection section
= new CurrentDeterminationDetailSection(this, conversation
, parentElement
, style
);
2319 addAndAdaptSection(parentElement
, section
);
2323 public PreservedSpecimenCurrentDeterminationDetailSection
createPreservedSpecimenCurrentDeterminationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2324 PreservedSpecimenCurrentDeterminationDetailSection section
= new PreservedSpecimenCurrentDeterminationDetailSection(this, conversation
, parentElement
, style
);
2325 addAndAdaptSection(parentElement
, section
);
2329 public DeterminationHistoryDetailSection
createDeterminationHistoryDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2330 DeterminationHistoryDetailSection section
= new DeterminationHistoryDetailSection(this, conversation
, parentElement
, style
);
2331 addAndAdaptSection(parentElement
, section
);
2335 public PreservedSpecimenDeterminationHistoryDetailSection
createPreservedSpecimenDeterminationHistoryDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2336 PreservedSpecimenDeterminationHistoryDetailSection section
= new PreservedSpecimenDeterminationHistoryDetailSection(this, conversation
, parentElement
, style
);
2337 addAndAdaptSection(parentElement
, section
);
2341 public SpecimenCollectionDetailSection
createSpecimenCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2342 SpecimenCollectionDetailSection section
= new SpecimenCollectionDetailSection(this, conversation
, parentElement
, style
);
2343 addAndAdaptSection(parentElement
, section
);
2347 public PreservedSpecimenSourceCollectionDetailSection
createPreservedSpecimenSourceCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2348 PreservedSpecimenSourceCollectionDetailSection section
= new PreservedSpecimenSourceCollectionDetailSection(this, conversation
, parentElement
, style
);
2349 addAndAdaptSection(parentElement
, section
);
2353 public SourceCollectionDetailSection
createSourceCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2354 SourceCollectionDetailSection section
= new SourceCollectionDetailSection(this, conversation
, parentElement
, style
);
2355 addAndAdaptSection(parentElement
, section
);
2359 public GeographicalScopeDetailSection
createGeographicalScopeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2360 GeographicalScopeDetailSection section
= new GeographicalScopeDetailSection(this, conversation
, parentElement
, style
);
2361 addAndAdaptSection(parentElement
, section
);
2365 public ScopeRestrictionSection
createScopeRestrictionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2366 ScopeRestrictionSection section
= new ScopeRestrictionSection(this, conversation
, parentElement
, style
);
2367 addAndAdaptSection(parentElement
, section
);
2371 public MemberDetailSection
createMemberDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2372 MemberDetailSection section
= new MemberDetailSection(this, conversation
, parentElement
, style
);
2373 addAndAdaptSection(parentElement
, section
);
2377 public GrantedAuthorityDetailSection
createGrantedAuthorityDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2378 GrantedAuthorityDetailSection section
= new GrantedAuthorityDetailSection(this, conversation
, parentElement
, style
);
2379 addAndAdaptSection(parentElement
, section
);
2383 public GroupsByUserDetailSection
createGroupsByUserDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2384 GroupsByUserDetailSection section
= new GroupsByUserDetailSection(this, conversation
, parentElement
, style
);
2385 addAndAdaptSection(parentElement
, section
);
2389 public TaxonomicScopeSection
createTaxonomicScopeSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2390 TaxonomicScopeSection section
= new TaxonomicScopeSection(this, conversation
, parentElement
, style
);
2391 addAndAdaptSection(parentElement
, section
);
2397 * createEntityCollectionElement
2400 * @param removeListener
2401 * a {@link org.eclipse.swt.events.SelectionListener} object.
2404 * @param parentElement
2406 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
2408 * @param versionableEntity
2409 * a {@link eu.etaxonomy.cdm.model.common.IVersionableEntity}
2411 * @param backgroundColor
2412 * a {@link org.eclipse.swt.graphics.Color} object.
2414 * {@link eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement}
2417 public AbstractEntityCollectionElement
createEntityCollectionElement(AbstractFormSection parentElement
,
2418 Object versionableEntity
, SelectionListener removeListener
, Color backgroundColor
, int style
) {
2419 AbstractEntityCollectionElement element
= null;
2421 Object entity
= HibernateProxyHelper
.deproxy(versionableEntity
);
2423 if (entity
instanceof Annotation
) {
2424 element
= new AnnotationElement(this, parentElement
, (Annotation
) entity
, removeListener
, style
);
2425 } else if (entity
instanceof Person
) {
2426 element
= new TeamMemberElement(this, parentElement
, (Person
) entity
, removeListener
, style
);
2427 } else if (entity
instanceof Credit
) {
2428 element
= new CreditElement(this, parentElement
, (Credit
) entity
, removeListener
, style
);
2429 } else if (entity
instanceof Extension
) {
2430 element
= new ExtensionElement(this, parentElement
, (Extension
) entity
, removeListener
, style
);
2431 } else if (entity
instanceof Marker
) {
2432 element
= new MarkerElement(this, parentElement
, (Marker
) entity
, removeListener
, style
);
2433 } else if (entity
instanceof Media
) {
2434 element
= new MediaElement(this, parentElement
, (Media
) entity
, removeListener
, style
);
2435 } else if (entity
instanceof MediaRepresentation
) {
2436 element
= new MediaRepresentationElement(this, parentElement
, (MediaRepresentation
) entity
, removeListener
,
2438 } else if (entity
instanceof ImageFile
) {
2439 element
= new ImageFileElement(this, parentElement
, (ImageFile
) entity
, removeListener
, style
);
2440 } else if (entity
instanceof MediaRepresentationPart
) {
2441 element
= new MediaRepresentationPartElement(this, parentElement
, (MediaRepresentationPart
) entity
,
2442 removeListener
, style
);
2443 } else if (entity
instanceof NomenclaturalStatus
) {
2444 element
= new NomenclaturalStatusElement(this, parentElement
, (NomenclaturalStatus
) entity
, removeListener
,
2446 } else if (entity
instanceof Rights
) {
2447 element
= new RightsElement(this, parentElement
, (Rights
) entity
, removeListener
, style
);
2448 } else if (entity
instanceof DescriptionElementSource
) {
2449 element
= new DescriptionElementSourceElement(this, parentElement
, (DescriptionElementSource
) entity
,
2450 removeListener
, style
);
2451 } else if (entity
instanceof IdentifiableSource
) {
2452 element
= new IdentifiableSourceElement(this, parentElement
, (IdentifiableSource
) entity
, removeListener
,
2454 } else if (entity
instanceof DefinedTerm
) {
2455 switch(((DefinedTerm
)entity
).getTermType()) {
2457 element
= new ScopeElement(this,
2459 (DefinedTerm
) entity
,
2464 element
= new ModifierElement(this,
2466 (DefinedTerm
) entity
,
2471 //FIXME : Actually we should through an exception here
2476 } else if (entity
instanceof Reference
) {
2477 if(parentElement
instanceof SequenceReferenceCollectionDetailSection
){
2478 element
= new SequenceReferenceCollectionDetailElement(this, parentElement
, (Reference
) entity
, removeListener
, style
);
2481 element
= new DescriptionSourceElement(this, parentElement
, (Reference
) entity
, removeListener
, style
);
2483 } else if (entity
instanceof NameTypeDesignation
) {
2484 element
= new NameTypeDesignationElement(this, parentElement
, (NameTypeDesignation
) entity
, removeListener
,
2486 } else if (entity
instanceof NameRelationship
) {
2487 element
= new NameRelationshipDetailElement(this, parentElement
, (NameRelationship
) entity
, removeListener
,
2489 } else if (entity
instanceof SynonymRelationship
) {
2490 element
= new SynonymRelationshipDetailElement(this, parentElement
, (SynonymRelationship
) entity
, removeListener
,
2492 } else if (entity
instanceof SpecimenTypeDesignation
) {
2493 element
= new SpecimenTypeDesignationElement(this, parentElement
, (SpecimenTypeDesignation
) entity
,
2494 removeListener
, style
);
2495 } else if (entity
instanceof StateData
) {
2496 element
= new StateDataElement(this, parentElement
, (StateData
) entity
, removeListener
, style
);
2497 } else if (entity
instanceof StatisticalMeasurementValue
) {
2498 element
= new StatisticalMeasurementValueElement(this, parentElement
, (StatisticalMeasurementValue
) entity
,
2499 removeListener
, style
);
2500 } else if (entity
instanceof DerivedUnit
) {
2501 switch(((DerivedUnit
)entity
).getRecordBasis()) {
2502 case LivingSpecimen
:
2503 case PreservedSpecimen
:
2505 element
= new SpecimenCollectionDetailElement(this,
2507 (DerivedUnit
) entity
,
2512 element
= new DerivedUnitElement(this,
2514 (DerivedUnit
) entity
,
2519 } else if (entity
instanceof NamedArea
) {
2520 element
= new NamedAreaDetailElement(this, parentElement
, (NamedArea
) entity
, removeListener
, style
);
2521 } else if (entity
instanceof DeterminationEvent
) {
2522 element
= new DeterminationEventDetailElement(this, parentElement
, (DeterminationEvent
) entity
, removeListener
, style
);
2523 } else if (entity
instanceof User
) {
2524 element
= new MemberDetailElement(this, parentElement
, (User
) entity
, removeListener
, style
);
2525 } else if (entity
instanceof GrantedAuthority
) {
2526 element
= new GrantedAuthorityCollectionElement(this, parentElement
, (GrantedAuthorityImpl
) entity
,
2527 removeListener
, style
);
2528 } else if (entity
instanceof Group
) {
2529 element
= new GroupsByUserDetailElement(this, parentElement
, (Group
) entity
, removeListener
, style
);
2530 } else if (entity
instanceof Taxon
) {
2531 element
= new TaxonDetailElement(this, parentElement
, (Taxon
) entity
, removeListener
, style
);
2532 } else if (entity
instanceof DescriptionElementBase
) {
2533 // this is the special case for protologs, maybe we can do this
2534 // differently when API improves
2535 DescriptionElementBase descriptionElement
= (DescriptionElementBase
) entity
;
2536 if (descriptionElement
.getFeature().equals(Feature
.PROTOLOGUE())) {
2537 element
= new ProtologueElement(this, parentElement
, descriptionElement
, removeListener
, style
);
2541 if (element
== null) {
2542 AbstractUtility
.errorDialog("No element for entity", this,
2543 "Could not generate element for entity. Looks like the case is not handled already. Check implementation. Entity: "
2547 else if (backgroundColor
!= null && !backgroundColor
.isDisposed()) {
2548 element
.setPersistentBackground(backgroundColor
);
2550 parentElement
.addElement(element
);
2558 * Creates a selection element for the given type T.
2561 * <strong>Selection elements not handled by this method:</strong>
2563 * <li>{@link TaxonNodeSelectionElement} see
2564 * {@link #createTaxonNodeSelectionElement(ConversationHolder, ICdmFormElement, String, TaxonNode, int, int)}
2566 * <li>{@link NomenclaturalAuthorTeamSelectionElement} see
2567 * {@link #createNomenclaturalAuthorTeamSelectionElement(ConversationHolder, ICdmFormElement, String, Team, int, int)}
2573 * a {@link Class} object of the type that you want the selection
2575 * @param parentElement
2576 * a {@link ICdmFormElement} object.
2577 * @param labelString
2578 * a {@link String} object.
2579 * @param selectionType
2581 * a {@link ICdmBase} object.
2584 * @param conversation
2585 * a {@link ConversationHolder} object.
2586 * @return a {@link EntitySelectionElement} object.
2588 public <T
extends ICdmBase
> EntitySelectionElement
<T
> createSelectionElement(Class
<T
> clazz
,
2589 ConversationHolder conversation
, ICdmFormElement parentElement
, String labelString
, T selection
, int mode
,
2591 EntitySelectionElement
<T
> element
= new EntitySelectionElement
<T
>(this, conversation
, parentElement
, clazz
,
2592 labelString
, selection
, mode
, style
);
2594 parentElement
.addElement(element
);
2598 public TaxonNodeSelectionElement
createTaxonNodeSelectionElement(ConversationHolder conversation
,
2599 ICdmFormElement parentElement
, String labelString
, TaxonNode selection
, int mode
, int style
) {
2600 TaxonNodeSelectionElement element
= new TaxonNodeSelectionElement(this, conversation
, parentElement
,
2601 labelString
, selection
, mode
, style
);
2603 parentElement
.addElement(element
);
2607 public NomenclaturalAuthorTeamSelectionElement
createNomenclaturalAuthorTeamSelectionElement(
2608 ConversationHolder conversation
, ICdmFormElement parentElement
, String labelString
, Team selection
,
2609 int mode
, int style
) {
2610 NomenclaturalAuthorTeamSelectionElement element
= new NomenclaturalAuthorTeamSelectionElement(this,
2611 conversation
, parentElement
, labelString
, selection
, mode
, style
);
2613 parentElement
.addElement(element
);
2617 /** {@inheritDoc} */
2618 public LabelElement
createLabel(ICdmFormElement parentElement
, String text
) {
2619 LabelElement labelElement
= new LabelElement(this, parentElement
, text
);
2620 adapt(labelElement
);
2621 parentElement
.addElement(labelElement
);
2622 return labelElement
;
2627 * Getter for the field <code>selectionProvider</code>.
2630 * @return a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
2632 public ISelectionProvider
getSelectionProvider() {
2633 return selectionProvider
;
2638 * createDetailedDescriptionDetailElement
2641 * @param parentElement
2642 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
2646 * {@link eu.etaxonomy.cdm.model.description.DescriptionElementBase}
2651 * {@link eu.etaxonomy.taxeditor.ui.section.description.detail.AbstractDetailedDescriptionDetailElement}
2654 public AbstractDetailedDescriptionDetailElement
createDetailedDescriptionDetailElement(
2655 ICdmFormElement parentElement
, DescriptionElementBase entity
, int style
) {
2656 AbstractDetailedDescriptionDetailElement detailedDescriptionElement
= null;
2658 if (entity
instanceof CategoricalData
) {
2659 detailedDescriptionElement
= new CategoricalDataDetailElement(this, parentElement
,
2660 (CategoricalData
) entity
, style
);
2661 } else if (entity
instanceof CommonTaxonName
) {
2662 detailedDescriptionElement
= new CommonNameDetailElement(this, parentElement
, (CommonTaxonName
) entity
,
2664 } else if (entity
instanceof Distribution
) {
2665 detailedDescriptionElement
= new DistributionDetailElement(this, parentElement
, (Distribution
) entity
,
2667 } else if (entity
instanceof IndividualsAssociation
) {
2668 detailedDescriptionElement
= new IndividualsAssociationDetailElement(this, parentElement
,
2669 (IndividualsAssociation
) entity
, style
);
2670 } else if (entity
instanceof QuantitativeData
) {
2671 detailedDescriptionElement
= new QuantitativeDataDetailElement(this, parentElement
,
2672 (QuantitativeData
) entity
, style
);
2673 } else if (entity
instanceof TaxonInteraction
) {
2674 detailedDescriptionElement
= new TaxonInteractionDetailElement(this, parentElement
,
2675 (TaxonInteraction
) entity
, style
);
2676 } else if (entity
instanceof TextData
) {
2677 detailedDescriptionElement
= new TextDataDetailElement(this, parentElement
, (TextData
) entity
, style
);
2679 throw new IllegalStateException("There is no interface for the given description element");
2681 adapt(detailedDescriptionElement
);
2682 parentElement
.addElement(detailedDescriptionElement
);
2683 return detailedDescriptionElement
;
2688 * Creates a styled text as a part of the form.
2693 * the text initial value
2696 * @return the text widget
2698 public StyledText
createStyledText(Composite parent
, String value
, int style
) {
2699 StyledText text
= new StyledText(parent
, getBorderStyle() | style
| getOrientation());
2700 if (value
!= null) {
2701 text
.setText(value
);
2703 text
.setForeground(getColors().getForeground());
2704 text
.setBackground(getColors().getBackground());
2705 // text.addFocusListener(visibilityHandler);
2709 public PreservedSpecimenDetailSection
createPreservedSpecimenDetailsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
2710 PreservedSpecimenDetailSection section
= new PreservedSpecimenDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
2711 addAndAdaptSection(parentElement
, section
);