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
.mvc
.OriginalLabelDataController
;
103 import eu
.etaxonomy
.taxeditor
.ui
.mvc
.OriginalLabelDataElement
;
104 import eu
.etaxonomy
.taxeditor
.ui
.openurl
.IOpenUrlEnabled
;
105 import eu
.etaxonomy
.taxeditor
.ui
.openurl
.OpenUrlSelectorElement
;
106 import eu
.etaxonomy
.taxeditor
.ui
.password
.EditPasswordElement
;
107 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailElement
;
108 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailSection
;
109 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionElement
;
110 import eu
.etaxonomy
.taxeditor
.ui
.section
.EmptyElement
;
111 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.InstitutionDetailElement
;
112 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.InstitutionDetailSection
;
113 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailElement
;
114 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailSection
;
115 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailElement
;
116 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailSection
;
117 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamMemberElement
;
118 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamMemberSection
;
119 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamOrPersonBaseDetailSection
;
120 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.ClassificationDetailElement
;
121 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.ClassificationDetailSection
;
122 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.TaxonNodeDetailElement
;
123 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.TaxonNodeDetailSection
;
124 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferenceEntityDetailElement
;
125 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferencedEntityDetailSection
;
126 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DerivedUnitElement
;
127 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescribedSpecimenSection
;
128 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailElement
;
129 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailSection
;
130 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailElement
;
131 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailSection
;
132 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementMediaSection
;
133 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceElement
;
134 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceSection
;
135 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceElement
;
136 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceSection
;
137 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.MediaDetailsSection
;
138 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ModifierElement
;
139 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ModifierSection
;
140 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageDetailElement
;
141 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageSection
;
142 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeElement
;
143 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeSection
;
144 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StateDataElement
;
145 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StateDataSection
;
146 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StatisticalMeasurementValueElement
;
147 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StatisticalMeasurementValueSection
;
148 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.AbstractDetailedDescriptionDetailElement
;
149 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.CategoricalDataDetailElement
;
150 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.CommonNameDetailElement
;
151 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.DistributionDetailElement
;
152 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.IndividualsAssociationDetailElement
;
153 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.QuantitativeDataDetailElement
;
154 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.TaxonInteractionDetailElement
;
155 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.TextDataDetailElement
;
156 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailElement
;
157 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailSection
;
158 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityCollectionElement
;
159 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailElement
;
160 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailSection
;
161 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailElement
;
162 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailSection
;
163 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailElement
;
164 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailSection
;
165 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.GeographicalScopeDetailSection
;
166 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailElement
;
167 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailSection
;
168 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailElement
;
169 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailSection
;
170 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.ScopeRestrictionSection
;
171 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.TaxonomicScopeSection
;
172 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.ImageFileElement
;
173 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaElement
;
174 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationElement
;
175 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationPartElement
;
176 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationPartSection
;
177 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationSection
;
178 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaSection
;
179 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.AuthorshipDetailElement
;
180 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.AuthorshipDetailSection
;
181 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.HybridDetailElement
;
182 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.HybridDetailSection
;
183 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameDetailElement
;
184 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameDetailSection
;
185 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailElement
;
186 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailSection
;
187 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameTypeDesignationElement
;
188 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusElement
;
189 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusSection
;
190 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailElement
;
191 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailSection
;
192 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.ProtologueElement
;
193 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.ProtologueSection
;
194 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.SpecimenTypeDesignationElement
;
195 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.SynonymRelationshipDetailElement
;
196 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.SynonymRelationshipDetailSection
;
197 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.TypeDesignationSection
;
198 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CollectingAreasDetailSection
;
199 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CollectionDetailElement
;
200 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CurrentDeterminationDetailSection
;
201 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitBaseDetailElement
;
202 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitBaseDetailSection
;
203 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitFacadeDetailElement
;
204 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitFacadeDetailSection
;
205 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitGeneralDetailElement
;
206 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitGeneralDetailSection
;
207 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailElement
;
208 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailSection
;
209 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationEventDetailElement
;
210 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationHistoryDetailSection
;
211 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.EmptySection
;
212 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitDetailElement
;
213 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitDetailSection
;
214 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitGeneralDetailElement
;
215 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitGeneralDetailSection
;
216 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailElement
;
217 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailSection
;
218 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.NamedAreaDetailElement
;
219 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.OriginalLabelDataSection
;
220 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SourceCollectionDetailSection
;
221 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SpecimenCollectionDetailElement
;
222 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SpecimenCollectionDetailSection
;
223 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenCurrentDeterminationDetailSection
;
224 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenDetailElement
;
225 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenDetailSection
;
226 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenDeterminationDetailElement
;
227 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenDeterminationDetailSection
;
228 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenDeterminationHistoryDetailSection
;
229 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenGeneralDetailElement
;
230 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenGeneralDetailSection
;
231 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenSourceCollectionDetailSection
;
232 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationCloningDetailElement
;
233 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationCloningDetailSection
;
234 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationGelPhotoCollectionDetailSection
;
235 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationGelPhotoDetailElement
;
236 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationGeneralDetailElement
;
237 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationGeneralDetailSection
;
238 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationPrimerDetailElement
;
239 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationPrimerDetailSection
;
240 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaQualityDetailElement
;
241 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaQualityDetailSection
;
242 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaSampleGeneralDetailElement
;
243 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaSampleGeneralDetailSection
;
244 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.PrimerGeneralDetailElement
;
245 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceContigFileCollectionDetailSection
;
246 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceGeneralDetailElement
;
247 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceGeneralDetailSection
;
248 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceReferenceCollectionDetailElement
;
249 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceReferenceCollectionDetailSection
;
250 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SingleReadGeneralDetailElement
;
251 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SingleReadGeneralDetailSection
;
252 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SingleReadPherogramCollectionDetailSection
;
253 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.TissueSampleGeneralDetailElement
;
254 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.TissueSampleGeneralDetailSection
;
255 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.media
.LivingPlantPhotoGeneralDetailElement
;
256 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.media
.LivingPlantPhotoGeneralDetailSection
;
257 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.media
.MediaSpecimenGeneralDetailElement
;
258 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.media
.MediaSpecimenGeneralDetailSection
;
259 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.media
.SpecimenScanGeneralDetailElement
;
260 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.media
.SpecimenScanGeneralDetailSection
;
261 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailElement
;
262 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailSection
;
263 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailElement
;
264 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailSection
;
265 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.AnnotationElement
;
266 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.AnnotationSection
;
267 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CdmBaseElement
;
268 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CdmBaseSection
;
269 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CreditElement
;
270 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CreditSection
;
271 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.ExtensionElement
;
272 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.ExtensionSection
;
273 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.HeadlineSection
;
274 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.IdentifiableSourceElement
;
275 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.MarkerElement
;
276 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.MarkerSection
;
277 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.RightsElement
;
278 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.RightsSection
;
279 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.SourceSection
;
280 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.VersionElement
;
281 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.VersionSection
;
282 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessageElement
;
283 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessagesSection
;
284 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailElement
;
285 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailSection
;
286 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonDetailElement
;
287 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailElement
;
288 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailSection
;
289 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailElement
;
290 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailSection
;
291 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailElement
;
292 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailSection
;
293 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailElement
;
294 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailSection
;
295 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.DefinedTermDetailElement
;
296 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.DefinedTermDetailSection
;
297 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.FeatureDetailElement
;
298 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailSection
;
299 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailElement
;
300 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailSection
;
301 import eu
.etaxonomy
.taxeditor
.ui
.selection
.EntitySelectionElement
;
302 import eu
.etaxonomy
.taxeditor
.ui
.selection
.NomenclaturalAuthorTeamSelectionElement
;
303 import eu
.etaxonomy
.taxeditor
.ui
.selection
.TaxonNodeSelectionElement
;
307 * CdmFormFactory class.
311 * @created Feb 24, 2010
314 public class CdmFormFactory
extends FormToolkit
{
316 private BoldFontHolder2 boldFontHolder2
;
317 private MouseListener selectionMouseHandler
;
318 private FocusListener selectionFocusHandler
;
320 private final Set
<SelectionListener
> selectionListenerList
= new HashSet
<SelectionListener
>();
322 private final List
<IPropertyChangeListener
> propertyChangeListeners
= new ArrayList
<IPropertyChangeListener
>();
324 private final int orientation
= Window
.getDefaultOrientation();
325 private ISelectionProvider selectionProvider
;
327 /** Constant <code>EMPTY_SELECTION</code> */
328 public static ISelection EMPTY_SELECTION
= new ISelection() {
330 public boolean isEmpty() {
341 private class SelectionMouseHandler
extends MouseAdapter
{
343 public void mouseDown(MouseEvent e
) {
344 notifySelectionListeners(e
);
354 private class SelectionFocusHandler
extends FocusAdapter
{
356 public void focusGained(FocusEvent e
) {
357 notifySelectionListeners(e
);
361 private void notifySelectionListeners(TypedEvent e
) {
362 Event event
= new Event();
363 event
.widget
= e
.widget
;
364 SelectionEvent selectionEvent
= new SelectionEvent(event
);
366 for (SelectionListener listener
: selectionListenerList
) {
367 listener
.widgetSelected(selectionEvent
);
373 * Constructor for CdmFormFactory.
377 * a {@link org.eclipse.swt.widgets.Display} object.
378 * @param selectionProvider
379 * a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
381 public CdmFormFactory(Display display
, ISelectionProvider selectionProvider
) {
383 this.selectionProvider
= selectionProvider
;
389 * Constructor for CdmFormFactory.
393 * a {@link org.eclipse.swt.widgets.Display} object.
395 public CdmFormFactory(Display display
) {
403 private void init() {
404 boldFontHolder2
= new BoldFontHolder2();
405 selectionMouseHandler
= new SelectionMouseHandler();
406 selectionFocusHandler
= new SelectionFocusHandler();
410 * Creates an instance initialized with the correct selectionProvider
412 * Make sure to remove the instance when the entityComposite disposes via
413 * destroySelectionArbitrator(..)
415 * @param entityElement
416 * a {@link eu.etaxonomy.taxeditor.ui.element.IEntityElement}
418 * @return a {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator}
421 public SelectionArbitrator
createSelectionArbitrator(IEntityElement entityElement
) {
422 SelectionArbitrator selectionArbitrator
= new SelectionArbitrator(entityElement
);
423 selectionArbitrator
.addSelectionProvider(selectionProvider
);
424 selectionProvider
.addSelectionChangedListener(selectionArbitrator
);
425 addSelectionListener(selectionArbitrator
);
426 return selectionArbitrator
;
431 * destroySelectionArbitrator
434 * @param selectionArbitrator
436 * {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator}
439 public void destroySelectionArbitrator(SelectionArbitrator selectionArbitrator
) {
440 removeSelectionListener(selectionArbitrator
);
441 if (selectionProvider
!= null) {
442 selectionProvider
.removeSelectionChangedListener(selectionArbitrator
);
444 AbstractUtility
.error(this.getClass(),
445 "Tried to destroy a selection listener from this factories listeners but was null", null);
451 * Adapts the {@link AbstractCdmFormElement}:<br>
452 * - sets the {@link IPropertyChangeListener}s handled by this class
457 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement}
460 public void adapt(ICdmFormElement formElement
) {
461 formElement
.setPropertyChangeListeners(propertyChangeListeners
);
466 public void adapt(Control control
, boolean trackFocus
, boolean trackKeyboard
) {
468 control
.addFocusListener(selectionFocusHandler
);
470 super.adapt(control
, trackFocus
, trackKeyboard
);
475 public void adapt(Composite composite
) {
476 composite
.addMouseListener(selectionMouseHandler
);
477 super.adapt(composite
);
486 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
489 public void destroyElement(ICdmFormElement formElement
) {
490 // return if element was not initialized
491 if (formElement
== null) {
494 // destroy selection arbitrator, if any
495 if (formElement
instanceof ISelectableElement
) {
496 destroySelectionArbitrator(((ISelectableElement
) formElement
).getSelectionArbitrator());
498 // remove this element form its parents list of elements
499 // ICdmFormElement parentElement = formElement.getParentElement();
500 // if(parentElement != null){
501 // parentElement.removeElement(formElement);
503 // call destroy on child elements recursively
504 for (ICdmFormElement childElement
: formElement
.getElements()) {
505 destroyElement(childElement
);
507 // dispose of the controls
508 for (Control control
: formElement
.getControls()) {
509 // we added the layoutComposite of the parental element as the
510 // layout composite to this formElement
511 // but we do not want to destroy it.
512 if (control
.equals(formElement
.getLayoutComposite())) {
527 * a {@link org.eclipse.swt.widgets.Composite} object.
528 * @return a {@link org.eclipse.swt.widgets.Label} object.
530 public Label
createEmptyCell(Composite parent
) {
531 return this.createLabel(parent
, null);
536 * createMultilineTextWithLabel
540 * a {@link java.lang.String} object.
545 * @param parentElement
546 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
548 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
551 public TextWithLabelElement
createMultilineTextWithLabel(ICdmFormElement parentElement
, String labelString
,
552 int textHeight
, int style
) {
553 TextWithLabelElement element
= new TextWithLabelElement(this, parentElement
, labelString
, "", textHeight
, style
);
555 parentElement
.addElement(element
);
561 * createMultiLanguageTextElement
564 * @param parentElement
565 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
568 * a {@link java.lang.String} object.
569 * @param multilanguageText
570 * a {@link java.util.Map} object.
576 * {@link eu.etaxonomy.taxeditor.ui.element.MultilanguageTextElement}
579 public MultilanguageTextElement
createMultiLanguageTextElement(ICdmFormElement parentElement
, String labelString
,
580 Map
<Language
, LanguageString
> multilanguageText
, int textHeight
, int style
) {
581 MultilanguageTextElement element
= new MultilanguageTextElement(this, parentElement
, labelString
,
582 multilanguageText
, textHeight
, style
);
584 parentElement
.addElement(element
);
588 public KeyStatementElement
createKeyStatementElement(ICdmFormElement parentElement
, String labelString
,
589 KeyStatement keyStatement
, int textHeight
, int style
) {
590 KeyStatementElement element
= new KeyStatementElement(this, parentElement
, labelString
, keyStatement
,
593 parentElement
.addElement(element
);
598 * Creates a text field with a label. The initial content will be the return value of the initalObject's {@link #toString()}
600 * <b>Note</b>: if initialObject is <code>null</code> then an empty string is used.
601 * @param parentElement the parent container
602 * @param labelString the label name
603 * @param initialObject the object from which the <code>toString()</code> method is called
604 * @param style {@link SWT} style constant
605 * @return the created textfield with label
607 public TextWithLabelElement
createTextWithLabelElement(ICdmFormElement parentElement
, String labelString
,
608 Object initialObject
, int style
) {
609 return createTextWithLabelElement(parentElement
, labelString
, initialObject
==null?
"":initialObject
.toString(), style
);
614 * createTextWithLabelElement
617 * @param parentElement
618 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
621 * a {@link java.lang.String} object.
623 * a {@link java.lang.String} object.
626 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
629 public TextWithLabelElement
createTextWithLabelElement(ICdmFormElement parentElement
, String labelString
,
630 String initialText
, int style
) {
631 return createTextWithLabelElement(parentElement
, labelString
, initialText
, null, style
);
635 * createTextWithLabelElement
638 * @param parentElement
639 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
642 * a {@link java.lang.String} object.
644 * a {@link java.lang.String} object.
645 * @param textLimit maximal number of characters allowed
648 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
651 public TextWithLabelElement
createTextWithLabelElement(ICdmFormElement parentElement
, String labelString
,
652 String initialText
, Integer textLimit
, int style
) {
653 if(initialText
==null){
657 TextWithLabelElement element
= new TextWithLabelElement(this, parentElement
, labelString
, initialText
, null, textLimit
, style
);
659 parentElement
.addElement(element
);
663 public UriWithLabelElement
createUriWithLabelElement(ICdmFormElement parentElement
, String labelString
,
664 URI initialUri
, int style
) {
665 UriWithLabelElement element
= new UriWithLabelElement(this, parentElement
, labelString
, initialUri
, null, style
);
667 parentElement
.addElement(element
);
678 public OpenUrlSelectorElement
createOpenUrlSelectorElement(ICdmFormElement parentElement
, String labelString
,
679 IOpenUrlEnabled openUrlEnabled
, int style
) {
680 OpenUrlSelectorElement element
= new OpenUrlSelectorElement(this, parentElement
, labelString
, openUrlEnabled
,
683 parentElement
.addElement(element
);
689 * @param parentElement
691 * @param conversationEnabled
696 public EditPasswordElement
createEditPasswordElement(ICdmFormElement parentElement
, String labelString
,
697 ConversationHolder conversation
, User user
, int style
) {
698 EditPasswordElement element
= new EditPasswordElement(this, parentElement
, labelString
, user
, conversation
);
700 parentElement
.addElement(element
);
706 * createIntegerTextWithLabelElement
709 * @param parentElement
710 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
713 * a {@link java.lang.String} object.
714 * @param initialInteger
715 * a {@link java.lang.Integer} object.
719 * {@link eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement}
722 public NumberWithLabelElement
createNumberTextWithLabelElement(
723 ICdmFormElement parentElement
, String labelString
,
724 Number initialNumber
, int style
) {
725 NumberWithLabelElement element
= new NumberWithLabelElement(this,
726 parentElement
, labelString
, initialNumber
, style
);
728 parentElement
.addElement(element
);
734 * createLanguageStringWithLabelElement
737 * @param parentElement
738 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
741 * a {@link java.lang.String} object.
742 * @param languageString
743 * a {@link eu.etaxonomy.cdm.model.common.LanguageString} object.
747 * {@link eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement}
750 public LanguageStringWithLabelElement
createLanguageStringWithLabelElement(ICdmFormElement parentElement
,
751 String labelString
, LanguageString languageString
, int style
) {
752 LanguageStringWithLabelElement element
= new LanguageStringWithLabelElement(this, parentElement
, labelString
,
753 languageString
, style
);
755 parentElement
.addElement(element
);
761 * createLanguageStringWithLabelElement
764 * @param parentElement
765 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
768 * a {@link java.lang.String} object.
769 * @param languageString
770 * a {@link eu.etaxonomy.cdm.model.common.LanguageString} object.
776 * {@link eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement}
779 public LanguageStringWithLabelElement
createLanguageStringWithLabelElement(ICdmFormElement parentElement
,
780 String labelString
, LanguageString languageString
, int height
, int style
) {
781 LanguageStringWithLabelElement element
= new LanguageStringWithLabelElement(this, parentElement
, labelString
,
782 languageString
, height
, style
);
784 parentElement
.addElement(element
);
793 * @param parentElement
794 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
797 * a {@link java.lang.String} object.
800 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
803 public TextWithLabelElement
createTextElement(ICdmFormElement parentElement
, String initialText
, int style
) {
804 TextWithLabelElement element
= new TextWithLabelElement(this, parentElement
, null, initialText
, null, style
);
806 parentElement
.addElement(element
);
812 * createKeyValueViewerElement
815 * @param parentElement
816 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
819 * a {@link java.lang.String} object.
820 * @param valueHeading
821 * a {@link java.lang.String} object.
823 * a {@link java.util.Map} object.
824 * @return a {@link eu.etaxonomy.taxeditor.ui.element.KeyValueViewerElement}
827 public KeyValueViewerElement
createKeyValueViewerElement(ICdmFormElement parentElement
, String keyHeading
,
828 String valueHeading
, Map
<Object
, Object
> map
) {
829 KeyValueViewerElement element
= new KeyValueViewerElement(this, parentElement
, keyHeading
, valueHeading
, map
);
831 parentElement
.addElement(element
);
837 * createTermComboElement
840 * @deprecated Use {@link #createDefinedTermComboElement(TermType, ICdmFormElement, String, DefinedTermBase, int)} instead
841 * @param termComboType
843 * {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.TermComboType}
845 * @param parentElement
846 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
849 * a {@link java.lang.String} object.
851 * a {@link eu.etaxonomy.cdm.model.common.DefinedTermBase}
855 * @return a {@link eu.etaxonomy.taxeditor.ui.combo.TermComboElement}
859 public <T
extends DefinedTermBase
> TermComboElement
<T
> createTermComboElement(Class
<T
> termComboType
,
860 ICdmFormElement parentElement
, String labelString
, T selection
, int style
) {
861 TermComboElement
<T
> element
= new TermComboElement
<T
>(this, parentElement
, termComboType
, labelString
,
864 parentElement
.addElement(element
);
870 * createTermComboElement
873 * @param termComboType
875 * {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.TermComboType}
877 * @param parentElement
878 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
881 * a {@link java.lang.String} object.
883 * a {@link eu.etaxonomy.cdm.model.common.DefinedTermBase}
887 * @return a {@link eu.etaxonomy.taxeditor.ui.combo.TermComboElement}
891 public <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
893 ICdmFormElement parentElement
,
897 TermComboElement
<T
> element
= new TermComboElement
<T
>(this, parentElement
, termType
, labelString
, selection
, style
);
899 parentElement
.addElement(element
);
905 * createEnumComboElement
908 * @param enumComboType
910 * {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EnumComboType}
912 * @param parentElement
913 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
917 * @return a {@link eu.etaxonomy.taxeditor.ui.term.AbstractEnumComboElement}
920 public <T
extends IEnumTerm
<T
>> EnumComboElement
<T
> createEnumComboElement(
921 Class
<T
> enumComboType
, ICdmFormElement parentElement
,
923 EnumComboElement
<T
> element
= new EnumComboElement
<T
>(this, parentElement
, enumComboType
, style
);
925 parentElement
.addElement(element
);
931 * createBrowserElement
935 * a {@link java.net.URI} object.
938 * @param parentElement
939 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
941 * @return a {@link eu.etaxonomy.taxeditor.ui.element.BrowserElement}
944 public BrowserElement
createBrowserElement(ICdmFormElement parentElement
, URI imageUri
, int style
) {
945 BrowserElement element
= new BrowserElement(this, parentElement
, imageUri
, style
);
947 parentElement
.addElement(element
);
956 * @param parentElement
957 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
960 * a {@link java.net.URI} object.
963 * @return a {@link eu.etaxonomy.taxeditor.ui.element.ImageElement} object.
965 public ImageElement
createImageElement(ICdmFormElement parentElement
, URI imageUri
, int style
) {
966 ImageElement element
= new ImageElement(this, parentElement
, imageUri
, style
);
968 parentElement
.addElement(element
);
974 * createTextActionElement
978 * a {@link java.lang.String} object.
980 * a {@link java.lang.String} object.
983 * @param parentElement
984 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
987 * a {@link java.lang.String} object.
988 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextActionElement}
991 public TextActionElement
createTextActionElement(ICdmFormElement parentElement
, String labelString
,
992 String buttonLabel
, String initialText
, int style
) {
993 TextActionElement element
= new TextActionElement(this, parentElement
, labelString
, buttonLabel
, initialText
,
996 parentElement
.addElement(element
);
1005 * @param parentElement
1006 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1009 * a {@link java.lang.String} object.
1010 * @param initialState
1014 * @return a {@link eu.etaxonomy.taxeditor.ui.element.CheckboxElement}
1017 public CheckboxElement
createCheckbox(ICdmFormElement parentElement
, String label
, Boolean initialState
, int style
) {
1018 if(initialState
==null){
1019 initialState
= Boolean
.FALSE
;
1021 CheckboxElement element
= new CheckboxElement(this, parentElement
, label
, initialState
, style
| orientation
);
1023 parentElement
.addElement(element
);
1028 * Creates a section as a part of the form.
1030 * @return the section widget
1033 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
1036 public Section
adapt(AbstractFormSection section
) {
1037 section
.setMenu(section
.getLayoutComposite().getMenu());
1038 adapt(section
, true, true);
1040 // handle focus and property change events for cdm use
1041 section
.addFocusListener(selectionFocusHandler
);
1042 section
.setPropertyChangeListeners(propertyChangeListeners
);
1044 if (section
.getToggle() != null) {
1045 section
.getToggle().setHoverDecorationColor(getColors().getColor(IFormColors
.TB_TOGGLE_HOVER
));
1046 section
.getToggle().setDecorationColor(getColors().getColor(IFormColors
.TB_TOGGLE
));
1049 section
.setFont(boldFontHolder2
.getBoldFont(section
.getLayoutComposite().getFont()));
1051 if ((section
.getStyle() & ExpandableComposite
.TITLE_BAR
) != 0
1052 || (section
.getStyle() & ExpandableComposite
.SHORT_TITLE_BAR
) != 0) {
1053 getColors().initializeSectionToolBarColors();
1054 section
.setTitleBarBackground(getColors().getColor(IFormColors
.TB_BG
));
1055 section
.setTitleBarBorderColor(getColors().getColor(IFormColors
.TB_BORDER
));
1057 // call setTitleBarForeground regardless as it also sets the label color
1058 section
.setTitleBarForeground(getColors().getColor(IFormColors
.TB_TOGGLE
));
1062 private class BoldFontHolder2
{
1063 private Font normalFont
;
1065 private Font boldFont
;
1067 public BoldFontHolder2() {
1070 public Font
getBoldFont(Font font
) {
1071 createBoldFont(font
);
1075 private void createBoldFont(Font font
) {
1076 if (normalFont
== null || !normalFont
.equals(font
)) {
1080 if (boldFont
== null) {
1081 boldFont
= FormFonts
.getInstance().getBoldFont(getColors().getDisplay(), normalFont
);
1085 public void dispose() {
1086 if (boldFont
!= null) {
1087 FormFonts
.getInstance().markFinished(boldFont
, getColors().getDisplay());
1095 * createToggleableTextField
1098 * @param parentElement
1099 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1101 * @param labelString
1102 * a {@link java.lang.String} object.
1103 * @param initialText
1104 * a {@link java.lang.String} object.
1105 * @param initialState
1109 * @return a {@link eu.etaxonomy.taxeditor.ui.element.ToggleableTextElement}
1112 public ToggleableTextElement
createToggleableTextField(ICdmFormElement parentElement
, String labelString
,
1113 String initialText
, boolean initialState
, int style
) {
1114 ToggleableTextElement element
= new ToggleableTextElement(this, parentElement
, labelString
, initialText
,
1115 initialState
, style
| orientation
);
1117 parentElement
.addElement(element
);
1123 * createTimePeriodElement
1126 * @param parentElement
1127 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1129 * @param labelString
1130 * a {@link java.lang.String} object.
1132 * a {@link eu.etaxonomy.cdm.model.common.TimePeriod} object.
1135 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TimePeriodElement}
1138 public TimePeriodElement
createTimePeriodElement(ICdmFormElement parentElement
, String labelString
,
1139 TimePeriod timePeriod
, int style
) {
1140 TimePeriodElement element
= new TimePeriodElement(this, parentElement
, labelString
, timePeriod
, style
);
1142 parentElement
.addElement(element
);
1148 * createGatheringEventUnitElement
1151 * @param parentElement
1152 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1154 * @param labelString
1155 * a {@link java.lang.String} object.
1157 * a {@link eu.etaxonomy.cdm.model.common.GatheringEvent} object.
1160 * @return a {@link eu.etaxonomy.taxeditor.ui.element.GatheringEventUnitElement}
1163 public GatheringEventUnitElement
createGatheringEventUnitElement(
1164 ICdmFormElement parentElement
,
1166 DerivedUnitFacade gatheringEvent
,
1167 MinMaxTextSection
.UnitType unitType
,
1169 GatheringEventUnitElement element
= new GatheringEventUnitElement(this,
1176 parentElement
.addElement(element
);
1182 * createPointElement
1187 * @param parentElement
1188 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1191 * a {@link eu.etaxonomy.cdm.model.location.Point} object.
1192 * @return a {@link eu.etaxonomy.taxeditor.ui.element.PointElement} object.
1194 public PointElement
createPointElement(ICdmFormElement parentElement
, Point point
, int style
) {
1195 PointElement element
= new PointElement(this, parentElement
, point
, style
);
1197 parentElement
.addElement(element
);
1204 * @param conversationHolder
1206 * @param detailsViewer
1210 public EmptySection
createEmptySection(CdmFormFactory formFactory
, ICdmFormElement parentElement
, int style
) {
1211 EmptySection section
= new EmptySection(formFactory
, parentElement
, style
);
1212 parentElement
.addElement(section
);
1219 * createDateDetailSection
1222 * @param parentElement
1223 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1227 * @return a {@link eu.etaxonomy.taxeditor.ui.element.DateDetailSection}
1230 public DateDetailSection
createDateDetailSection(ICdmFormElement parentElement
, int style
) {
1231 DateDetailSection section
= new DateDetailSection(this, parentElement
, style
);
1232 parentElement
.addElement(section
);
1239 * createDateDetailSection
1242 * @param parentElement
1243 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1247 * @return a {@link eu.etaxonomy.taxeditor.ui.element.MinMaxTextSection}
1250 public MinMaxTextSection
createMinMaxTextSection(ICdmFormElement parentElement
, UnitType unitType
, int style
) {
1251 MinMaxTextSection section
= new MinMaxTextSection(this, parentElement
, unitType
, style
);
1252 parentElement
.addElement(section
);
1259 * createPartialElement
1262 * @param parentElement
1263 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1265 * @param labelString
1266 * a {@link java.lang.String} object.
1268 * a {@link org.joda.time.Partial} object.
1271 * @return a {@link eu.etaxonomy.taxeditor.ui.element.PartialElement}
1274 public PartialElement
createPartialElement(ICdmFormElement parentElement
, String labelString
, Partial partial
,
1276 PartialElement element
= new PartialElement(this, parentElement
, labelString
, style
);
1278 parentElement
.addElement(element
);
1284 * addSelectionListener
1288 * a {@link org.eclipse.swt.events.SelectionListener} object.
1290 public void addSelectionListener(SelectionListener listener
) {
1291 selectionListenerList
.add(listener
);
1296 * removeSelectionListener
1300 * a {@link org.eclipse.swt.events.SelectionListener} object.
1302 public void removeSelectionListener(SelectionListener listener
) {
1303 if (listener
== null) {
1304 AbstractUtility
.error(this.getClass(),
1305 "Tried to remove a selection listener from this factories listeners but was null", null);
1307 selectionListenerList
.remove(listener
);
1313 * addPropertyChangeListener
1317 * a {@link org.eclipse.jface.util.IPropertyChangeListener}
1320 public void addPropertyChangeListener(IPropertyChangeListener listener
) {
1321 if (propertyChangeListeners
.contains(listener
)) {
1324 propertyChangeListeners
.add(0, listener
);
1329 * removePropertyChangeListener
1333 * a {@link org.eclipse.jface.util.IPropertyChangeListener}
1336 public void removePropertyChangeListener(IPropertyChangeListener listener
) {
1337 propertyChangeListeners
.remove(listener
);
1341 * @return the propertyChangeListeners
1343 public List
<IPropertyChangeListener
> getPropertyChangeListeners() {
1344 return propertyChangeListeners
;
1349 * createHorizontalSeparator
1352 * @param parentElement
1353 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1357 * @return a {@link org.eclipse.swt.widgets.Label} object.
1359 public Label
createHorizontalSeparator(ICdmFormElement parentElement
, int style
) {
1360 Label separator
= this.createSeparator(parentElement
.getLayoutComposite(), SWT
.HORIZONTAL
| style
);
1361 separator
.setLayoutData(LayoutConstants
.FILL_HORIZONTALLY());
1367 * createVersionElement
1370 * @param parentElement
1371 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1374 * a {@link eu.etaxonomy.cdm.model.common.VersionableEntity}
1379 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.VersionElement}
1382 public VersionElement
createVersionElement(ICdmFormElement parentElement
, VersionableEntity entity
, int style
) {
1383 VersionElement element
= new VersionElement(this, parentElement
, entity
, style
);
1385 parentElement
.addElement(element
);
1390 * @param cdmBaseSection
1395 public CdmBaseElement
createCdmBaseElement(ICdmFormElement parentElement
, CdmBase entity
, int style
) {
1396 CdmBaseElement element
= new CdmBaseElement(this, parentElement
, entity
, style
);
1398 parentElement
.addElement(element
);
1404 * createVersionSection
1407 * @param parentElement
1408 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1413 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.VersionSection}
1416 public VersionSection
createVersionSection(ICdmFormElement parentElement
, int style
) {
1417 VersionSection section
= new VersionSection(this, parentElement
, style
);
1418 parentElement
.addElement(section
);
1428 public CdmBaseSection
createCdmBaseSection(ICdmFormElement parentElement
, int style
) {
1429 CdmBaseSection section
= new CdmBaseSection(this, parentElement
, style
);
1430 parentElement
.addElement(section
);
1437 * createEmptyElement
1440 * @param parentElement
1441 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1443 * @return a {@link eu.etaxonomy.taxeditor.ui.section.EmptyElement} object.
1445 public EmptyElement
createEmptyElement(ICdmFormElement parentElement
) {
1446 EmptyElement element
= new EmptyElement(this, parentElement
, null, SWT
.NULL
);
1448 parentElement
.addElement(element
);
1454 * createHeadlineSection
1457 * @param parentElement
1458 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1461 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.HeadlineSection}
1464 public HeadlineSection
createHeadlineSection(ICdmFormElement parentElement
) {
1465 HeadlineSection section
= new HeadlineSection(this, parentElement
, SWT
.NULL
);
1466 parentElement
.addElement(section
);
1473 * createParsingMessageElement
1476 * @param parentElement
1477 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1479 * @param parserProblem
1480 * a {@link eu.etaxonomy.cdm.strategy.parser.ParserProblem}
1485 * {@link eu.etaxonomy.taxeditor.ui.section.taxon.ParsingMessageElement}
1488 public ParsingMessageElement
createParsingMessageElement(ICdmFormElement parentElement
,
1489 ParserProblem parserProblem
, int style
) {
1490 ParsingMessageElement element
= new ParsingMessageElement(this, parentElement
, parserProblem
, style
);
1492 parentElement
.addElement(element
);
1496 public AbstractFormSection
createDefinedTermDetailSection(Class definedTermClass
, ConversationHolder conversation
,
1497 ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
1499 AbstractFormSection section
= new DefinedTermDetailSection(this, definedTermClass
, conversation
, parentElement
,
1500 selectionProvider
, style
);
1502 parentElement
.addElement(section
);
1509 * @param definedTermClass
1510 * @param formElement
1514 public AbstractCdmDetailElement
createDefinedTermDetailElement(Class definedTermClass
,
1515 AbstractCdmDetailSection parentElement
, int style
) {
1516 AbstractCdmDetailElement element
= null;
1518 if (NamedArea
.class.isAssignableFrom(definedTermClass
)) {
1519 element
= new eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement(this, parentElement
);
1520 } else if (definedTermClass
.equals(Feature
.class)) {
1521 element
= new FeatureDetailElement(this, parentElement
);
1523 element
= new DefinedTermDetailElement(this, parentElement
);
1527 parentElement
.addElement(element
);
1532 //--------DetailSections---------
1533 public NameDetailSection
createNameDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1534 NameDetailSection section
= new NameDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1535 addAndAdaptSection(parentElement
, section
);
1539 public ReferenceDetailSection
createReferenceDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1540 ReferenceDetailSection section
= new ReferenceDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1541 addAndAdaptSection(parentElement
, section
);
1545 public NomenclaturalReferenceDetailSection
createNomenclaturalReferenceDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1546 NomenclaturalReferenceDetailSection section
= new NomenclaturalReferenceDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1547 addAndAdaptSection(parentElement
, section
);
1551 public TaxonBaseDetailSection
createTaxonBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1552 TaxonBaseDetailSection section
= new TaxonBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1553 addAndAdaptSection(parentElement
, section
);
1557 public AuthorshipDetailSection
createAuthorshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1558 AuthorshipDetailSection section
= new AuthorshipDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1559 addAndAdaptSection(parentElement
, section
);
1563 public TeamOrPersonBaseDetailSection
createTeamOrPersonBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1564 TeamOrPersonBaseDetailSection section
= new TeamOrPersonBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1565 addAndAdaptSection(parentElement
, section
);
1569 public TeamDetailSection
createTeamDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1570 TeamDetailSection section
= new TeamDetailSection(this, conversation
, parentElement
, null, style
);
1571 addAndAdaptSection(parentElement
, section
);
1575 public PersonDetailSection
createPersonDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1576 PersonDetailSection section
= new PersonDetailSection(this, conversation
, parentElement
, null, style
);
1577 addAndAdaptSection(parentElement
, section
);
1581 public DescriptionDetailSection
createDescriptionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1582 DescriptionDetailSection section
= new DescriptionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1583 addAndAdaptSection(parentElement
, section
);
1587 public DescriptionElementDetailSection
createDescriptionElementDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1588 DescriptionElementDetailSection section
= new DescriptionElementDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1589 addAndAdaptSection(parentElement
, section
);
1593 public ParsingMessagesSection
createParsingMessagesSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1594 ParsingMessagesSection section
= new ParsingMessagesSection(this, conversation
, parentElement
, selectionProvider
, style
);
1595 addAndAdaptSection(parentElement
, section
);
1599 public NonViralNameDetailSection
createNonViralNameDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1600 NonViralNameDetailSection section
= new NonViralNameDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1601 addAndAdaptSection(parentElement
, section
);
1605 public MediaDetailsSection
createMediaDetailsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1606 MediaDetailsSection section
= new MediaDetailsSection(this, conversation
, parentElement
, selectionProvider
, style
);
1607 addAndAdaptSection(parentElement
, section
);
1611 public DerivedUnitFacadeDetailSection
createDerivedUnitFacadeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1612 DerivedUnitFacadeDetailSection section
= new DerivedUnitFacadeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1613 addAndAdaptSection(parentElement
, section
);
1617 public FieldUnitDetailSection
createFieldUnitDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1618 FieldUnitDetailSection section
= new FieldUnitDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1619 addAndAdaptSection(parentElement
, section
);
1623 public GatheringEventDetailSection
createGatheringEventDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1624 GatheringEventDetailSection section
= new GatheringEventDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1625 addAndAdaptSection(parentElement
, section
);
1629 public DerivedUnitBaseDetailSection
createDerivedUnitBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1630 DerivedUnitBaseDetailSection section
= new DerivedUnitBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1631 addAndAdaptSection(parentElement
, section
);
1635 public OriginalLabelDataSection
createOriginalLabelDataSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1636 OriginalLabelDataSection section
= new OriginalLabelDataSection(this, conversation
, parentElement
, selectionProvider
, style
);
1637 addAndAdaptSection(parentElement
, section
);
1641 public NaturalLanguageSection
createNaturalLanguageSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1642 NaturalLanguageSection section
= new NaturalLanguageSection(this, conversation
, parentElement
, selectionProvider
, style
);
1643 addAndAdaptSection(parentElement
, section
);
1647 public FeatureDistributionDetailSection
createFeatureDistributionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1648 FeatureDistributionDetailSection section
= new FeatureDistributionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1649 addAndAdaptSection(parentElement
, section
);
1653 public ClassificationDetailSection
createClassificationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1654 ClassificationDetailSection section
= new ClassificationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1655 addAndAdaptSection(parentElement
, section
);
1659 public TaxonNodeDetailSection
createTaxonNodeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1660 TaxonNodeDetailSection section
= new TaxonNodeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1661 addAndAdaptSection(parentElement
, section
);
1665 public PolytomousKeyDetailSection
createPolytomousKeyDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1666 PolytomousKeyDetailSection section
= new PolytomousKeyDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1667 addAndAdaptSection(parentElement
, section
);
1671 public PolytomousKeyNodeDetailSection
createPolytomousKeyNodeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1672 PolytomousKeyNodeDetailSection section
= new PolytomousKeyNodeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1673 addAndAdaptSection(parentElement
, section
);
1677 public InstitutionDetailSection
createInstitutionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1678 InstitutionDetailSection section
= new InstitutionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1679 addAndAdaptSection(parentElement
, section
);
1683 public FieldUnitGeneralDetailSection
createFieldUnitGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1684 FieldUnitGeneralDetailSection section
= new FieldUnitGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1685 addAndAdaptSection(parentElement
, section
);
1689 public DerivedUnitGeneralDetailSection
createDerivedUnitGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1690 DerivedUnitGeneralDetailSection section
= new DerivedUnitGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1691 addAndAdaptSection(parentElement
, section
);
1695 public PreservedSpecimenGeneralDetailSection
createPreservedSpecimenGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1696 PreservedSpecimenGeneralDetailSection section
= new PreservedSpecimenGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1697 addAndAdaptSection(parentElement
, section
);
1701 public TissueSampleGeneralDetailSection
createTissueSampleGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1702 TissueSampleGeneralDetailSection section
= new TissueSampleGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1703 addAndAdaptSection(parentElement
, section
);
1707 public DnaSampleGeneralDetailSection
createDnaSampleGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1708 DnaSampleGeneralDetailSection section
= new DnaSampleGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1709 addAndAdaptSection(parentElement
, section
);
1713 public DnaQualityDetailSection
createDnaQualityDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1714 DnaQualityDetailSection section
= new DnaQualityDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1715 addAndAdaptSection(parentElement
, section
);
1719 public SequenceGeneralDetailSection
createSequenceGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1720 SequenceGeneralDetailSection section
= new SequenceGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1721 addAndAdaptSection(parentElement
, section
);
1725 public SequenceContigFileCollectionDetailSection
createSequenceContigFileCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1726 SequenceContigFileCollectionDetailSection section
= new SequenceContigFileCollectionDetailSection(this, conversation
, parentElement
, style
);
1727 addAndAdaptSection(parentElement
, section
);
1731 public SingleReadPherogramCollectionDetailSection
createSingleReadPherogramCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1732 SingleReadPherogramCollectionDetailSection section
= new SingleReadPherogramCollectionDetailSection(this, conversation
, parentElement
, style
);
1733 addAndAdaptSection(parentElement
, section
);
1737 public SequenceReferenceCollectionDetailSection
createSequenceReferenceCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1738 SequenceReferenceCollectionDetailSection section
= new SequenceReferenceCollectionDetailSection(this, conversation
, parentElement
, style
);
1739 addAndAdaptSection(parentElement
, section
);
1743 public SingleReadGeneralDetailSection
createSingleReadGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1744 SingleReadGeneralDetailSection section
= new SingleReadGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1745 addAndAdaptSection(parentElement
, section
);
1749 public AmplificationGeneralDetailSection
createAmplificationGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1750 AmplificationGeneralDetailSection section
= new AmplificationGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1751 addAndAdaptSection(parentElement
, section
);
1755 public AmplificationPrimerDetailSection
createAmplificationPrimerDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1756 AmplificationPrimerDetailSection section
= new AmplificationPrimerDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1757 addAndAdaptSection(parentElement
, section
);
1761 public AmplificationCloningDetailSection
createAmplificationCloningDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1762 AmplificationCloningDetailSection section
= new AmplificationCloningDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1763 addAndAdaptSection(parentElement
, section
);
1767 public AmplificationGelPhotoCollectionDetailSection
createAmplificationGelPhotoCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1768 AmplificationGelPhotoCollectionDetailSection section
= new AmplificationGelPhotoCollectionDetailSection(this, conversation
, parentElement
, style
);
1769 addAndAdaptSection(parentElement
, section
);
1773 public SpecimenScanGeneralDetailSection
createSpecimenScanGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1774 SpecimenScanGeneralDetailSection section
= new SpecimenScanGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1775 addAndAdaptSection(parentElement
, section
);
1779 public LivingPlantPhotoGeneralDetailSection
createLivingPlantPhotoGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1780 LivingPlantPhotoGeneralDetailSection section
= new LivingPlantPhotoGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1781 addAndAdaptSection(parentElement
, section
);
1785 public MediaSpecimenGeneralDetailSection
createMediaSpecimenGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1786 MediaSpecimenGeneralDetailSection section
= new MediaSpecimenGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1787 addAndAdaptSection(parentElement
, section
);
1791 public HybridDetailSection
createHybridDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1792 HybridDetailSection section
= new HybridDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1793 addAndAdaptSection(parentElement
, section
);
1797 public UserDetailSection
createUserDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1798 UserDetailSection section
= new UserDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1799 addAndAdaptSection(parentElement
, section
);
1803 public GroupDetailSection
createGroupDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1804 GroupDetailSection section
= new GroupDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1805 addAndAdaptSection(parentElement
, section
);
1809 public DeterminationDetailSection
createDeterminationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1810 DeterminationDetailSection section
= new DeterminationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1811 addAndAdaptSection(parentElement
, section
);
1815 public PreservedSpecimenDeterminationDetailSection
createPreservedSpecimenDeterminationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1816 PreservedSpecimenDeterminationDetailSection section
= new PreservedSpecimenDeterminationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1817 addAndAdaptSection(parentElement
, section
);
1821 public TaxonRelationshipDetailSection
createTaxonRelationshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1822 TaxonRelationshipDetailSection section
= new TaxonRelationshipDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1823 addAndAdaptSection(parentElement
, section
);
1827 public ReferencedEntityDetailSection
createReferencedEntityDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1828 ReferencedEntityDetailSection section
= new ReferencedEntityDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1829 addAndAdaptSection(parentElement
, section
);
1833 public TermVocabularyDetailSection
createTermVocabularyDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1834 TermVocabularyDetailSection section
= new TermVocabularyDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1835 addAndAdaptSection(parentElement
, section
);
1839 public GatheringEventDetailSection
createGatheringSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1840 GatheringEventDetailSection section
= new GatheringEventDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1841 addAndAdaptSection(parentElement
, section
);
1845 public NamedAreaDetailSection
createNamedAreaDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1846 NamedAreaDetailSection section
= new NamedAreaDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1847 addAndAdaptSection(parentElement
, section
);
1851 public UseRecordDetailSection
createUseRecordDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1852 UseRecordDetailSection section
= new UseRecordDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1853 addAndAdaptSection(parentElement
, section
);
1857 private void addAndAdaptSection(ICdmFormElement parentElement
, AbstractFormSection
<?
> section
) {
1858 parentElement
.addElement(section
);
1862 //--------DetailElements------------
1864 public UseRecordDetailElement
createUseRecordDetailElement(ICdmFormElement parentElement
){
1865 UseRecordDetailElement element
= new UseRecordDetailElement(this, parentElement
);
1866 addAndAdaptElement(parentElement
, element
);
1870 public DefinedTermDetailElement
<NamedAreaLevel
> createNamedAreaLevelElement(ICdmFormElement parentElement
){
1871 DefinedTermDetailElement
<NamedAreaLevel
> element
= new DefinedTermDetailElement
<NamedAreaLevel
>(this, parentElement
);
1872 addAndAdaptElement(parentElement
, element
);
1876 public eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement
createNamedAreaDetailElement(ICdmFormElement parentElement
){
1877 eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement element
= new eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement(this, parentElement
);
1878 addAndAdaptElement(parentElement
, element
);
1882 public TermVocabularyDetailElement
createTermVocabularyDetailElement(ICdmFormElement parentElement
){
1883 TermVocabularyDetailElement element
= new TermVocabularyDetailElement(this, parentElement
);
1884 addAndAdaptElement(parentElement
, element
);
1888 public ReferenceEntityDetailElement
createReferenceEntityDetailElement(ICdmFormElement parentElement
){
1889 ReferenceEntityDetailElement element
= new ReferenceEntityDetailElement(this, parentElement
);
1890 addAndAdaptElement(parentElement
, element
);
1894 public TaxonRelationshipDetailElement
createTaxonRelationshipDetailElement(ICdmFormElement parentElement
){
1895 TaxonRelationshipDetailElement element
= new TaxonRelationshipDetailElement(this, parentElement
);
1896 addAndAdaptElement(parentElement
, element
);
1900 public GrantedAuthorityDetailElement
createGrantedAuthorityDetailElement(ICdmFormElement parentElement
){
1901 GrantedAuthorityDetailElement element
= new GrantedAuthorityDetailElement(this, parentElement
);
1902 addAndAdaptElement(parentElement
, element
);
1906 public GroupDetailElement
createGroupDetailElement(ICdmFormElement parentElement
){
1907 GroupDetailElement element
= new GroupDetailElement(this, parentElement
);
1908 addAndAdaptElement(parentElement
, element
);
1912 public UserDetailElement
createUserDetailElement(ICdmFormElement parentElement
){
1913 UserDetailElement element
= new UserDetailElement(this, parentElement
);
1914 addAndAdaptElement(parentElement
, element
);
1918 public HybridDetailElement
createHybridDetailElement(ICdmFormElement parentElement
){
1919 HybridDetailElement element
= new HybridDetailElement(this, parentElement
);
1920 addAndAdaptElement(parentElement
, element
);
1924 public InstitutionDetailElement
createInstitutionDetailElement(ICdmFormElement parentElement
){
1925 InstitutionDetailElement element
= new InstitutionDetailElement(this, parentElement
);
1926 addAndAdaptElement(parentElement
, element
);
1930 public PolytomousKeyNodeDetailElement
createPolytomousKeyNodeDetailElement(ICdmFormElement parentElement
){
1931 PolytomousKeyNodeDetailElement element
= new PolytomousKeyNodeDetailElement(this, parentElement
);
1932 addAndAdaptElement(parentElement
, element
);
1936 public PolytomousKeyDetailElement
createPolytomousKeyDetailElement(ICdmFormElement parentElement
){
1937 PolytomousKeyDetailElement element
= new PolytomousKeyDetailElement(this, parentElement
);
1938 addAndAdaptElement(parentElement
, element
);
1942 public CollectionDetailElement
createCollectionDetailElement(ICdmFormElement parentElement
){
1943 CollectionDetailElement element
= new CollectionDetailElement(this, parentElement
);
1944 addAndAdaptElement(parentElement
, element
);
1948 public TaxonNodeDetailElement
createTaxonNodeDetailElement(ICdmFormElement parentElement
){
1949 TaxonNodeDetailElement element
= new TaxonNodeDetailElement(this, parentElement
);
1950 addAndAdaptElement(parentElement
, element
);
1954 public ClassificationDetailElement
createClassificationDetailElement(ICdmFormElement parentElement
){
1955 ClassificationDetailElement element
= new ClassificationDetailElement(this, parentElement
);
1956 addAndAdaptElement(parentElement
, element
);
1960 public FeatureDistributionDetailElement
createFeatureDistributionDetailElement(ICdmFormElement parentElement
){
1961 FeatureDistributionDetailElement element
= new FeatureDistributionDetailElement(this, parentElement
);
1962 addAndAdaptElement(parentElement
, element
);
1966 public NaturalLanguageDetailElement
createNaturalLanguageDetailElement(ICdmFormElement parentElement
){
1967 NaturalLanguageDetailElement element
= new NaturalLanguageDetailElement(this, parentElement
);
1968 addAndAdaptElement(parentElement
, element
);
1972 public DerivedUnitFacadeDetailElement
createDerivedUnitFacadeDetailElement(ICdmFormElement parentElement
){
1973 DerivedUnitFacadeDetailElement element
= new DerivedUnitFacadeDetailElement(this, parentElement
);
1974 addAndAdaptElement(parentElement
, element
);
1978 public NonViralNameDetailElement
createNonViralNameDetailElement(ICdmFormElement parentElement
){
1979 NonViralNameDetailElement element
= new NonViralNameDetailElement(this, parentElement
);
1980 addAndAdaptElement(parentElement
, element
);
1984 public DescriptionElementDetailElement
createDescriptionElementDetailElement(ICdmFormElement parentElement
, int style
){
1985 DescriptionElementDetailElement element
= new DescriptionElementDetailElement(this, parentElement
, style
);
1986 addAndAdaptElement(parentElement
, element
);
1990 public DescriptionDetailElement
createDescriptionDetailElement(ICdmFormElement parentElement
, int style
){
1991 DescriptionDetailElement element
= new DescriptionDetailElement(this, parentElement
, style
);
1992 addAndAdaptElement(parentElement
, element
);
1996 public PersonDetailElement
createPersonDetailElement(ICdmFormElement parentElement
, int style
){
1997 PersonDetailElement element
= new PersonDetailElement(this, parentElement
, style
);
1998 addAndAdaptElement(parentElement
, element
);
2002 public TeamDetailElement
createTeamDetailElement(ICdmFormElement parentElement
, int style
){
2003 TeamDetailElement element
= new TeamDetailElement(this, parentElement
, style
);
2004 addAndAdaptElement(parentElement
, element
);
2008 public AuthorshipDetailElement
createAuthorshipDetailElement(ICdmFormElement parentElement
, int style
){
2009 AuthorshipDetailElement element
= new AuthorshipDetailElement(this, parentElement
, style
);
2010 addAndAdaptElement(parentElement
, element
);
2014 public TaxonBaseDetailElement
createTaxonBaseDetailElement(ICdmFormElement parentElement
, int style
){
2015 TaxonBaseDetailElement element
= new TaxonBaseDetailElement(this, parentElement
, style
);
2016 addAndAdaptElement(parentElement
, element
);
2020 public NameDetailElement
createNameDetailElement(ICdmFormElement parentElement
, int style
){
2021 NameDetailElement element
= new NameDetailElement(this, parentElement
, style
);
2022 addAndAdaptElement(parentElement
, element
);
2026 public ReferenceDetailElement
createReferenceDetailElement(ICdmFormElement parentElement
, int style
){
2027 ReferenceDetailElement element
= new ReferenceDetailElement(this, parentElement
, style
);
2028 addAndAdaptElement(parentElement
, element
);
2032 public NomenclaturalReferenceDetailElement
createNomenclaturalReferenceDetailElement(ICdmFormElement parentElement
, int style
){
2033 NomenclaturalReferenceDetailElement element
= new NomenclaturalReferenceDetailElement(this, parentElement
, style
);
2034 addAndAdaptElement(parentElement
, element
);
2039 public FieldUnitGeneralDetailElement
createFieldUnitGeneralDetailElement(ICdmFormElement parentElement
){
2040 FieldUnitGeneralDetailElement element
= new FieldUnitGeneralDetailElement(this, parentElement
);
2041 addAndAdaptElement(parentElement
, element
);
2045 public DerivedUnitGeneralDetailElement
createDerivedUnitGeneralDetailElement(ICdmFormElement parentElement
){
2046 DerivedUnitGeneralDetailElement element
= new DerivedUnitGeneralDetailElement(this, parentElement
);
2047 addAndAdaptElement(parentElement
, element
);
2051 public PreservedSpecimenGeneralDetailElement
createPreservedSpecimenGeneralDetailElement(ICdmFormElement parentElement
){
2052 PreservedSpecimenGeneralDetailElement element
= new PreservedSpecimenGeneralDetailElement(this, parentElement
);
2053 addAndAdaptElement(parentElement
, element
);
2057 public TissueSampleGeneralDetailElement
createTissueSampleGeneralDetailElement(ICdmFormElement parentElement
){
2058 TissueSampleGeneralDetailElement element
= new TissueSampleGeneralDetailElement(this, parentElement
);
2059 addAndAdaptElement(parentElement
, element
);
2063 public DnaSampleGeneralDetailElement
createDnaSampleGeneralDetailElement(ICdmFormElement parentElement
){
2064 DnaSampleGeneralDetailElement element
= new DnaSampleGeneralDetailElement(this, parentElement
);
2065 addAndAdaptElement(parentElement
, element
);
2069 public DnaQualityDetailElement
createDnaQualityDetailElement(ICdmFormElement parentElement
){
2070 DnaQualityDetailElement element
= new DnaQualityDetailElement(this, parentElement
);
2071 addAndAdaptElement(parentElement
, element
);
2075 public SequenceGeneralDetailElement
createSequenceGeneralDetailElement(ICdmFormElement parentElement
){
2076 SequenceGeneralDetailElement element
= new SequenceGeneralDetailElement(this, parentElement
);
2077 addAndAdaptElement(parentElement
, element
);
2081 public SingleReadGeneralDetailElement
createSingleReadGeneralDetailElement(ICdmFormElement parentElement
){
2082 SingleReadGeneralDetailElement element
= new SingleReadGeneralDetailElement(this, parentElement
);
2083 addAndAdaptElement(parentElement
, element
);
2087 public PrimerGeneralDetailElement
createPrimerGeneralDetailElement(ICdmFormElement parentElement
){
2088 PrimerGeneralDetailElement element
= new PrimerGeneralDetailElement(this, parentElement
);
2089 addAndAdaptElement(parentElement
, element
);
2093 public AmplificationGeneralDetailElement
createAmplificationGeneralDetailElement(ICdmFormElement parentElement
){
2094 AmplificationGeneralDetailElement element
= new AmplificationGeneralDetailElement(this, parentElement
);
2095 addAndAdaptElement(parentElement
, element
);
2099 public AmplificationPrimerDetailElement
createAmplificationPrimerDetailElement(ICdmFormElement parentElement
){
2100 AmplificationPrimerDetailElement element
= new AmplificationPrimerDetailElement(this, parentElement
);
2101 addAndAdaptElement(parentElement
, element
);
2105 public AmplificationCloningDetailElement
createAmplificationCloningDetailElement(ICdmFormElement parentElement
){
2106 AmplificationCloningDetailElement element
= new AmplificationCloningDetailElement(this, parentElement
);
2107 addAndAdaptElement(parentElement
, element
);
2111 public AmplificationGelPhotoDetailElement
createAmplificationGelPhotoDetailElement(ICdmFormElement parentElement
){
2112 AmplificationGelPhotoDetailElement element
= new AmplificationGelPhotoDetailElement(this, parentElement
);
2113 addAndAdaptElement(parentElement
, element
);
2117 public SpecimenScanGeneralDetailElement
createSpecimenScanGeneralDetailElement(ICdmFormElement parentElement
){
2118 SpecimenScanGeneralDetailElement element
= new SpecimenScanGeneralDetailElement(this, parentElement
);
2119 addAndAdaptElement(parentElement
, element
);
2123 public LivingPlantPhotoGeneralDetailElement
createLivingPlantPhotoGeneralDetailElement(ICdmFormElement parentElement
){
2124 LivingPlantPhotoGeneralDetailElement element
= new LivingPlantPhotoGeneralDetailElement(this, parentElement
);
2125 addAndAdaptElement(parentElement
, element
);
2129 public MediaSpecimenGeneralDetailElement
createMediaSpecimenGeneralDetailElement(ICdmFormElement parentElement
){
2130 MediaSpecimenGeneralDetailElement element
= new MediaSpecimenGeneralDetailElement(this, parentElement
);
2131 addAndAdaptElement(parentElement
, element
);
2136 public GatheringEventDetailElement
createGatheringEventDetailElement(ICdmFormElement parentElement
) {
2137 GatheringEventDetailElement element
= new GatheringEventDetailElement(this, parentElement
);
2138 addAndAdaptElement(parentElement
, element
);
2142 public FieldUnitDetailElement
createFieldUnitDetailElement(ICdmFormElement parentElement
) {
2143 FieldUnitDetailElement element
= new FieldUnitDetailElement(this, parentElement
);
2144 addAndAdaptElement(parentElement
, element
);
2149 public DerivedUnitBaseDetailElement
createDerivedUnitBaseDetailElement(ICdmFormElement parentElement
) {
2150 DerivedUnitBaseDetailElement element
= new DerivedUnitBaseDetailElement(this, parentElement
);
2151 addAndAdaptElement(parentElement
, element
);
2155 public PreservedSpecimenDetailElement
createPreservedSpecimenDetailElement(ICdmFormElement parentElement
) {
2156 PreservedSpecimenDetailElement element
= new PreservedSpecimenDetailElement(this, parentElement
);
2157 addAndAdaptElement(parentElement
, element
);
2161 public PreservedSpecimenDeterminationDetailElement
createPreservedSpecimenDeterminationDetailElement(ICdmFormElement parentElement
) {
2162 PreservedSpecimenDeterminationDetailElement element
= new PreservedSpecimenDeterminationDetailElement(this, parentElement
);
2163 addAndAdaptElement(parentElement
, element
);
2167 public DeterminationDetailElement
createDeterminationDetailElement(ICdmFormElement parentElement
) {
2168 DeterminationDetailElement element
= new DeterminationDetailElement(this, parentElement
);
2169 addAndAdaptElement(parentElement
, element
);
2174 * @param parentElement
2177 private void addAndAdaptElement(ICdmFormElement parentElement
, AbstractCdmDetailElement
<?
> element
) {
2179 parentElement
.addElement(element
);
2182 //--------EntityCollectionSection----------
2183 public TeamMemberSection
createTeamMemberSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2184 TeamMemberSection section
= new TeamMemberSection(this, conversation
, parentElement
, style
);
2185 addAndAdaptSection(parentElement
, section
);
2189 public AnnotationSection
createAnnotationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2190 AnnotationSection section
= new AnnotationSection(this, conversation
, parentElement
, style
);
2191 addAndAdaptSection(parentElement
, section
);
2195 public CreditSection
createCreditSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2196 CreditSection section
= new CreditSection(this, conversation
, parentElement
, style
);
2197 addAndAdaptSection(parentElement
, section
);
2201 public DescriptionElementSourceSection
createDescriptionElementSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2202 DescriptionElementSourceSection section
= new DescriptionElementSourceSection(this, conversation
, parentElement
, style
);
2203 addAndAdaptSection(parentElement
, section
);
2207 public ExtensionSection
createExtensionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2208 ExtensionSection section
= new ExtensionSection(this, conversation
, parentElement
, style
);
2209 addAndAdaptSection(parentElement
, section
);
2213 public MarkerSection
createMarkerSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2214 MarkerSection section
= new MarkerSection(this, conversation
, parentElement
, style
);
2215 addAndAdaptSection(parentElement
, section
);
2219 public MediaSection
createMediaSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2220 MediaSection section
= new MediaSection(this, conversation
, parentElement
, style
);
2221 addAndAdaptSection(parentElement
, section
);
2225 public DescriptionElementMediaSection
createDescriptionElementMediaSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2226 DescriptionElementMediaSection section
= new DescriptionElementMediaSection(this, conversation
, parentElement
, style
);
2227 addAndAdaptSection(parentElement
, section
);
2231 public MediaRepresentationSection
createMediaRepresentationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2232 MediaRepresentationSection section
= new MediaRepresentationSection(this, conversation
, parentElement
, style
);
2233 addAndAdaptSection(parentElement
, section
);
2237 public MediaRepresentationPartSection
createMediaRepresentationPartSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2238 MediaRepresentationPartSection section
= new MediaRepresentationPartSection(this, conversation
, parentElement
, style
);
2239 addAndAdaptSection(parentElement
, section
);
2243 public ModifierSection
createModifierSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2244 ModifierSection section
= new ModifierSection(this, conversation
, parentElement
, style
);
2245 addAndAdaptSection(parentElement
, section
);
2249 public NomenclaturalStatusSection
createNomenclaturalStatusSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2250 NomenclaturalStatusSection section
= new NomenclaturalStatusSection(this, conversation
, parentElement
, style
);
2251 addAndAdaptSection(parentElement
, section
);
2255 public NameRelationshipDetailSection
createNameRelationshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2256 NameRelationshipDetailSection section
= new NameRelationshipDetailSection(this, conversation
, parentElement
, style
);
2257 addAndAdaptSection(parentElement
, section
);
2261 public SynonymRelationshipDetailSection
createSynonymRelationshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2262 SynonymRelationshipDetailSection section
= new SynonymRelationshipDetailSection(this, conversation
, parentElement
, style
);
2263 addAndAdaptSection(parentElement
, section
);
2267 public ProtologueSection
createProtologueSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2268 ProtologueSection section
= new ProtologueSection(this, conversation
, parentElement
, style
);
2269 addAndAdaptSection(parentElement
, section
);
2273 public RightsSection
createRightsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2274 RightsSection section
= new RightsSection(this, conversation
, parentElement
, style
);
2275 addAndAdaptSection(parentElement
, section
);
2279 public SourceSection
createSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2280 SourceSection section
= new SourceSection(this, conversation
, parentElement
, style
);
2281 addAndAdaptSection(parentElement
, section
);
2285 public ScopeSection
createScopeSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2286 ScopeSection section
= new ScopeSection(this, conversation
, parentElement
, style
);
2287 addAndAdaptSection(parentElement
, section
);
2291 public DescriptionSourceSection
createDescriptionSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2292 DescriptionSourceSection section
= new DescriptionSourceSection(this, conversation
, parentElement
, style
);
2293 addAndAdaptSection(parentElement
, section
);
2297 public TypeDesignationSection
createTypeDesignationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2298 TypeDesignationSection section
= new TypeDesignationSection(this, conversation
, parentElement
, style
);
2299 addAndAdaptSection(parentElement
, section
);
2303 public StateDataSection
createStateDataSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2304 StateDataSection section
= new StateDataSection(this, conversation
, parentElement
, style
);
2305 addAndAdaptSection(parentElement
, section
);
2309 public StatisticalMeasurementValueSection
createStatisticalMeasurementValueSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2310 StatisticalMeasurementValueSection section
= new StatisticalMeasurementValueSection(this, conversation
, parentElement
, style
);
2311 addAndAdaptSection(parentElement
, section
);
2315 public DescribedSpecimenSection
createDescribedSpecimenSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2316 DescribedSpecimenSection section
= new DescribedSpecimenSection(this, conversation
, parentElement
, style
);
2317 addAndAdaptSection(parentElement
, section
);
2321 public CollectingAreasDetailSection
createCollectingAreasDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2322 CollectingAreasDetailSection section
= new CollectingAreasDetailSection(this, conversation
, parentElement
, style
);
2323 addAndAdaptSection(parentElement
, section
);
2327 public CurrentDeterminationDetailSection
createCurrentDeterminationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2328 CurrentDeterminationDetailSection section
= new CurrentDeterminationDetailSection(this, conversation
, parentElement
, style
);
2329 addAndAdaptSection(parentElement
, section
);
2333 public PreservedSpecimenCurrentDeterminationDetailSection
createPreservedSpecimenCurrentDeterminationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2334 PreservedSpecimenCurrentDeterminationDetailSection section
= new PreservedSpecimenCurrentDeterminationDetailSection(this, conversation
, parentElement
, style
);
2335 addAndAdaptSection(parentElement
, section
);
2339 public DeterminationHistoryDetailSection
createDeterminationHistoryDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2340 DeterminationHistoryDetailSection section
= new DeterminationHistoryDetailSection(this, conversation
, parentElement
, style
);
2341 addAndAdaptSection(parentElement
, section
);
2345 public PreservedSpecimenDeterminationHistoryDetailSection
createPreservedSpecimenDeterminationHistoryDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2346 PreservedSpecimenDeterminationHistoryDetailSection section
= new PreservedSpecimenDeterminationHistoryDetailSection(this, conversation
, parentElement
, style
);
2347 addAndAdaptSection(parentElement
, section
);
2351 public SpecimenCollectionDetailSection
createSpecimenCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2352 SpecimenCollectionDetailSection section
= new SpecimenCollectionDetailSection(this, conversation
, parentElement
, style
);
2353 addAndAdaptSection(parentElement
, section
);
2357 public PreservedSpecimenSourceCollectionDetailSection
createPreservedSpecimenSourceCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2358 PreservedSpecimenSourceCollectionDetailSection section
= new PreservedSpecimenSourceCollectionDetailSection(this, conversation
, parentElement
, style
);
2359 addAndAdaptSection(parentElement
, section
);
2363 public SourceCollectionDetailSection
createSourceCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2364 SourceCollectionDetailSection section
= new SourceCollectionDetailSection(this, conversation
, parentElement
, style
);
2365 addAndAdaptSection(parentElement
, section
);
2369 public GeographicalScopeDetailSection
createGeographicalScopeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2370 GeographicalScopeDetailSection section
= new GeographicalScopeDetailSection(this, conversation
, parentElement
, style
);
2371 addAndAdaptSection(parentElement
, section
);
2375 public ScopeRestrictionSection
createScopeRestrictionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2376 ScopeRestrictionSection section
= new ScopeRestrictionSection(this, conversation
, parentElement
, style
);
2377 addAndAdaptSection(parentElement
, section
);
2381 public MemberDetailSection
createMemberDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2382 MemberDetailSection section
= new MemberDetailSection(this, conversation
, parentElement
, style
);
2383 addAndAdaptSection(parentElement
, section
);
2387 public GrantedAuthorityDetailSection
createGrantedAuthorityDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2388 GrantedAuthorityDetailSection section
= new GrantedAuthorityDetailSection(this, conversation
, parentElement
, style
);
2389 addAndAdaptSection(parentElement
, section
);
2393 public GroupsByUserDetailSection
createGroupsByUserDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2394 GroupsByUserDetailSection section
= new GroupsByUserDetailSection(this, conversation
, parentElement
, style
);
2395 addAndAdaptSection(parentElement
, section
);
2399 public TaxonomicScopeSection
createTaxonomicScopeSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2400 TaxonomicScopeSection section
= new TaxonomicScopeSection(this, conversation
, parentElement
, style
);
2401 addAndAdaptSection(parentElement
, section
);
2407 * createEntityCollectionElement
2410 * @param removeListener
2411 * a {@link org.eclipse.swt.events.SelectionListener} object.
2414 * @param parentElement
2416 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
2418 * @param versionableEntity
2419 * a {@link eu.etaxonomy.cdm.model.common.IVersionableEntity}
2421 * @param backgroundColor
2422 * a {@link org.eclipse.swt.graphics.Color} object.
2424 * {@link eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement}
2427 public AbstractEntityCollectionElement
createEntityCollectionElement(AbstractFormSection parentElement
,
2428 Object versionableEntity
, SelectionListener removeListener
, Color backgroundColor
, int style
) {
2429 AbstractEntityCollectionElement element
= null;
2431 Object entity
= HibernateProxyHelper
.deproxy(versionableEntity
);
2433 if (entity
instanceof Annotation
) {
2434 element
= new AnnotationElement(this, parentElement
, (Annotation
) entity
, removeListener
, style
);
2435 } else if (entity
instanceof Person
) {
2436 element
= new TeamMemberElement(this, parentElement
, (Person
) entity
, removeListener
, style
);
2437 } else if (entity
instanceof Credit
) {
2438 element
= new CreditElement(this, parentElement
, (Credit
) entity
, removeListener
, style
);
2439 } else if (entity
instanceof Extension
) {
2440 element
= new ExtensionElement(this, parentElement
, (Extension
) entity
, removeListener
, style
);
2441 } else if (entity
instanceof Marker
) {
2442 element
= new MarkerElement(this, parentElement
, (Marker
) entity
, removeListener
, style
);
2443 } else if (entity
instanceof Media
) {
2444 element
= new MediaElement(this, parentElement
, (Media
) entity
, removeListener
, style
);
2445 } else if (entity
instanceof MediaRepresentation
) {
2446 element
= new MediaRepresentationElement(this, parentElement
, (MediaRepresentation
) entity
, removeListener
,
2448 } else if (entity
instanceof ImageFile
) {
2449 element
= new ImageFileElement(this, parentElement
, (ImageFile
) entity
, removeListener
, style
);
2450 } else if (entity
instanceof MediaRepresentationPart
) {
2451 element
= new MediaRepresentationPartElement(this, parentElement
, (MediaRepresentationPart
) entity
,
2452 removeListener
, style
);
2453 } else if (entity
instanceof NomenclaturalStatus
) {
2454 element
= new NomenclaturalStatusElement(this, parentElement
, (NomenclaturalStatus
) entity
, removeListener
,
2456 } else if (entity
instanceof Rights
) {
2457 element
= new RightsElement(this, parentElement
, (Rights
) entity
, removeListener
, style
);
2458 } else if (entity
instanceof DescriptionElementSource
) {
2459 element
= new DescriptionElementSourceElement(this, parentElement
, (DescriptionElementSource
) entity
,
2460 removeListener
, style
);
2461 } else if (entity
instanceof IdentifiableSource
) {
2462 element
= new IdentifiableSourceElement(this, parentElement
, (IdentifiableSource
) entity
, removeListener
,
2464 } else if (entity
instanceof DefinedTerm
) {
2465 switch(((DefinedTerm
)entity
).getTermType()) {
2467 element
= new ScopeElement(this,
2469 (DefinedTerm
) entity
,
2474 element
= new ModifierElement(this,
2476 (DefinedTerm
) entity
,
2481 //FIXME : Actually we should through an exception here
2486 } else if (entity
instanceof Reference
) {
2487 if(parentElement
instanceof SequenceReferenceCollectionDetailSection
){
2488 element
= new SequenceReferenceCollectionDetailElement(this, parentElement
, (Reference
) entity
, removeListener
, style
);
2491 element
= new DescriptionSourceElement(this, parentElement
, (Reference
) entity
, removeListener
, style
);
2493 } else if (entity
instanceof NameTypeDesignation
) {
2494 element
= new NameTypeDesignationElement(this, parentElement
, (NameTypeDesignation
) entity
, removeListener
,
2496 } else if (entity
instanceof NameRelationship
) {
2497 element
= new NameRelationshipDetailElement(this, parentElement
, (NameRelationship
) entity
, removeListener
,
2499 } else if (entity
instanceof SynonymRelationship
) {
2500 element
= new SynonymRelationshipDetailElement(this, parentElement
, (SynonymRelationship
) entity
, removeListener
,
2502 } else if (entity
instanceof SpecimenTypeDesignation
) {
2503 element
= new SpecimenTypeDesignationElement(this, parentElement
, (SpecimenTypeDesignation
) entity
,
2504 removeListener
, style
);
2505 } else if (entity
instanceof StateData
) {
2506 element
= new StateDataElement(this, parentElement
, (StateData
) entity
, removeListener
, style
);
2507 } else if (entity
instanceof StatisticalMeasurementValue
) {
2508 element
= new StatisticalMeasurementValueElement(this, parentElement
, (StatisticalMeasurementValue
) entity
,
2509 removeListener
, style
);
2510 } else if (entity
instanceof DerivedUnit
) {
2511 switch(((DerivedUnit
)entity
).getRecordBasis()) {
2512 case LivingSpecimen
:
2513 case PreservedSpecimen
:
2515 element
= new SpecimenCollectionDetailElement(this,
2517 (DerivedUnit
) entity
,
2522 element
= new DerivedUnitElement(this,
2524 (DerivedUnit
) entity
,
2529 } else if (entity
instanceof NamedArea
) {
2530 element
= new NamedAreaDetailElement(this, parentElement
, (NamedArea
) entity
, removeListener
, style
);
2531 } else if (entity
instanceof DeterminationEvent
) {
2532 element
= new DeterminationEventDetailElement(this, parentElement
, (DeterminationEvent
) entity
, removeListener
, style
);
2533 } else if (entity
instanceof User
) {
2534 element
= new MemberDetailElement(this, parentElement
, (User
) entity
, removeListener
, style
);
2535 } else if (entity
instanceof GrantedAuthority
) {
2536 element
= new GrantedAuthorityCollectionElement(this, parentElement
, (GrantedAuthorityImpl
) entity
,
2537 removeListener
, style
);
2538 } else if (entity
instanceof Group
) {
2539 element
= new GroupsByUserDetailElement(this, parentElement
, (Group
) entity
, removeListener
, style
);
2540 } else if (entity
instanceof Taxon
) {
2541 element
= new TaxonDetailElement(this, parentElement
, (Taxon
) entity
, removeListener
, style
);
2542 } else if (entity
instanceof DescriptionElementBase
) {
2543 // this is the special case for protologs, maybe we can do this
2544 // differently when API improves
2545 DescriptionElementBase descriptionElement
= (DescriptionElementBase
) entity
;
2546 if (descriptionElement
.getFeature().equals(Feature
.PROTOLOGUE())) {
2547 element
= new ProtologueElement(this, parentElement
, descriptionElement
, removeListener
, style
);
2551 if (element
== null) {
2552 AbstractUtility
.errorDialog("No element for entity", this,
2553 "Could not generate element for entity. Looks like the case is not handled already. Check implementation. Entity: "
2557 else if (backgroundColor
!= null && !backgroundColor
.isDisposed()) {
2558 element
.setPersistentBackground(backgroundColor
);
2560 parentElement
.addElement(element
);
2568 * Creates a selection element for the given type T.
2571 * <strong>Selection elements not handled by this method:</strong>
2573 * <li>{@link TaxonNodeSelectionElement} see
2574 * {@link #createTaxonNodeSelectionElement(ConversationHolder, ICdmFormElement, String, TaxonNode, int, int)}
2576 * <li>{@link NomenclaturalAuthorTeamSelectionElement} see
2577 * {@link #createNomenclaturalAuthorTeamSelectionElement(ConversationHolder, ICdmFormElement, String, Team, int, int)}
2583 * a {@link Class} object of the type that you want the selection
2585 * @param parentElement
2586 * a {@link ICdmFormElement} object.
2587 * @param labelString
2588 * a {@link String} object.
2589 * @param selectionType
2591 * a {@link ICdmBase} object.
2594 * @param conversation
2595 * a {@link ConversationHolder} object.
2596 * @return a {@link EntitySelectionElement} object.
2598 public <T
extends ICdmBase
> EntitySelectionElement
<T
> createSelectionElement(Class
<T
> clazz
,
2599 ConversationHolder conversation
, ICdmFormElement parentElement
, String labelString
, T selection
, int mode
,
2601 EntitySelectionElement
<T
> element
= new EntitySelectionElement
<T
>(this, conversation
, parentElement
, clazz
,
2602 labelString
, selection
, mode
, style
);
2604 parentElement
.addElement(element
);
2608 public TaxonNodeSelectionElement
createTaxonNodeSelectionElement(ConversationHolder conversation
,
2609 ICdmFormElement parentElement
, String labelString
, TaxonNode selection
, int mode
, int style
) {
2610 TaxonNodeSelectionElement element
= new TaxonNodeSelectionElement(this, conversation
, parentElement
,
2611 labelString
, selection
, mode
, style
);
2613 parentElement
.addElement(element
);
2617 public NomenclaturalAuthorTeamSelectionElement
createNomenclaturalAuthorTeamSelectionElement(
2618 ConversationHolder conversation
, ICdmFormElement parentElement
, String labelString
, Team selection
,
2619 int mode
, int style
) {
2620 NomenclaturalAuthorTeamSelectionElement element
= new NomenclaturalAuthorTeamSelectionElement(this,
2621 conversation
, parentElement
, labelString
, selection
, mode
, style
);
2623 parentElement
.addElement(element
);
2627 /** {@inheritDoc} */
2628 public LabelElement
createLabel(ICdmFormElement parentElement
, String text
) {
2629 LabelElement labelElement
= new LabelElement(this, parentElement
, text
);
2630 adapt(labelElement
);
2631 parentElement
.addElement(labelElement
);
2632 return labelElement
;
2637 * Getter for the field <code>selectionProvider</code>.
2640 * @return a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
2642 public ISelectionProvider
getSelectionProvider() {
2643 return selectionProvider
;
2648 * createDetailedDescriptionDetailElement
2651 * @param parentElement
2652 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
2656 * {@link eu.etaxonomy.cdm.model.description.DescriptionElementBase}
2661 * {@link eu.etaxonomy.taxeditor.ui.section.description.detail.AbstractDetailedDescriptionDetailElement}
2664 public AbstractDetailedDescriptionDetailElement
createDetailedDescriptionDetailElement(
2665 ICdmFormElement parentElement
, DescriptionElementBase entity
, int style
) {
2666 AbstractDetailedDescriptionDetailElement detailedDescriptionElement
= null;
2668 if (entity
instanceof CategoricalData
) {
2669 detailedDescriptionElement
= new CategoricalDataDetailElement(this, parentElement
,
2670 (CategoricalData
) entity
, style
);
2671 } else if (entity
instanceof CommonTaxonName
) {
2672 detailedDescriptionElement
= new CommonNameDetailElement(this, parentElement
, (CommonTaxonName
) entity
,
2674 } else if (entity
instanceof Distribution
) {
2675 detailedDescriptionElement
= new DistributionDetailElement(this, parentElement
, (Distribution
) entity
,
2677 } else if (entity
instanceof IndividualsAssociation
) {
2678 detailedDescriptionElement
= new IndividualsAssociationDetailElement(this, parentElement
,
2679 (IndividualsAssociation
) entity
, style
);
2680 } else if (entity
instanceof QuantitativeData
) {
2681 detailedDescriptionElement
= new QuantitativeDataDetailElement(this, parentElement
,
2682 (QuantitativeData
) entity
, style
);
2683 } else if (entity
instanceof TaxonInteraction
) {
2684 detailedDescriptionElement
= new TaxonInteractionDetailElement(this, parentElement
,
2685 (TaxonInteraction
) entity
, style
);
2686 } else if (entity
instanceof TextData
) {
2687 detailedDescriptionElement
= new TextDataDetailElement(this, parentElement
, (TextData
) entity
, style
);
2689 throw new IllegalStateException("There is no interface for the given description element");
2691 adapt(detailedDescriptionElement
);
2692 parentElement
.addElement(detailedDescriptionElement
);
2693 return detailedDescriptionElement
;
2698 * Creates a styled text as a part of the form.
2703 * the text initial value
2706 * @return the text widget
2708 public StyledText
createStyledText(Composite parent
, String value
, int style
) {
2709 StyledText text
= new StyledText(parent
, getBorderStyle() | style
| getOrientation());
2710 if (value
!= null) {
2711 text
.setText(value
);
2713 text
.setForeground(getColors().getForeground());
2714 text
.setBackground(getColors().getBackground());
2715 // text.addFocusListener(visibilityHandler);
2719 public PreservedSpecimenDetailSection
createPreservedSpecimenDetailsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
2720 PreservedSpecimenDetailSection section
= new PreservedSpecimenDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
2721 addAndAdaptSection(parentElement
, section
);
2726 * @param parentElement
2729 public OriginalLabelDataController
createOriginalLabelDataController(AbstractCdmDetailSection
<DerivedUnitFacade
> parentElement
) {
2730 OriginalLabelDataElement originalLabelDataElement
= new OriginalLabelDataElement(parentElement
.getLayoutComposite(), SWT
.NONE
);
2731 originalLabelDataElement
.initController(this, parentElement
);
2732 OriginalLabelDataController controller
= originalLabelDataElement
.getController();
2733 addAndAdaptElement(parentElement
, controller
);