4 package eu
.etaxonomy
.taxeditor
.ui
.element
;
7 import java
.util
.ArrayList
;
8 import java
.util
.HashSet
;
13 import org
.eclipse
.jface
.util
.IPropertyChangeListener
;
14 import org
.eclipse
.jface
.viewers
.ISelection
;
15 import org
.eclipse
.jface
.viewers
.ISelectionProvider
;
16 import org
.eclipse
.jface
.window
.Window
;
17 import org
.eclipse
.swt
.SWT
;
18 import org
.eclipse
.swt
.custom
.StyledText
;
19 import org
.eclipse
.swt
.events
.FocusAdapter
;
20 import org
.eclipse
.swt
.events
.FocusEvent
;
21 import org
.eclipse
.swt
.events
.FocusListener
;
22 import org
.eclipse
.swt
.events
.MouseAdapter
;
23 import org
.eclipse
.swt
.events
.MouseEvent
;
24 import org
.eclipse
.swt
.events
.MouseListener
;
25 import org
.eclipse
.swt
.events
.SelectionEvent
;
26 import org
.eclipse
.swt
.events
.SelectionListener
;
27 import org
.eclipse
.swt
.events
.TypedEvent
;
28 import org
.eclipse
.swt
.graphics
.Color
;
29 import org
.eclipse
.swt
.graphics
.Font
;
30 import org
.eclipse
.swt
.widgets
.Composite
;
31 import org
.eclipse
.swt
.widgets
.Control
;
32 import org
.eclipse
.swt
.widgets
.Display
;
33 import org
.eclipse
.swt
.widgets
.Event
;
34 import org
.eclipse
.swt
.widgets
.Label
;
35 import org
.eclipse
.ui
.forms
.IFormColors
;
36 import org
.eclipse
.ui
.forms
.widgets
.ExpandableComposite
;
37 import org
.eclipse
.ui
.forms
.widgets
.FormToolkit
;
38 import org
.eclipse
.ui
.forms
.widgets
.Section
;
39 import org
.eclipse
.ui
.internal
.forms
.widgets
.FormFonts
;
40 import org
.joda
.time
.DateTime
;
41 import org
.joda
.time
.Partial
;
42 import org
.springframework
.security
.core
.GrantedAuthority
;
44 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
45 import eu
.etaxonomy
.cdm
.api
.facade
.DerivedUnitFacade
;
46 import eu
.etaxonomy
.cdm
.hibernate
.HibernateProxyHelper
;
47 import eu
.etaxonomy
.cdm
.model
.agent
.Person
;
48 import eu
.etaxonomy
.cdm
.model
.agent
.Team
;
49 import eu
.etaxonomy
.cdm
.model
.common
.Annotation
;
50 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
51 import eu
.etaxonomy
.cdm
.model
.common
.Credit
;
52 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTerm
;
53 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTermBase
;
54 import eu
.etaxonomy
.cdm
.model
.common
.Extension
;
55 import eu
.etaxonomy
.cdm
.model
.common
.GrantedAuthorityImpl
;
56 import eu
.etaxonomy
.cdm
.model
.common
.Group
;
57 import eu
.etaxonomy
.cdm
.model
.common
.ICdmBase
;
58 import eu
.etaxonomy
.cdm
.model
.common
.IEnumTerm
;
59 import eu
.etaxonomy
.cdm
.model
.common
.IdentifiableSource
;
60 import eu
.etaxonomy
.cdm
.model
.common
.Identifier
;
61 import eu
.etaxonomy
.cdm
.model
.common
.Language
;
62 import eu
.etaxonomy
.cdm
.model
.common
.LanguageString
;
63 import eu
.etaxonomy
.cdm
.model
.common
.Marker
;
64 import eu
.etaxonomy
.cdm
.model
.common
.TermType
;
65 import eu
.etaxonomy
.cdm
.model
.common
.TermVocabulary
;
66 import eu
.etaxonomy
.cdm
.model
.common
.TimePeriod
;
67 import eu
.etaxonomy
.cdm
.model
.common
.User
;
68 import eu
.etaxonomy
.cdm
.model
.common
.VersionableEntity
;
69 import eu
.etaxonomy
.cdm
.model
.description
.CategoricalData
;
70 import eu
.etaxonomy
.cdm
.model
.description
.CommonTaxonName
;
71 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionElementBase
;
72 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionElementSource
;
73 import eu
.etaxonomy
.cdm
.model
.description
.Distribution
;
74 import eu
.etaxonomy
.cdm
.model
.description
.Feature
;
75 import eu
.etaxonomy
.cdm
.model
.description
.IndividualsAssociation
;
76 import eu
.etaxonomy
.cdm
.model
.description
.KeyStatement
;
77 import eu
.etaxonomy
.cdm
.model
.description
.QuantitativeData
;
78 import eu
.etaxonomy
.cdm
.model
.description
.StateData
;
79 import eu
.etaxonomy
.cdm
.model
.description
.StatisticalMeasurementValue
;
80 import eu
.etaxonomy
.cdm
.model
.description
.TaxonInteraction
;
81 import eu
.etaxonomy
.cdm
.model
.description
.TextData
;
82 import eu
.etaxonomy
.cdm
.model
.location
.NamedArea
;
83 import eu
.etaxonomy
.cdm
.model
.location
.NamedAreaLevel
;
84 import eu
.etaxonomy
.cdm
.model
.location
.Point
;
85 import eu
.etaxonomy
.cdm
.model
.media
.ImageFile
;
86 import eu
.etaxonomy
.cdm
.model
.media
.Media
;
87 import eu
.etaxonomy
.cdm
.model
.media
.MediaRepresentation
;
88 import eu
.etaxonomy
.cdm
.model
.media
.MediaRepresentationPart
;
89 import eu
.etaxonomy
.cdm
.model
.media
.Rights
;
90 import eu
.etaxonomy
.cdm
.model
.molecular
.DnaSample
;
91 import eu
.etaxonomy
.cdm
.model
.name
.NameRelationship
;
92 import eu
.etaxonomy
.cdm
.model
.name
.NameTypeDesignation
;
93 import eu
.etaxonomy
.cdm
.model
.name
.NomenclaturalStatus
;
94 import eu
.etaxonomy
.cdm
.model
.name
.SpecimenTypeDesignation
;
95 import eu
.etaxonomy
.cdm
.model
.occurrence
.DerivedUnit
;
96 import eu
.etaxonomy
.cdm
.model
.occurrence
.DeterminationEvent
;
97 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
98 import eu
.etaxonomy
.cdm
.model
.taxon
.SynonymRelationship
;
99 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
100 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonNode
;
101 import eu
.etaxonomy
.cdm
.strategy
.parser
.ParserProblem
;
102 import eu
.etaxonomy
.taxeditor
.model
.MessagingUtils
;
103 import eu
.etaxonomy
.taxeditor
.ui
.combo
.EnumComboElement
;
104 import eu
.etaxonomy
.taxeditor
.ui
.combo
.TermComboElement
;
105 import eu
.etaxonomy
.taxeditor
.ui
.element
.MinMaxTextSection
.UnitType
;
106 import eu
.etaxonomy
.taxeditor
.ui
.mvc
.element
.DateElement
;
107 import eu
.etaxonomy
.taxeditor
.ui
.openurl
.IOpenUrlEnabled
;
108 import eu
.etaxonomy
.taxeditor
.ui
.openurl
.OpenUrlSelectorElement
;
109 import eu
.etaxonomy
.taxeditor
.ui
.password
.EditPasswordElement
;
110 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailElement
;
111 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailSection
;
112 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionElement
;
113 import eu
.etaxonomy
.taxeditor
.ui
.section
.EmptyElement
;
114 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.InstitutionDetailElement
;
115 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.InstitutionDetailSection
;
116 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailElement
;
117 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailSection
;
118 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailElement
;
119 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailSection
;
120 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamMemberElement
;
121 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamMemberSection
;
122 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamOrPersonBaseDetailSection
;
123 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.ClassificationDetailElement
;
124 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.ClassificationDetailSection
;
125 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.TaxonNodeDetailElement
;
126 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.TaxonNodeDetailSection
;
127 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferenceEntityDetailElement
;
128 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferencedEntityDetailSection
;
129 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DerivedUnitElement
;
130 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescribedSpecimenSection
;
131 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailElement
;
132 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailSection
;
133 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailElement
;
134 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailSection
;
135 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementMediaSection
;
136 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceElement
;
137 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceSection
;
138 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceElement
;
139 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceSection
;
140 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.MediaDetailsSection
;
141 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ModifierElement
;
142 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ModifierSection
;
143 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageDetailElement
;
144 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageSection
;
145 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeElement
;
146 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeSection
;
147 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StateDataElement
;
148 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StateDataSection
;
149 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StatisticalMeasurementValueElement
;
150 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StatisticalMeasurementValueSection
;
151 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.AbstractDetailedDescriptionDetailElement
;
152 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.CategoricalDataDetailElement
;
153 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.CommonNameDetailElement
;
154 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.DistributionDetailElement
;
155 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.IndividualsAssociationDetailElement
;
156 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.QuantitativeDataDetailElement
;
157 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.TaxonInteractionDetailElement
;
158 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.TextDataDetailElement
;
159 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailElement
;
160 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailSection
;
161 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityCollectionElement
;
162 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailElement
;
163 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailSection
;
164 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailElement
;
165 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailSection
;
166 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailElement
;
167 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailSection
;
168 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.GeographicalScopeDetailSection
;
169 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailElement
;
170 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailSection
;
171 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailElement
;
172 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailSection
;
173 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.ScopeRestrictionSection
;
174 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.TaxonomicScopeSection
;
175 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.ImageFileElement
;
176 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaDetailElement
;
177 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaMetaElement
;
178 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationElement
;
179 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationPartElement
;
180 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationPartSection
;
181 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationSection
;
182 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaSection
;
183 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.AuthorshipDetailElement
;
184 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.AuthorshipDetailSection
;
185 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.HybridDetailElement
;
186 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.HybridDetailSection
;
187 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameDetailElement
;
188 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameDetailSection
;
189 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailElement
;
190 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailSection
;
191 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameTypeDesignationElement
;
192 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusElement
;
193 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusSection
;
194 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailElement
;
195 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailSection
;
196 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.ProtologueElement
;
197 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.ProtologueSection
;
198 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.SpecimenTypeDesignationElement
;
199 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.SynonymRelationshipDetailElement
;
200 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.SynonymRelationshipDetailSection
;
201 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.TypeDesignationSection
;
202 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CollectingAreasDetailSection
;
203 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CollectionDetailElement
;
204 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CurrentDeterminationDetailSection
;
205 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitBaseDetailElement
;
206 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitBaseDetailSection
;
207 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitFacadeDetailElement
;
208 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitFacadeDetailSection
;
209 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitGeneralDetailElement
;
210 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitGeneralDetailSection
;
211 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailElement
;
212 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailSection
;
213 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationEventDetailElement
;
214 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationHistoryDetailSection
;
215 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.EmptySection
;
216 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitDetailElement
;
217 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitDetailSection
;
218 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitGeneralDetailElement
;
219 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitGeneralDetailSection
;
220 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailElement
;
221 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailSection
;
222 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.NamedAreaDetailElement
;
223 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.OriginalLabelDataSection
;
224 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SourceCollectionDetailSection
;
225 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SpecimenCollectionDetailElement
;
226 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SpecimenCollectionDetailSection
;
227 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenCurrentDeterminationDetailSection
;
228 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenDetailElement
;
229 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenDetailSection
;
230 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenDeterminationDetailElement
;
231 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenDeterminationDetailSection
;
232 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenDeterminationHistoryDetailSection
;
233 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenGeneralDetailElement
;
234 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenGeneralDetailSection
;
235 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenSourceCollectionDetailSection
;
236 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationCloningDetailElement
;
237 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationCloningDetailSection
;
238 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationGelPhotoCollectionDetailSection
;
239 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationGelPhotoDetailElement
;
240 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationGeneralDetailElement
;
241 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationGeneralDetailSection
;
242 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationPrimerDetailElement
;
243 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationPrimerDetailSection
;
244 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.CurrentSampleDesignationDetailSection
;
245 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaQualityDetailElement
;
246 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaQualityDetailSection
;
247 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaSampleGeneralDetailElement
;
248 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaSampleGeneralDetailSection
;
249 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.PrimerGeneralDetailElement
;
250 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SampleDesignationDetailElement
;
251 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SampleDesignationDetailSection
;
252 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SampleDesignationHistoryDetailSection
;
253 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SampleDesignationTextDetailElement
;
254 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceContigFileCollectionDetailSection
;
255 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceGeneralDetailElement
;
256 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceGeneralDetailSection
;
257 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceReferenceCollectionDetailElement
;
258 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceReferenceCollectionDetailSection
;
259 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SingleReadGeneralDetailElement
;
260 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SingleReadGeneralDetailSection
;
261 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SingleReadPherogramCollectionDetailSection
;
262 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.TissueSampleGeneralDetailElement
;
263 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.TissueSampleGeneralDetailSection
;
264 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.media
.MediaSpecimenGeneralDetailElement
;
265 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.media
.MediaSpecimenGeneralDetailSection
;
266 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailElement
;
267 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailSection
;
268 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailElement
;
269 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailSection
;
270 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.AnnotationElement
;
271 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.AnnotationSection
;
272 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CdmBaseElement
;
273 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CdmBaseSection
;
274 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CreditElement
;
275 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CreditSection
;
276 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.ExtensionElement
;
277 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.ExtensionSection
;
278 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.HeadlineSection
;
279 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.IdentifiableSourceElement
;
280 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.MarkerElement
;
281 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.MarkerSection
;
282 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.RightsElement
;
283 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.RightsSection
;
284 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.SourceSection
;
285 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.VersionElement
;
286 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.VersionSection
;
287 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessageElement
;
288 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessagesSection
;
289 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailElement
;
290 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailSection
;
291 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonDetailElement
;
292 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailElement
;
293 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailSection
;
294 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailElement
;
295 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailSection
;
296 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailElement
;
297 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailSection
;
298 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailElement
;
299 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailSection
;
300 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.DefinedTermDetailElement
;
301 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.DefinedTermDetailSection
;
302 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.FeatureDetailElement
;
303 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailSection
;
304 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailElement
;
305 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailSection
;
306 import eu
.etaxonomy
.taxeditor
.ui
.selection
.EntitySelectionElement
;
307 import eu
.etaxonomy
.taxeditor
.ui
.selection
.NomenclaturalAuthorTeamSelectionElement
;
308 import eu
.etaxonomy
.taxeditor
.ui
.selection
.TaxonNodeSelectionElement
;
312 * CdmFormFactory class.
316 * @created Feb 24, 2010
319 public class CdmFormFactory
extends FormToolkit
{
321 private BoldFontHolder2 boldFontHolder2
;
322 private MouseListener selectionMouseHandler
;
323 private FocusListener selectionFocusHandler
;
325 private final Set
<SelectionListener
> selectionListenerList
= new HashSet
<SelectionListener
>();
327 private final List
<IPropertyChangeListener
> propertyChangeListeners
= new ArrayList
<IPropertyChangeListener
>();
329 private final int orientation
= Window
.getDefaultOrientation();
330 private ISelectionProvider selectionProvider
;
332 /** Constant <code>EMPTY_SELECTION</code> */
333 public static ISelection EMPTY_SELECTION
= new ISelection() {
335 public boolean isEmpty() {
346 private class SelectionMouseHandler
extends MouseAdapter
{
348 public void mouseDown(MouseEvent e
) {
349 notifySelectionListeners(e
);
359 private class SelectionFocusHandler
extends FocusAdapter
{
361 public void focusGained(FocusEvent e
) {
362 notifySelectionListeners(e
);
366 private void notifySelectionListeners(TypedEvent e
) {
367 Event event
= new Event();
368 event
.widget
= e
.widget
;
369 SelectionEvent selectionEvent
= new SelectionEvent(event
);
371 for (SelectionListener listener
: selectionListenerList
) {
372 listener
.widgetSelected(selectionEvent
);
378 * Constructor for CdmFormFactory.
382 * a {@link org.eclipse.swt.widgets.Display} object.
383 * @param selectionProvider
384 * a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
386 public CdmFormFactory(Display display
, ISelectionProvider selectionProvider
) {
388 this.selectionProvider
= selectionProvider
;
394 * Constructor for CdmFormFactory.
398 * a {@link org.eclipse.swt.widgets.Display} object.
400 public CdmFormFactory(Display display
) {
408 private void init() {
409 boldFontHolder2
= new BoldFontHolder2();
410 selectionMouseHandler
= new SelectionMouseHandler();
411 selectionFocusHandler
= new SelectionFocusHandler();
415 * Creates an instance initialized with the correct selectionProvider
417 * Make sure to remove the instance when the entityComposite disposes via
418 * destroySelectionArbitrator(..)
420 * @param entityElement
421 * a {@link eu.etaxonomy.taxeditor.ui.element.IEntityElement}
423 * @return a {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator}
426 public SelectionArbitrator
createSelectionArbitrator(IEntityElement entityElement
) {
427 SelectionArbitrator selectionArbitrator
= new SelectionArbitrator(entityElement
);
428 selectionArbitrator
.addSelectionProvider(selectionProvider
);
429 selectionProvider
.addSelectionChangedListener(selectionArbitrator
);
430 addSelectionListener(selectionArbitrator
);
431 return selectionArbitrator
;
436 * destroySelectionArbitrator
439 * @param selectionArbitrator
441 * {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator}
444 public void destroySelectionArbitrator(SelectionArbitrator selectionArbitrator
) {
445 removeSelectionListener(selectionArbitrator
);
446 if (selectionProvider
!= null) {
447 selectionProvider
.removeSelectionChangedListener(selectionArbitrator
);
449 MessagingUtils
.error(this.getClass(),
450 "Tried to destroy a selection listener from this factories listeners but was null", null);
456 * Adapts the {@link AbstractCdmFormElement}:<br>
457 * - sets the {@link IPropertyChangeListener}s handled by this class
462 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement}
465 public void adapt(ICdmFormElement formElement
) {
466 formElement
.setPropertyChangeListeners(propertyChangeListeners
);
471 public void adapt(Control control
, boolean trackFocus
, boolean trackKeyboard
) {
473 control
.addFocusListener(selectionFocusHandler
);
475 super.adapt(control
, trackFocus
, trackKeyboard
);
480 public void adapt(Composite composite
) {
481 composite
.addMouseListener(selectionMouseHandler
);
482 super.adapt(composite
);
491 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
494 public void destroyElement(ICdmFormElement formElement
) {
495 // return if element was not initialized
496 if (formElement
== null) {
499 // destroy selection arbitrator, if any
500 if (formElement
instanceof ISelectableElement
) {
501 destroySelectionArbitrator(((ISelectableElement
) formElement
).getSelectionArbitrator());
503 // remove this element form its parents list of elements
504 // ICdmFormElement parentElement = formElement.getParentElement();
505 // if(parentElement != null){
506 // parentElement.removeElement(formElement);
508 // call destroy on child elements recursively
509 for (ICdmFormElement childElement
: formElement
.getElements()) {
510 destroyElement(childElement
);
512 // dispose of the controls
513 for (Control control
: formElement
.getControls()) {
514 // we added the layoutComposite of the parental element as the
515 // layout composite to this formElement
516 // but we do not want to destroy it.
517 if (control
.equals(formElement
.getLayoutComposite())) {
532 * a {@link org.eclipse.swt.widgets.Composite} object.
533 * @return a {@link org.eclipse.swt.widgets.Label} object.
535 public Label
createEmptyCell(Composite parent
) {
536 return this.createLabel(parent
, null);
541 * createMultiLanguageTextElement
544 * @param parentElement
545 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
548 * a {@link java.lang.String} object.
549 * @param multilanguageText
550 * a {@link java.util.Map} object.
556 * {@link eu.etaxonomy.taxeditor.ui.element.MultilanguageTextElement}
559 public MultilanguageTextElement
createMultiLanguageTextElement(ICdmFormElement parentElement
, String labelString
,
560 Map
<Language
, LanguageString
> multilanguageText
, int textHeight
, int style
) {
561 MultilanguageTextElement element
= new MultilanguageTextElement(this, parentElement
, labelString
,
562 multilanguageText
, textHeight
, style
);
564 parentElement
.addElement(element
);
568 public KeyStatementElement
createKeyStatementElement(ICdmFormElement parentElement
, String labelString
,
569 KeyStatement keyStatement
, int textHeight
, int style
) {
570 KeyStatementElement element
= new KeyStatementElement(this, parentElement
, labelString
, keyStatement
,
573 parentElement
.addElement(element
);
578 * Creates a text field with a label. The initial content will be the return value of the initalObject's {@link #toString()}
580 * <b>Note</b>: if initialObject is <code>null</code> then an empty string is used.
581 * @param parentElement the parent container
582 * @param labelString the label name
583 * @param initialObject the object from which the <code>toString()</code> method is called
584 * @param style {@link SWT} style constant
585 * @return the created textfield with label
587 public TextWithLabelElement
createTextWithLabelElement(ICdmFormElement parentElement
, String labelString
,
588 Object initialObject
, int style
) {
589 return createTextWithLabelElement(parentElement
, labelString
, initialObject
==null?
"":initialObject
.toString(), style
);
594 * createTextWithLabelElement
597 * @param parentElement
598 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
601 * a {@link java.lang.String} object.
603 * a {@link java.lang.String} object.
606 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
609 public TextWithLabelElement
createTextWithLabelElement(ICdmFormElement parentElement
, String labelString
,
610 String initialText
, int style
) {
611 return createTextWithLabelElement(parentElement
, labelString
, initialText
, null, style
);
615 * createTextWithLabelElement
618 * @param parentElement
619 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
622 * a {@link java.lang.String} object.
624 * a {@link java.lang.String} object.
625 * @param textLimit maximal number of characters allowed
628 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
631 public TextWithLabelElement
createTextWithLabelElement(ICdmFormElement parentElement
, String labelString
,
632 String initialText
, Integer textLimit
, int style
) {
633 if(initialText
==null){
637 TextWithLabelElement element
= new TextWithLabelElement(this, parentElement
, labelString
, initialText
, null,
640 parentElement
.addElement(element
);
644 public TextWithLabelElement
createMultiLineTextWithLabel(ICdmFormElement parentElement
, String labelString
,
645 int textHeight
, int style
) {
646 TextWithLabelElement element
= new TextWithLabelElement(this, parentElement
, labelString
, "", textHeight
, true, style
);
648 parentElement
.addElement(element
);
652 public UriWithLabelElement
createUriWithLabelElement(ICdmFormElement parentElement
, String labelString
,
653 URI initialUri
, int style
) {
654 UriWithLabelElement element
= new UriWithLabelElement(this, parentElement
, labelString
, initialUri
, null, style
);
656 parentElement
.addElement(element
);
667 public OpenUrlSelectorElement
createOpenUrlSelectorElement(ICdmFormElement parentElement
, String labelString
,
668 IOpenUrlEnabled openUrlEnabled
, int style
) {
669 OpenUrlSelectorElement element
= new OpenUrlSelectorElement(this, parentElement
, labelString
, openUrlEnabled
,
672 parentElement
.addElement(element
);
678 * @param parentElement
680 * @param conversationEnabled
685 public EditPasswordElement
createEditPasswordElement(ICdmFormElement parentElement
, String labelString
,
686 ConversationHolder conversation
, User user
, int style
) {
687 EditPasswordElement element
= new EditPasswordElement(this, parentElement
, labelString
, user
, conversation
);
689 parentElement
.addElement(element
);
695 * createIntegerTextWithLabelElement
698 * @param parentElement
699 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
702 * a {@link java.lang.String} object.
703 * @param initialInteger
704 * a {@link java.lang.Integer} object.
708 * {@link eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement}
711 public NumberWithLabelElement
createNumberTextWithLabelElement(
712 ICdmFormElement parentElement
, String labelString
,
713 Number initialNumber
, int style
) {
714 NumberWithLabelElement element
= new NumberWithLabelElement(this,
715 parentElement
, labelString
, initialNumber
, style
);
717 parentElement
.addElement(element
);
721 public LanguageStringWithLabelElement
createLanguageStringWithLabelElement(ICdmFormElement parentElement
,
722 String labelString
, LanguageString languageString
, int style
) {
723 return createLanguageStringWithLabelElement(parentElement
, labelString
, languageString
, null, false, style
);
726 public LanguageStringWithLabelElement
createLanguageStringWithLabelElement(ICdmFormElement parentElement
,
727 String labelString
, LanguageString languageString
, Integer height
, boolean isMultiLine
, int style
) {
728 LanguageStringWithLabelElement element
= new LanguageStringWithLabelElement(this, parentElement
, labelString
,
729 languageString
, height
, isMultiLine
, style
);
731 parentElement
.addElement(element
);
737 * createKeyValueViewerElement
740 * @param parentElement
741 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
744 * a {@link java.lang.String} object.
745 * @param valueHeading
746 * a {@link java.lang.String} object.
748 * a {@link java.util.Map} object.
749 * @return a {@link eu.etaxonomy.taxeditor.ui.element.KeyValueViewerElement}
752 public KeyValueViewerElement
createKeyValueViewerElement(ICdmFormElement parentElement
, String keyHeading
,
753 String valueHeading
, Map
<Object
, Object
> map
) {
754 KeyValueViewerElement element
= new KeyValueViewerElement(this, parentElement
, keyHeading
, valueHeading
, map
);
756 parentElement
.addElement(element
);
762 * createTermComboElement
765 * @deprecated Use {@link #createDefinedTermComboElement(TermType, ICdmFormElement, String, DefinedTermBase, int)} instead
766 * @param termComboType
768 * {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.TermComboType}
770 * @param parentElement
771 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
774 * a {@link java.lang.String} object.
776 * a {@link eu.etaxonomy.cdm.model.common.DefinedTermBase}
780 * @return a {@link eu.etaxonomy.taxeditor.ui.combo.TermComboElement}
784 public <T
extends DefinedTermBase
> TermComboElement
<T
> createTermComboElement(Class
<T
> termComboType
,
785 ICdmFormElement parentElement
, String labelString
, T selection
, int style
) {
786 TermComboElement
<T
> element
= new TermComboElement
<T
>(this, parentElement
, termComboType
, labelString
,
789 parentElement
.addElement(element
);
795 * createTermComboElement
798 * @param termComboType
800 * {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.TermComboType}
802 * @param parentElement
803 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
806 * a {@link java.lang.String} object.
808 * a {@link eu.etaxonomy.cdm.model.common.DefinedTermBase}
812 * @return a {@link eu.etaxonomy.taxeditor.ui.combo.TermComboElement}
816 public <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
818 ICdmFormElement parentElement
,
822 TermComboElement
<T
> element
= new TermComboElement
<T
>(this, parentElement
, termType
, labelString
, selection
, style
);
824 parentElement
.addElement(element
);
830 * createTermComboElement
833 * @param termComboType
835 * {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.TermComboType}
837 * @param parentElement
838 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
841 * a {@link java.lang.String} object.
843 * a {@link eu.etaxonomy.cdm.model.common.DefinedTermBase}
847 * @return a {@link eu.etaxonomy.taxeditor.ui.combo.TermComboElement}
851 public <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
852 TermVocabulary
<?
> termVocabulary
,
853 ICdmFormElement parentElement
,
857 TermComboElement
<T
> element
= new TermComboElement
<T
>(this, parentElement
, termVocabulary
, labelString
, selection
, style
);
859 parentElement
.addElement(element
);
865 * createEnumComboElement
868 * @param enumComboType
870 * {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EnumComboType}
872 * @param parentElement
873 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
877 * @return a {@link eu.etaxonomy.taxeditor.ui.term.AbstractEnumComboElement}
880 public <T
extends IEnumTerm
<T
>> EnumComboElement
<T
> createEnumComboElement(
881 Class
<T
> enumComboType
, ICdmFormElement parentElement
,
883 EnumComboElement
<T
> element
= new EnumComboElement
<T
>(this, parentElement
, enumComboType
, style
);
885 parentElement
.addElement(element
);
891 * createBrowserElement
895 * a {@link java.net.URI} object.
898 * @param parentElement
899 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
901 * @return a {@link eu.etaxonomy.taxeditor.ui.element.BrowserElement}
904 public BrowserElement
createBrowserElement(ICdmFormElement parentElement
, URI imageUri
, int style
) {
905 BrowserElement element
= new BrowserElement(this, parentElement
, imageUri
, style
);
907 parentElement
.addElement(element
);
916 * @param parentElement
917 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
920 * a {@link java.net.URI} object.
923 * @return a {@link eu.etaxonomy.taxeditor.ui.element.ImageElement} object.
925 public ImageElement
createImageElement(ICdmFormElement parentElement
, URI imageUri
, int style
) {
926 ImageElement element
= new ImageElement(this, parentElement
, imageUri
, style
);
928 parentElement
.addElement(element
);
934 * createTextActionElement
938 * a {@link java.lang.String} object.
940 * a {@link java.lang.String} object.
943 * @param parentElement
944 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
947 * a {@link java.lang.String} object.
948 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextActionElement}
951 public TextActionElement
createTextActionElement(ICdmFormElement parentElement
, String labelString
,
952 String buttonLabel
, String initialText
, int style
) {
953 TextActionElement element
= new TextActionElement(this, parentElement
, labelString
, buttonLabel
, initialText
,
956 parentElement
.addElement(element
);
965 * @param parentElement
966 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
969 * a {@link java.lang.String} object.
970 * @param initialState
974 * @return a {@link eu.etaxonomy.taxeditor.ui.element.CheckboxElement}
977 public CheckboxElement
createCheckbox(ICdmFormElement parentElement
, String label
, Boolean initialState
, int style
) {
978 if(initialState
==null){
979 initialState
= Boolean
.FALSE
;
981 CheckboxElement element
= new CheckboxElement(this, parentElement
, label
, initialState
, style
| orientation
);
983 parentElement
.addElement(element
);
988 * Creates a section as a part of the form.
990 * @return the section widget
993 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
996 public Section
adapt(AbstractFormSection section
) {
997 section
.setMenu(section
.getLayoutComposite().getMenu());
998 adapt(section
, true, true);
1000 // handle focus and property change events for cdm use
1001 section
.addFocusListener(selectionFocusHandler
);
1002 section
.setPropertyChangeListeners(propertyChangeListeners
);
1004 if (section
.getToggle() != null) {
1005 section
.getToggle().setHoverDecorationColor(getColors().getColor(IFormColors
.TB_TOGGLE_HOVER
));
1006 section
.getToggle().setDecorationColor(getColors().getColor(IFormColors
.TB_TOGGLE
));
1009 section
.setFont(boldFontHolder2
.getBoldFont(section
.getLayoutComposite().getFont()));
1011 if ((section
.getStyle() & ExpandableComposite
.TITLE_BAR
) != 0
1012 || (section
.getStyle() & ExpandableComposite
.SHORT_TITLE_BAR
) != 0) {
1013 getColors().initializeSectionToolBarColors();
1014 section
.setTitleBarBackground(getColors().getColor(IFormColors
.TB_BG
));
1015 section
.setTitleBarBorderColor(getColors().getColor(IFormColors
.TB_BORDER
));
1017 // call setTitleBarForeground regardless as it also sets the label color
1018 section
.setTitleBarForeground(getColors().getColor(IFormColors
.TB_TOGGLE
));
1022 private class BoldFontHolder2
{
1023 private Font normalFont
;
1025 private Font boldFont
;
1027 public BoldFontHolder2() {
1030 public Font
getBoldFont(Font font
) {
1031 createBoldFont(font
);
1035 private void createBoldFont(Font font
) {
1036 if (normalFont
== null || !normalFont
.equals(font
)) {
1040 if (boldFont
== null) {
1041 boldFont
= FormFonts
.getInstance().getBoldFont(getColors().getDisplay(), normalFont
);
1045 public void dispose() {
1046 if (boldFont
!= null) {
1047 FormFonts
.getInstance().markFinished(boldFont
, getColors().getDisplay());
1055 * createToggleableTextField
1058 * @param parentElement
1059 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1061 * @param labelString
1062 * a {@link java.lang.String} object.
1063 * @param initialText
1064 * a {@link java.lang.String} object.
1065 * @param initialState
1069 * @return a {@link eu.etaxonomy.taxeditor.ui.element.ToggleableTextElement}
1072 public ToggleableTextElement
createToggleableTextField(ICdmFormElement parentElement
, String labelString
,
1073 String initialText
, boolean initialState
, int style
) {
1074 ToggleableTextElement element
= new ToggleableTextElement(this, parentElement
, labelString
, initialText
,
1075 initialState
, style
| orientation
);
1077 parentElement
.addElement(element
);
1083 * createTimePeriodElement
1086 * @param parentElement
1087 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1089 * @param labelString
1090 * a {@link java.lang.String} object.
1092 * a {@link eu.etaxonomy.cdm.model.common.TimePeriod} object.
1095 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TimePeriodElement}
1098 public TimePeriodElement
createTimePeriodElement(ICdmFormElement parentElement
, String labelString
,
1099 TimePeriod timePeriod
, int style
) {
1100 TimePeriodElement element
= new TimePeriodElement(this, parentElement
, labelString
, timePeriod
, style
);
1102 parentElement
.addElement(element
);
1108 * createGatheringEventUnitElement
1111 * @param parentElement
1112 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1114 * @param labelString
1115 * a {@link java.lang.String} object.
1117 * a {@link eu.etaxonomy.cdm.model.common.GatheringEvent} object.
1120 * @return a {@link eu.etaxonomy.taxeditor.ui.element.GatheringEventUnitElement}
1123 public GatheringEventUnitElement
createGatheringEventUnitElement(
1124 ICdmFormElement parentElement
,
1126 DerivedUnitFacade gatheringEvent
,
1127 MinMaxTextSection
.UnitType unitType
,
1129 GatheringEventUnitElement element
= new GatheringEventUnitElement(this,
1136 parentElement
.addElement(element
);
1142 * createPointElement
1147 * @param parentElement
1148 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1151 * a {@link eu.etaxonomy.cdm.model.location.Point} object.
1152 * @return a {@link eu.etaxonomy.taxeditor.ui.element.PointElement} object.
1154 public PointElement
createPointElement(ICdmFormElement parentElement
, Point point
, int style
) {
1155 PointElement element
= new PointElement(this, parentElement
, point
, style
);
1157 parentElement
.addElement(element
);
1164 * @param conversationHolder
1166 * @param detailsViewer
1170 public EmptySection
createEmptySection(CdmFormFactory formFactory
, ICdmFormElement parentElement
, int style
) {
1171 EmptySection section
= new EmptySection(formFactory
, parentElement
, style
);
1172 parentElement
.addElement(section
);
1179 * createDateDetailSection
1182 * @param parentElement
1183 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1187 * @return a {@link eu.etaxonomy.taxeditor.ui.element.DateDetailSection}
1190 public DateDetailSection
createDateDetailSection(ICdmFormElement parentElement
, int style
) {
1191 DateDetailSection section
= new DateDetailSection(this, parentElement
, style
);
1192 parentElement
.addElement(section
);
1199 * createDateDetailSection
1202 * @param parentElement
1203 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1207 * @return a {@link eu.etaxonomy.taxeditor.ui.element.MinMaxTextSection}
1210 public MinMaxTextSection
createMinMaxTextSection(ICdmFormElement parentElement
, UnitType unitType
, int style
) {
1211 MinMaxTextSection section
= new MinMaxTextSection(this, parentElement
, unitType
, style
);
1212 parentElement
.addElement(section
);
1219 * createPartialElement
1222 * @param parentElement
1223 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1225 * @param labelString
1226 * a {@link java.lang.String} object.
1228 * a {@link org.joda.time.Partial} object.
1231 * @return a {@link eu.etaxonomy.taxeditor.ui.element.PartialElement}
1234 public PartialElement
createPartialElement(ICdmFormElement parentElement
, String labelString
, Partial partial
,
1236 PartialElement element
= new PartialElement(this, parentElement
, labelString
, style
);
1238 parentElement
.addElement(element
);
1244 * addSelectionListener
1248 * a {@link org.eclipse.swt.events.SelectionListener} object.
1250 public void addSelectionListener(SelectionListener listener
) {
1251 selectionListenerList
.add(listener
);
1256 * removeSelectionListener
1260 * a {@link org.eclipse.swt.events.SelectionListener} object.
1262 public void removeSelectionListener(SelectionListener listener
) {
1263 if (listener
== null) {
1264 MessagingUtils
.error(this.getClass(),
1265 "Tried to remove a selection listener from this factories listeners but was null", null);
1267 selectionListenerList
.remove(listener
);
1273 * addPropertyChangeListener
1277 * a {@link org.eclipse.jface.util.IPropertyChangeListener}
1280 public void addPropertyChangeListener(IPropertyChangeListener listener
) {
1281 if (propertyChangeListeners
.contains(listener
)) {
1284 propertyChangeListeners
.add(0, listener
);
1289 * removePropertyChangeListener
1293 * a {@link org.eclipse.jface.util.IPropertyChangeListener}
1296 public void removePropertyChangeListener(IPropertyChangeListener listener
) {
1297 propertyChangeListeners
.remove(listener
);
1301 * @return the propertyChangeListeners
1303 public List
<IPropertyChangeListener
> getPropertyChangeListeners() {
1304 return propertyChangeListeners
;
1309 * createHorizontalSeparator
1312 * @param parentElement
1313 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1317 * @return a {@link org.eclipse.swt.widgets.Label} object.
1319 public Label
createHorizontalSeparator(ICdmFormElement parentElement
, int style
) {
1320 Label separator
= this.createSeparator(parentElement
.getLayoutComposite(), SWT
.HORIZONTAL
| style
);
1321 separator
.setLayoutData(LayoutConstants
.FILL_HORIZONTALLY());
1327 * createVersionElement
1330 * @param parentElement
1331 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1334 * a {@link eu.etaxonomy.cdm.model.common.VersionableEntity}
1339 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.VersionElement}
1342 public VersionElement
createVersionElement(ICdmFormElement parentElement
, VersionableEntity entity
, int style
) {
1343 VersionElement element
= new VersionElement(this, parentElement
, entity
, style
);
1345 parentElement
.addElement(element
);
1350 * @param cdmBaseSection
1355 public CdmBaseElement
createCdmBaseElement(ICdmFormElement parentElement
, CdmBase entity
, int style
) {
1356 CdmBaseElement element
= new CdmBaseElement(this, parentElement
, entity
, style
);
1358 parentElement
.addElement(element
);
1364 * createVersionSection
1367 * @param parentElement
1368 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1373 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.VersionSection}
1376 public VersionSection
createVersionSection(ICdmFormElement parentElement
, int style
) {
1377 VersionSection section
= new VersionSection(this, parentElement
, style
);
1378 parentElement
.addElement(section
);
1388 public CdmBaseSection
createCdmBaseSection(ICdmFormElement parentElement
, int style
) {
1389 CdmBaseSection section
= new CdmBaseSection(this, parentElement
, style
);
1390 parentElement
.addElement(section
);
1397 * createEmptyElement
1400 * @param parentElement
1401 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1403 * @return a {@link eu.etaxonomy.taxeditor.ui.section.EmptyElement} object.
1405 public EmptyElement
createEmptyElement(ICdmFormElement parentElement
, String emptyText
) {
1406 EmptyElement element
= new EmptyElement(this, parentElement
, emptyText
, SWT
.NULL
);
1408 parentElement
.addElement(element
);
1414 * createHeadlineSection
1417 * @param parentElement
1418 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1421 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.HeadlineSection}
1424 public HeadlineSection
createHeadlineSection(ICdmFormElement parentElement
) {
1425 HeadlineSection section
= new HeadlineSection(this, parentElement
, SWT
.NULL
);
1426 parentElement
.addElement(section
);
1433 * createParsingMessageElement
1436 * @param parentElement
1437 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1439 * @param parserProblem
1440 * a {@link eu.etaxonomy.cdm.strategy.parser.ParserProblem}
1445 * {@link eu.etaxonomy.taxeditor.ui.section.taxon.ParsingMessageElement}
1448 public ParsingMessageElement
createParsingMessageElement(ICdmFormElement parentElement
,
1449 ParserProblem parserProblem
, int style
) {
1450 ParsingMessageElement element
= new ParsingMessageElement(this, parentElement
, parserProblem
, style
);
1452 parentElement
.addElement(element
);
1456 public AbstractFormSection
createDefinedTermDetailSection(Class definedTermClass
, ConversationHolder conversation
,
1457 ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
1459 AbstractFormSection section
= new DefinedTermDetailSection(this, definedTermClass
, conversation
, parentElement
,
1460 selectionProvider
, style
);
1462 parentElement
.addElement(section
);
1469 * @param definedTermClass
1470 * @param formElement
1474 public AbstractCdmDetailElement
createDefinedTermDetailElement(Class definedTermClass
,
1475 AbstractCdmDetailSection parentElement
, int style
) {
1476 AbstractCdmDetailElement element
= null;
1478 if (NamedArea
.class.isAssignableFrom(definedTermClass
)) {
1479 element
= new eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement(this, parentElement
);
1480 } else if (definedTermClass
.equals(Feature
.class)) {
1481 element
= new FeatureDetailElement(this, parentElement
);
1483 element
= new DefinedTermDetailElement(this, parentElement
);
1487 parentElement
.addElement(element
);
1492 //--------DetailSections---------
1493 public NameDetailSection
createNameDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1494 NameDetailSection section
= new NameDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1495 addAndAdaptSection(parentElement
, section
);
1499 public ReferenceDetailSection
createReferenceDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1500 ReferenceDetailSection section
= new ReferenceDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1501 addAndAdaptSection(parentElement
, section
);
1505 public NomenclaturalReferenceDetailSection
createNomenclaturalReferenceDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1506 NomenclaturalReferenceDetailSection section
= new NomenclaturalReferenceDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1507 addAndAdaptSection(parentElement
, section
);
1511 public TaxonBaseDetailSection
createTaxonBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1512 TaxonBaseDetailSection section
= new TaxonBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1513 addAndAdaptSection(parentElement
, section
);
1517 public AuthorshipDetailSection
createAuthorshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1518 AuthorshipDetailSection section
= new AuthorshipDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1519 addAndAdaptSection(parentElement
, section
);
1523 public TeamOrPersonBaseDetailSection
createTeamOrPersonBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1524 TeamOrPersonBaseDetailSection section
= new TeamOrPersonBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1525 addAndAdaptSection(parentElement
, section
);
1529 public TeamDetailSection
createTeamDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1530 TeamDetailSection section
= new TeamDetailSection(this, conversation
, parentElement
, null, style
);
1531 addAndAdaptSection(parentElement
, section
);
1535 public PersonDetailSection
createPersonDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1536 PersonDetailSection section
= new PersonDetailSection(this, conversation
, parentElement
, null, style
);
1537 addAndAdaptSection(parentElement
, section
);
1541 public DescriptionDetailSection
createDescriptionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1542 DescriptionDetailSection section
= new DescriptionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1543 addAndAdaptSection(parentElement
, section
);
1547 public DescriptionElementDetailSection
createDescriptionElementDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1548 DescriptionElementDetailSection section
= new DescriptionElementDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1549 addAndAdaptSection(parentElement
, section
);
1553 public ParsingMessagesSection
createParsingMessagesSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1554 ParsingMessagesSection section
= new ParsingMessagesSection(this, conversation
, parentElement
, selectionProvider
, style
);
1555 addAndAdaptSection(parentElement
, section
);
1559 public NonViralNameDetailSection
createNonViralNameDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1560 NonViralNameDetailSection section
= new NonViralNameDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1561 addAndAdaptSection(parentElement
, section
);
1565 public MediaDetailsSection
createMediaDetailsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1566 MediaDetailsSection section
= new MediaDetailsSection(this, conversation
, parentElement
, selectionProvider
, style
);
1567 addAndAdaptSection(parentElement
, section
);
1571 public DerivedUnitFacadeDetailSection
createDerivedUnitFacadeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1572 DerivedUnitFacadeDetailSection section
= new DerivedUnitFacadeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1573 addAndAdaptSection(parentElement
, section
);
1577 public FieldUnitDetailSection
createFieldUnitDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1578 FieldUnitDetailSection section
= new FieldUnitDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1579 addAndAdaptSection(parentElement
, section
);
1583 public GatheringEventDetailSection
createGatheringEventDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1584 GatheringEventDetailSection section
= new GatheringEventDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1585 addAndAdaptSection(parentElement
, section
);
1589 public DerivedUnitBaseDetailSection
createDerivedUnitBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1590 DerivedUnitBaseDetailSection section
= new DerivedUnitBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1591 addAndAdaptSection(parentElement
, section
);
1595 public OriginalLabelDataSection
createOriginalLabelDataSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1596 OriginalLabelDataSection section
= new OriginalLabelDataSection(this, conversation
, parentElement
, selectionProvider
, style
);
1597 addAndAdaptSection(parentElement
, section
);
1601 public NaturalLanguageSection
createNaturalLanguageSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1602 NaturalLanguageSection section
= new NaturalLanguageSection(this, conversation
, parentElement
, selectionProvider
, style
);
1603 addAndAdaptSection(parentElement
, section
);
1607 public FeatureDistributionDetailSection
createFeatureDistributionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1608 FeatureDistributionDetailSection section
= new FeatureDistributionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1609 addAndAdaptSection(parentElement
, section
);
1613 public ClassificationDetailSection
createClassificationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1614 ClassificationDetailSection section
= new ClassificationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1615 addAndAdaptSection(parentElement
, section
);
1619 public TaxonNodeDetailSection
createTaxonNodeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1620 TaxonNodeDetailSection section
= new TaxonNodeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1621 addAndAdaptSection(parentElement
, section
);
1625 public PolytomousKeyDetailSection
createPolytomousKeyDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1626 PolytomousKeyDetailSection section
= new PolytomousKeyDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1627 addAndAdaptSection(parentElement
, section
);
1631 public PolytomousKeyNodeDetailSection
createPolytomousKeyNodeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1632 PolytomousKeyNodeDetailSection section
= new PolytomousKeyNodeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1633 addAndAdaptSection(parentElement
, section
);
1637 public InstitutionDetailSection
createInstitutionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1638 InstitutionDetailSection section
= new InstitutionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1639 addAndAdaptSection(parentElement
, section
);
1643 public FieldUnitGeneralDetailSection
createFieldUnitGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1644 FieldUnitGeneralDetailSection section
= new FieldUnitGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1645 addAndAdaptSection(parentElement
, section
);
1649 public DerivedUnitGeneralDetailSection
createDerivedUnitGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1650 DerivedUnitGeneralDetailSection section
= new DerivedUnitGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1651 addAndAdaptSection(parentElement
, section
);
1655 public PreservedSpecimenGeneralDetailSection
createPreservedSpecimenGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1656 PreservedSpecimenGeneralDetailSection section
= new PreservedSpecimenGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1657 addAndAdaptSection(parentElement
, section
);
1661 public TissueSampleGeneralDetailSection
createTissueSampleGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1662 TissueSampleGeneralDetailSection section
= new TissueSampleGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1663 addAndAdaptSection(parentElement
, section
);
1667 public DnaSampleGeneralDetailSection
createDnaSampleGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1668 DnaSampleGeneralDetailSection section
= new DnaSampleGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1669 addAndAdaptSection(parentElement
, section
);
1673 public DnaQualityDetailSection
createDnaQualityDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1674 DnaQualityDetailSection section
= new DnaQualityDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1675 addAndAdaptSection(parentElement
, section
);
1679 public SequenceGeneralDetailSection
createSequenceGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1680 SequenceGeneralDetailSection section
= new SequenceGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1681 addAndAdaptSection(parentElement
, section
);
1685 public SequenceContigFileCollectionDetailSection
createSequenceContigFileCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1686 SequenceContigFileCollectionDetailSection section
= new SequenceContigFileCollectionDetailSection(this, conversation
, parentElement
, style
);
1687 addAndAdaptSection(parentElement
, section
);
1691 public SingleReadPherogramCollectionDetailSection
createSingleReadPherogramCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1692 SingleReadPherogramCollectionDetailSection section
= new SingleReadPherogramCollectionDetailSection(this, conversation
, parentElement
, style
);
1693 addAndAdaptSection(parentElement
, section
);
1697 public SequenceReferenceCollectionDetailSection
createSequenceReferenceCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1698 SequenceReferenceCollectionDetailSection section
= new SequenceReferenceCollectionDetailSection(this, conversation
, parentElement
, style
);
1699 addAndAdaptSection(parentElement
, section
);
1703 public SingleReadGeneralDetailSection
createSingleReadGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1704 SingleReadGeneralDetailSection section
= new SingleReadGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1705 addAndAdaptSection(parentElement
, section
);
1709 public AmplificationGeneralDetailSection
createAmplificationGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1710 AmplificationGeneralDetailSection section
= new AmplificationGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1711 addAndAdaptSection(parentElement
, section
);
1715 public AmplificationPrimerDetailSection
createAmplificationPrimerDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1716 AmplificationPrimerDetailSection section
= new AmplificationPrimerDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1717 addAndAdaptSection(parentElement
, section
);
1721 public AmplificationCloningDetailSection
createAmplificationCloningDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1722 AmplificationCloningDetailSection section
= new AmplificationCloningDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1723 addAndAdaptSection(parentElement
, section
);
1727 public AmplificationGelPhotoCollectionDetailSection
createAmplificationGelPhotoCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1728 AmplificationGelPhotoCollectionDetailSection section
= new AmplificationGelPhotoCollectionDetailSection(this, conversation
, parentElement
, style
);
1729 addAndAdaptSection(parentElement
, section
);
1733 public MediaSpecimenGeneralDetailSection
createMediaSpecimenGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1734 MediaSpecimenGeneralDetailSection section
= new MediaSpecimenGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1735 addAndAdaptSection(parentElement
, section
);
1739 public HybridDetailSection
createHybridDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1740 HybridDetailSection section
= new HybridDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1741 addAndAdaptSection(parentElement
, section
);
1745 public UserDetailSection
createUserDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1746 UserDetailSection section
= new UserDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1747 addAndAdaptSection(parentElement
, section
);
1751 public GroupDetailSection
createGroupDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1752 GroupDetailSection section
= new GroupDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1753 addAndAdaptSection(parentElement
, section
);
1757 public DeterminationDetailSection
createDeterminationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1758 DeterminationDetailSection section
= new DeterminationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1759 addAndAdaptSection(parentElement
, section
);
1763 public SampleDesignationDetailSection
createSampleDesignationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1764 SampleDesignationDetailSection section
= new SampleDesignationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1765 addAndAdaptSection(parentElement
, section
);
1769 public PreservedSpecimenDeterminationDetailSection
createPreservedSpecimenDeterminationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1770 PreservedSpecimenDeterminationDetailSection section
= new PreservedSpecimenDeterminationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1771 addAndAdaptSection(parentElement
, section
);
1775 public TaxonRelationshipDetailSection
createTaxonRelationshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1776 TaxonRelationshipDetailSection section
= new TaxonRelationshipDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1777 addAndAdaptSection(parentElement
, section
);
1781 public ReferencedEntityDetailSection
createReferencedEntityDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1782 ReferencedEntityDetailSection section
= new ReferencedEntityDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1783 addAndAdaptSection(parentElement
, section
);
1787 public TermVocabularyDetailSection
createTermVocabularyDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1788 TermVocabularyDetailSection section
= new TermVocabularyDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1789 addAndAdaptSection(parentElement
, section
);
1793 public GatheringEventDetailSection
createGatheringSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1794 GatheringEventDetailSection section
= new GatheringEventDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1795 addAndAdaptSection(parentElement
, section
);
1799 public NamedAreaDetailSection
createNamedAreaDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1800 NamedAreaDetailSection section
= new NamedAreaDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1801 addAndAdaptSection(parentElement
, section
);
1805 public UseRecordDetailSection
createUseRecordDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1806 UseRecordDetailSection section
= new UseRecordDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1807 addAndAdaptSection(parentElement
, section
);
1811 private void addAndAdaptSection(ICdmFormElement parentElement
, AbstractFormSection
<?
> section
) {
1812 parentElement
.addElement(section
);
1816 //--------DetailElements------------
1818 public UseRecordDetailElement
createUseRecordDetailElement(ICdmFormElement parentElement
){
1819 UseRecordDetailElement element
= new UseRecordDetailElement(this, parentElement
);
1820 addAndAdaptElement(parentElement
, element
);
1824 public DefinedTermDetailElement
<NamedAreaLevel
> createNamedAreaLevelElement(ICdmFormElement parentElement
){
1825 DefinedTermDetailElement
<NamedAreaLevel
> element
= new DefinedTermDetailElement
<NamedAreaLevel
>(this, parentElement
);
1826 addAndAdaptElement(parentElement
, element
);
1830 public eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement
createNamedAreaDetailElement(ICdmFormElement parentElement
){
1831 eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement element
= new eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement(this, parentElement
);
1832 addAndAdaptElement(parentElement
, element
);
1836 public TermVocabularyDetailElement
createTermVocabularyDetailElement(ICdmFormElement parentElement
){
1837 TermVocabularyDetailElement element
= new TermVocabularyDetailElement(this, parentElement
);
1838 addAndAdaptElement(parentElement
, element
);
1842 public ReferenceEntityDetailElement
createReferenceEntityDetailElement(ICdmFormElement parentElement
){
1843 ReferenceEntityDetailElement element
= new ReferenceEntityDetailElement(this, parentElement
);
1844 addAndAdaptElement(parentElement
, element
);
1848 public TaxonRelationshipDetailElement
createTaxonRelationshipDetailElement(ICdmFormElement parentElement
){
1849 TaxonRelationshipDetailElement element
= new TaxonRelationshipDetailElement(this, parentElement
);
1850 addAndAdaptElement(parentElement
, element
);
1854 public GrantedAuthorityDetailElement
createGrantedAuthorityDetailElement(ICdmFormElement parentElement
){
1855 GrantedAuthorityDetailElement element
= new GrantedAuthorityDetailElement(this, parentElement
);
1856 addAndAdaptElement(parentElement
, element
);
1860 public GroupDetailElement
createGroupDetailElement(ICdmFormElement parentElement
){
1861 GroupDetailElement element
= new GroupDetailElement(this, parentElement
);
1862 addAndAdaptElement(parentElement
, element
);
1866 public UserDetailElement
createUserDetailElement(ICdmFormElement parentElement
){
1867 UserDetailElement element
= new UserDetailElement(this, parentElement
);
1868 addAndAdaptElement(parentElement
, element
);
1872 public HybridDetailElement
createHybridDetailElement(ICdmFormElement parentElement
){
1873 HybridDetailElement element
= new HybridDetailElement(this, parentElement
);
1874 addAndAdaptElement(parentElement
, element
);
1878 public InstitutionDetailElement
createInstitutionDetailElement(ICdmFormElement parentElement
){
1879 InstitutionDetailElement element
= new InstitutionDetailElement(this, parentElement
);
1880 addAndAdaptElement(parentElement
, element
);
1884 public PolytomousKeyNodeDetailElement
createPolytomousKeyNodeDetailElement(ICdmFormElement parentElement
){
1885 PolytomousKeyNodeDetailElement element
= new PolytomousKeyNodeDetailElement(this, parentElement
);
1886 addAndAdaptElement(parentElement
, element
);
1890 public PolytomousKeyDetailElement
createPolytomousKeyDetailElement(ICdmFormElement parentElement
){
1891 PolytomousKeyDetailElement element
= new PolytomousKeyDetailElement(this, parentElement
);
1892 addAndAdaptElement(parentElement
, element
);
1896 public CollectionDetailElement
createCollectionDetailElement(ICdmFormElement parentElement
){
1897 CollectionDetailElement element
= new CollectionDetailElement(this, parentElement
);
1898 addAndAdaptElement(parentElement
, element
);
1902 public TaxonNodeDetailElement
createTaxonNodeDetailElement(ICdmFormElement parentElement
){
1903 TaxonNodeDetailElement element
= new TaxonNodeDetailElement(this, parentElement
);
1904 addAndAdaptElement(parentElement
, element
);
1908 public ClassificationDetailElement
createClassificationDetailElement(ICdmFormElement parentElement
){
1909 ClassificationDetailElement element
= new ClassificationDetailElement(this, parentElement
);
1910 addAndAdaptElement(parentElement
, element
);
1914 public FeatureDistributionDetailElement
createFeatureDistributionDetailElement(ICdmFormElement parentElement
){
1915 FeatureDistributionDetailElement element
= new FeatureDistributionDetailElement(this, parentElement
);
1916 addAndAdaptElement(parentElement
, element
);
1920 public NaturalLanguageDetailElement
createNaturalLanguageDetailElement(ICdmFormElement parentElement
){
1921 NaturalLanguageDetailElement element
= new NaturalLanguageDetailElement(this, parentElement
);
1922 addAndAdaptElement(parentElement
, element
);
1926 public DerivedUnitFacadeDetailElement
createDerivedUnitFacadeDetailElement(ICdmFormElement parentElement
){
1927 DerivedUnitFacadeDetailElement element
= new DerivedUnitFacadeDetailElement(this, parentElement
);
1928 addAndAdaptElement(parentElement
, element
);
1932 public NonViralNameDetailElement
createNonViralNameDetailElement(ICdmFormElement parentElement
){
1933 NonViralNameDetailElement element
= new NonViralNameDetailElement(this, parentElement
);
1934 addAndAdaptElement(parentElement
, element
);
1938 public DescriptionElementDetailElement
createDescriptionElementDetailElement(ICdmFormElement parentElement
, int style
){
1939 DescriptionElementDetailElement element
= new DescriptionElementDetailElement(this, parentElement
, style
);
1940 addAndAdaptElement(parentElement
, element
);
1944 public DescriptionDetailElement
createDescriptionDetailElement(ICdmFormElement parentElement
, int style
){
1945 DescriptionDetailElement element
= new DescriptionDetailElement(this, parentElement
, style
);
1946 addAndAdaptElement(parentElement
, element
);
1950 public PersonDetailElement
createPersonDetailElement(ICdmFormElement parentElement
, int style
){
1951 PersonDetailElement element
= new PersonDetailElement(this, parentElement
, style
);
1952 addAndAdaptElement(parentElement
, element
);
1956 public TeamDetailElement
createTeamDetailElement(ICdmFormElement parentElement
, int style
){
1957 TeamDetailElement element
= new TeamDetailElement(this, parentElement
, style
);
1958 addAndAdaptElement(parentElement
, element
);
1962 public AuthorshipDetailElement
createAuthorshipDetailElement(ICdmFormElement parentElement
, int style
){
1963 AuthorshipDetailElement element
= new AuthorshipDetailElement(this, parentElement
, style
);
1964 addAndAdaptElement(parentElement
, element
);
1968 public TaxonBaseDetailElement
createTaxonBaseDetailElement(ICdmFormElement parentElement
, int style
){
1969 TaxonBaseDetailElement element
= new TaxonBaseDetailElement(this, parentElement
, style
);
1970 addAndAdaptElement(parentElement
, element
);
1974 public NameDetailElement
createNameDetailElement(ICdmFormElement parentElement
, int style
){
1975 NameDetailElement element
= new NameDetailElement(this, parentElement
, style
);
1976 addAndAdaptElement(parentElement
, element
);
1980 public ReferenceDetailElement
createReferenceDetailElement(ICdmFormElement parentElement
, int style
){
1981 ReferenceDetailElement element
= new ReferenceDetailElement(this, parentElement
, style
);
1982 addAndAdaptElement(parentElement
, element
);
1986 public NomenclaturalReferenceDetailElement
createNomenclaturalReferenceDetailElement(ICdmFormElement parentElement
, int style
){
1987 NomenclaturalReferenceDetailElement element
= new NomenclaturalReferenceDetailElement(this, parentElement
, style
);
1988 addAndAdaptElement(parentElement
, element
);
1993 public FieldUnitGeneralDetailElement
createFieldUnitGeneralDetailElement(ICdmFormElement parentElement
){
1994 FieldUnitGeneralDetailElement element
= new FieldUnitGeneralDetailElement(this, parentElement
);
1995 addAndAdaptElement(parentElement
, element
);
1999 public DerivedUnitGeneralDetailElement
createDerivedUnitGeneralDetailElement(ICdmFormElement parentElement
){
2000 DerivedUnitGeneralDetailElement element
= new DerivedUnitGeneralDetailElement(this, parentElement
);
2001 addAndAdaptElement(parentElement
, element
);
2005 public PreservedSpecimenGeneralDetailElement
createPreservedSpecimenGeneralDetailElement(ICdmFormElement parentElement
){
2006 PreservedSpecimenGeneralDetailElement element
= new PreservedSpecimenGeneralDetailElement(this, parentElement
);
2007 addAndAdaptElement(parentElement
, element
);
2011 public TissueSampleGeneralDetailElement
createTissueSampleGeneralDetailElement(ICdmFormElement parentElement
){
2012 TissueSampleGeneralDetailElement element
= new TissueSampleGeneralDetailElement(this, parentElement
);
2013 addAndAdaptElement(parentElement
, element
);
2017 public DnaSampleGeneralDetailElement
createDnaSampleGeneralDetailElement(ICdmFormElement parentElement
){
2018 DnaSampleGeneralDetailElement element
= new DnaSampleGeneralDetailElement(this, parentElement
);
2019 addAndAdaptElement(parentElement
, element
);
2023 public DnaQualityDetailElement
createDnaQualityDetailElement(ICdmFormElement parentElement
){
2024 DnaQualityDetailElement element
= new DnaQualityDetailElement(this, parentElement
);
2025 addAndAdaptElement(parentElement
, element
);
2029 public SequenceGeneralDetailElement
createSequenceGeneralDetailElement(ICdmFormElement parentElement
){
2030 SequenceGeneralDetailElement element
= new SequenceGeneralDetailElement(this, parentElement
);
2031 addAndAdaptElement(parentElement
, element
);
2035 public SingleReadGeneralDetailElement
createSingleReadGeneralDetailElement(ICdmFormElement parentElement
){
2036 SingleReadGeneralDetailElement element
= new SingleReadGeneralDetailElement(this, parentElement
);
2037 addAndAdaptElement(parentElement
, element
);
2041 public PrimerGeneralDetailElement
createPrimerGeneralDetailElement(ICdmFormElement parentElement
){
2042 PrimerGeneralDetailElement element
= new PrimerGeneralDetailElement(this, parentElement
);
2043 addAndAdaptElement(parentElement
, element
);
2047 public AmplificationGeneralDetailElement
createAmplificationGeneralDetailElement(ICdmFormElement parentElement
){
2048 AmplificationGeneralDetailElement element
= new AmplificationGeneralDetailElement(this, parentElement
);
2049 addAndAdaptElement(parentElement
, element
);
2053 public AmplificationPrimerDetailElement
createAmplificationPrimerDetailElement(ICdmFormElement parentElement
){
2054 AmplificationPrimerDetailElement element
= new AmplificationPrimerDetailElement(this, parentElement
);
2055 addAndAdaptElement(parentElement
, element
);
2059 public AmplificationCloningDetailElement
createAmplificationCloningDetailElement(ICdmFormElement parentElement
){
2060 AmplificationCloningDetailElement element
= new AmplificationCloningDetailElement(this, parentElement
);
2061 addAndAdaptElement(parentElement
, element
);
2065 public AmplificationGelPhotoDetailElement
createAmplificationGelPhotoDetailElement(ICdmFormElement parentElement
){
2066 AmplificationGelPhotoDetailElement element
= new AmplificationGelPhotoDetailElement(this, parentElement
);
2067 addAndAdaptElement(parentElement
, element
);
2071 public MediaSpecimenGeneralDetailElement
createMediaSpecimenGeneralDetailElement(ICdmFormElement parentElement
){
2072 MediaSpecimenGeneralDetailElement element
= new MediaSpecimenGeneralDetailElement(this, parentElement
);
2073 addAndAdaptElement(parentElement
, element
);
2077 public MediaDetailElement
createMediaDetailElement(ICdmFormElement parentElement
){
2078 MediaDetailElement mediaDetailElement
= new MediaDetailElement(this, parentElement
);
2079 addAndAdaptElement(parentElement
, mediaDetailElement
);
2080 return mediaDetailElement
;
2083 public GatheringEventDetailElement
createGatheringEventDetailElement(ICdmFormElement parentElement
) {
2084 GatheringEventDetailElement element
= new GatheringEventDetailElement(this, parentElement
);
2085 addAndAdaptElement(parentElement
, element
);
2089 public FieldUnitDetailElement
createFieldUnitDetailElement(ICdmFormElement parentElement
) {
2090 FieldUnitDetailElement element
= new FieldUnitDetailElement(this, parentElement
);
2091 addAndAdaptElement(parentElement
, element
);
2096 public DerivedUnitBaseDetailElement
createDerivedUnitBaseDetailElement(ICdmFormElement parentElement
) {
2097 DerivedUnitBaseDetailElement element
= new DerivedUnitBaseDetailElement(this, parentElement
);
2098 addAndAdaptElement(parentElement
, element
);
2102 public OriginalLabelDataElement
createOriginalLabelDataElement(ICdmFormElement parentElement
) {
2103 OriginalLabelDataElement element
= new OriginalLabelDataElement(this, parentElement
);
2104 addAndAdaptElement(parentElement
, element
);
2108 public PreservedSpecimenDetailElement
createPreservedSpecimenDetailElement(ICdmFormElement parentElement
) {
2109 PreservedSpecimenDetailElement element
= new PreservedSpecimenDetailElement(this, parentElement
);
2110 addAndAdaptElement(parentElement
, element
);
2114 public PreservedSpecimenDeterminationDetailElement
createPreservedSpecimenDeterminationDetailElement(ICdmFormElement parentElement
) {
2115 PreservedSpecimenDeterminationDetailElement element
= new PreservedSpecimenDeterminationDetailElement(this, parentElement
);
2116 addAndAdaptElement(parentElement
, element
);
2120 public DeterminationDetailElement
createDeterminationDetailElement(ICdmFormElement parentElement
) {
2121 DeterminationDetailElement element
= new DeterminationDetailElement(this, parentElement
);
2122 addAndAdaptElement(parentElement
, element
);
2126 public SampleDesignationDetailElement
createSampleDesignationDetailElement(ICdmFormElement parentElement
) {
2127 SampleDesignationDetailElement element
= new SampleDesignationDetailElement(this, parentElement
);
2128 addAndAdaptElement(parentElement
, element
);
2133 * @param parentElement
2136 private void addAndAdaptElement(ICdmFormElement parentElement
, AbstractCdmDetailElement
<?
> element
) {
2138 parentElement
.addElement(element
);
2141 //--------EntityCollectionSection----------
2142 public TeamMemberSection
createTeamMemberSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2143 TeamMemberSection section
= new TeamMemberSection(this, conversation
, parentElement
, style
);
2144 addAndAdaptSection(parentElement
, section
);
2148 public AnnotationSection
createAnnotationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2149 AnnotationSection section
= new AnnotationSection(this, conversation
, parentElement
, style
);
2150 addAndAdaptSection(parentElement
, section
);
2154 public CreditSection
createCreditSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2155 CreditSection section
= new CreditSection(this, conversation
, parentElement
, style
);
2156 addAndAdaptSection(parentElement
, section
);
2160 public DescriptionElementSourceSection
createDescriptionElementSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2161 DescriptionElementSourceSection section
= new DescriptionElementSourceSection(this, conversation
, parentElement
, style
);
2162 addAndAdaptSection(parentElement
, section
);
2166 public ExtensionSection
createExtensionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2167 ExtensionSection section
= new ExtensionSection(this, conversation
, parentElement
, style
);
2168 addAndAdaptSection(parentElement
, section
);
2172 public MarkerSection
createMarkerSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2173 MarkerSection section
= new MarkerSection(this, conversation
, parentElement
, style
);
2174 addAndAdaptSection(parentElement
, section
);
2178 public MediaSection
createMediaSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2179 MediaSection section
= new MediaSection(this, conversation
, parentElement
, style
);
2180 addAndAdaptSection(parentElement
, section
);
2184 public DescriptionElementMediaSection
createDescriptionElementMediaSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2185 DescriptionElementMediaSection section
= new DescriptionElementMediaSection(this, conversation
, parentElement
, style
);
2186 addAndAdaptSection(parentElement
, section
);
2190 public MediaRepresentationSection
createMediaRepresentationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2191 MediaRepresentationSection section
= new MediaRepresentationSection(this, conversation
, parentElement
, style
);
2192 addAndAdaptSection(parentElement
, section
);
2196 public MediaRepresentationPartSection
createMediaRepresentationPartSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2197 MediaRepresentationPartSection section
= new MediaRepresentationPartSection(this, conversation
, parentElement
, style
);
2198 addAndAdaptSection(parentElement
, section
);
2202 public ModifierSection
createModifierSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2203 ModifierSection section
= new ModifierSection(this, conversation
, parentElement
, style
);
2204 addAndAdaptSection(parentElement
, section
);
2208 public NomenclaturalStatusSection
createNomenclaturalStatusSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2209 NomenclaturalStatusSection section
= new NomenclaturalStatusSection(this, conversation
, parentElement
, style
);
2210 addAndAdaptSection(parentElement
, section
);
2214 public NameRelationshipDetailSection
createNameRelationshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2215 NameRelationshipDetailSection section
= new NameRelationshipDetailSection(this, conversation
, parentElement
, style
);
2216 addAndAdaptSection(parentElement
, section
);
2220 public SynonymRelationshipDetailSection
createSynonymRelationshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2221 SynonymRelationshipDetailSection section
= new SynonymRelationshipDetailSection(this, conversation
, parentElement
, style
);
2222 addAndAdaptSection(parentElement
, section
);
2226 public ProtologueSection
createProtologueSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2227 ProtologueSection section
= new ProtologueSection(this, conversation
, parentElement
, style
);
2228 addAndAdaptSection(parentElement
, section
);
2232 public RightsSection
createRightsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2233 RightsSection section
= new RightsSection(this, conversation
, parentElement
, style
);
2234 addAndAdaptSection(parentElement
, section
);
2238 public SourceSection
createSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2239 SourceSection section
= new SourceSection(this, conversation
, parentElement
, style
);
2240 addAndAdaptSection(parentElement
, section
);
2244 public ScopeSection
createScopeSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2245 ScopeSection section
= new ScopeSection(this, conversation
, parentElement
, style
);
2246 addAndAdaptSection(parentElement
, section
);
2250 public DescriptionSourceSection
createDescriptionSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2251 DescriptionSourceSection section
= new DescriptionSourceSection(this, conversation
, parentElement
, style
);
2252 addAndAdaptSection(parentElement
, section
);
2256 public TypeDesignationSection
createTypeDesignationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2257 TypeDesignationSection section
= new TypeDesignationSection(this, conversation
, parentElement
, style
);
2258 addAndAdaptSection(parentElement
, section
);
2262 public StateDataSection
createStateDataSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2263 StateDataSection section
= new StateDataSection(this, conversation
, parentElement
, style
);
2264 addAndAdaptSection(parentElement
, section
);
2268 public StatisticalMeasurementValueSection
createStatisticalMeasurementValueSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2269 StatisticalMeasurementValueSection section
= new StatisticalMeasurementValueSection(this, conversation
, parentElement
, style
);
2270 addAndAdaptSection(parentElement
, section
);
2274 public DescribedSpecimenSection
createDescribedSpecimenSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2275 DescribedSpecimenSection section
= new DescribedSpecimenSection(this, conversation
, parentElement
, style
);
2276 addAndAdaptSection(parentElement
, section
);
2280 public CollectingAreasDetailSection
createCollectingAreasDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2281 CollectingAreasDetailSection section
= new CollectingAreasDetailSection(this, conversation
, parentElement
, style
);
2282 addAndAdaptSection(parentElement
, section
);
2286 public CurrentSampleDesignationDetailSection
createCurrentSampleDesignationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2287 CurrentSampleDesignationDetailSection section
= new CurrentSampleDesignationDetailSection(this, conversation
, parentElement
, style
);
2288 addAndAdaptSection(parentElement
, section
);
2292 public CurrentDeterminationDetailSection
createCurrentDeterminationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2293 CurrentDeterminationDetailSection section
= new CurrentDeterminationDetailSection(this, conversation
, parentElement
, style
);
2294 addAndAdaptSection(parentElement
, section
);
2298 public PreservedSpecimenCurrentDeterminationDetailSection
createPreservedSpecimenCurrentDeterminationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2299 PreservedSpecimenCurrentDeterminationDetailSection section
= new PreservedSpecimenCurrentDeterminationDetailSection(this, conversation
, parentElement
, style
);
2300 addAndAdaptSection(parentElement
, section
);
2304 public SampleDesignationHistoryDetailSection
createSampleDesignationHistoryDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2305 SampleDesignationHistoryDetailSection section
= new SampleDesignationHistoryDetailSection(this, conversation
, parentElement
, style
);
2306 addAndAdaptSection(parentElement
, section
);
2310 public DeterminationHistoryDetailSection
createDeterminationHistoryDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2311 DeterminationHistoryDetailSection section
= new DeterminationHistoryDetailSection(this, conversation
, parentElement
, style
);
2312 addAndAdaptSection(parentElement
, section
);
2316 public PreservedSpecimenDeterminationHistoryDetailSection
createPreservedSpecimenDeterminationHistoryDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2317 PreservedSpecimenDeterminationHistoryDetailSection section
= new PreservedSpecimenDeterminationHistoryDetailSection(this, conversation
, parentElement
, style
);
2318 addAndAdaptSection(parentElement
, section
);
2322 public SpecimenCollectionDetailSection
createSpecimenCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2323 SpecimenCollectionDetailSection section
= new SpecimenCollectionDetailSection(this, conversation
, parentElement
, style
);
2324 addAndAdaptSection(parentElement
, section
);
2328 public PreservedSpecimenSourceCollectionDetailSection
createPreservedSpecimenSourceCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2329 PreservedSpecimenSourceCollectionDetailSection section
= new PreservedSpecimenSourceCollectionDetailSection(this, conversation
, parentElement
, style
);
2330 addAndAdaptSection(parentElement
, section
);
2334 public SourceCollectionDetailSection
createSourceCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2335 SourceCollectionDetailSection section
= new SourceCollectionDetailSection(this, conversation
, parentElement
, style
);
2336 addAndAdaptSection(parentElement
, section
);
2340 public GeographicalScopeDetailSection
createGeographicalScopeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2341 GeographicalScopeDetailSection section
= new GeographicalScopeDetailSection(this, conversation
, parentElement
, style
);
2342 addAndAdaptSection(parentElement
, section
);
2346 public ScopeRestrictionSection
createScopeRestrictionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2347 ScopeRestrictionSection section
= new ScopeRestrictionSection(this, conversation
, parentElement
, style
);
2348 addAndAdaptSection(parentElement
, section
);
2352 public MemberDetailSection
createMemberDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2353 MemberDetailSection section
= new MemberDetailSection(this, conversation
, parentElement
, style
);
2354 addAndAdaptSection(parentElement
, section
);
2358 public GrantedAuthorityDetailSection
createGrantedAuthorityDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2359 GrantedAuthorityDetailSection section
= new GrantedAuthorityDetailSection(this, conversation
, parentElement
, style
);
2360 addAndAdaptSection(parentElement
, section
);
2364 public GroupsByUserDetailSection
createGroupsByUserDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2365 GroupsByUserDetailSection section
= new GroupsByUserDetailSection(this, conversation
, parentElement
, style
);
2366 addAndAdaptSection(parentElement
, section
);
2370 public TaxonomicScopeSection
createTaxonomicScopeSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2371 TaxonomicScopeSection section
= new TaxonomicScopeSection(this, conversation
, parentElement
, style
);
2372 addAndAdaptSection(parentElement
, section
);
2378 * createEntityCollectionElement
2381 * @param removeListener
2382 * a {@link org.eclipse.swt.events.SelectionListener} object.
2385 * @param parentElement
2387 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
2389 * @param versionableEntity
2390 * a {@link eu.etaxonomy.cdm.model.common.IVersionableEntity}
2392 * @param backgroundColor
2393 * a {@link org.eclipse.swt.graphics.Color} object.
2395 * {@link eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement}
2398 public AbstractEntityCollectionElement
createEntityCollectionElement(AbstractFormSection parentElement
,
2399 Object versionableEntity
, SelectionListener removeListener
, Color backgroundColor
, int style
) {
2400 AbstractEntityCollectionElement element
= null;
2402 Object entity
= HibernateProxyHelper
.deproxy(versionableEntity
);
2404 if (entity
instanceof Annotation
) {
2405 element
= new AnnotationElement(this, parentElement
, (Annotation
) entity
, removeListener
, style
);
2406 } else if (entity
instanceof Person
) {
2407 element
= new TeamMemberElement(this, parentElement
, (Person
) entity
, removeListener
, style
);
2408 } else if (entity
instanceof Credit
) {
2409 element
= new CreditElement(this, parentElement
, (Credit
) entity
, removeListener
, style
);
2410 } else if (entity
instanceof Extension
) {
2411 element
= new ExtensionElement(this, parentElement
, (Extension
) entity
, removeListener
, style
);
2412 } else if (entity
instanceof Marker
) {
2413 element
= new MarkerElement(this, parentElement
, (Marker
) entity
, removeListener
, style
);
2414 } else if (entity
instanceof Media
) {
2415 element
= new MediaMetaElement(this, parentElement
, (Media
) entity
, removeListener
, style
);
2416 } else if (entity
instanceof MediaRepresentation
) {
2417 element
= new MediaRepresentationElement(this, parentElement
, (MediaRepresentation
) entity
, removeListener
,
2419 } else if (entity
instanceof ImageFile
) {
2420 element
= new ImageFileElement(this, parentElement
, (ImageFile
) entity
, removeListener
, style
);
2421 } else if (entity
instanceof MediaRepresentationPart
) {
2422 element
= new MediaRepresentationPartElement(this, parentElement
, (MediaRepresentationPart
) entity
,
2423 removeListener
, style
);
2424 } else if (entity
instanceof NomenclaturalStatus
) {
2425 element
= new NomenclaturalStatusElement(this, parentElement
, (NomenclaturalStatus
) entity
, removeListener
,
2427 } else if (entity
instanceof Rights
) {
2428 element
= new RightsElement(this, parentElement
, (Rights
) entity
, removeListener
, style
);
2429 } else if (entity
instanceof DescriptionElementSource
) {
2430 element
= new DescriptionElementSourceElement(this, parentElement
, (DescriptionElementSource
) entity
,
2431 removeListener
, style
);
2432 } else if (entity
instanceof IdentifiableSource
) {
2433 element
= new IdentifiableSourceElement(this, parentElement
, (IdentifiableSource
) entity
, removeListener
,
2435 } else if (entity
instanceof DefinedTerm
) {
2436 switch(((DefinedTerm
)entity
).getTermType()) {
2438 element
= new ScopeElement(this,
2440 (DefinedTerm
) entity
,
2445 element
= new ModifierElement(this,
2447 (DefinedTerm
) entity
,
2452 //FIXME : Actually we should through an exception here
2457 } else if (entity
instanceof Reference
) {
2458 if(parentElement
instanceof SequenceReferenceCollectionDetailSection
){
2459 element
= new SequenceReferenceCollectionDetailElement(this, parentElement
, (Reference
) entity
, removeListener
, style
);
2462 element
= new DescriptionSourceElement(this, parentElement
, (Reference
) entity
, removeListener
, style
);
2464 } else if (entity
instanceof NameTypeDesignation
) {
2465 element
= new NameTypeDesignationElement(this, parentElement
, (NameTypeDesignation
) entity
, removeListener
,
2467 } else if (entity
instanceof NameRelationship
) {
2468 element
= new NameRelationshipDetailElement(this, parentElement
, (NameRelationship
) entity
, removeListener
,
2470 } else if (entity
instanceof SynonymRelationship
) {
2471 element
= new SynonymRelationshipDetailElement(this, parentElement
, (SynonymRelationship
) entity
, removeListener
,
2473 } else if (entity
instanceof SpecimenTypeDesignation
) {
2474 element
= new SpecimenTypeDesignationElement(this, parentElement
, (SpecimenTypeDesignation
) entity
,
2475 removeListener
, style
);
2476 } else if (entity
instanceof StateData
) {
2477 element
= new StateDataElement(this, parentElement
, (StateData
) entity
, removeListener
, style
);
2478 } else if (entity
instanceof StatisticalMeasurementValue
) {
2479 element
= new StatisticalMeasurementValueElement(this, parentElement
, (StatisticalMeasurementValue
) entity
,
2480 removeListener
, style
);
2481 } else if (entity
instanceof DerivedUnit
) {
2482 switch(((DerivedUnit
)entity
).getRecordBasis()) {
2483 case LivingSpecimen
:
2484 case PreservedSpecimen
:
2486 element
= new SpecimenCollectionDetailElement(this,
2488 (DerivedUnit
) entity
,
2493 element
= new DerivedUnitElement(this,
2495 (DerivedUnit
) entity
,
2500 } else if (entity
instanceof NamedArea
) {
2501 element
= new NamedAreaDetailElement(this, parentElement
, (NamedArea
) entity
, removeListener
, style
);
2502 } else if (entity
instanceof DeterminationEvent
) {
2503 element
= new DeterminationEventDetailElement(this, parentElement
, (DeterminationEvent
) entity
, removeListener
, style
);
2504 } else if (entity
instanceof User
) {
2505 element
= new MemberDetailElement(this, parentElement
, (User
) entity
, removeListener
, style
);
2506 } else if (entity
instanceof GrantedAuthority
) {
2507 element
= new GrantedAuthorityCollectionElement(this, parentElement
, (GrantedAuthorityImpl
) entity
,
2508 removeListener
, style
);
2509 } else if (entity
instanceof Group
) {
2510 element
= new GroupsByUserDetailElement(this, parentElement
, (Group
) entity
, removeListener
, style
);
2511 } else if (entity
instanceof Taxon
) {
2512 element
= new TaxonDetailElement(this, parentElement
, (Taxon
) entity
, removeListener
, style
);
2513 } else if (entity
instanceof DescriptionElementBase
) {
2514 // this is the special case for protologs, maybe we can do this
2515 // differently when API improves
2516 DescriptionElementBase descriptionElement
= (DescriptionElementBase
) entity
;
2517 if (descriptionElement
.getFeature().equals(Feature
.PROTOLOGUE())) {
2518 element
= new ProtologueElement(this, parentElement
, descriptionElement
, removeListener
, style
);
2520 } else if (entity
instanceof Identifier
) {
2521 element
= new SampleDesignationTextDetailElement(this, parentElement
, (Identifier
<DnaSample
>) entity
, removeListener
, backgroundColor
, style
);
2524 if (element
== null) {
2525 MessagingUtils
.messageDialog("No element for entity", this,
2526 "Could not generate element for entity. Looks like the case is not handled already. Check implementation. Entity: "
2531 if (backgroundColor
!= null && !backgroundColor
.isDisposed()) {
2532 element
.setPersistentBackground(backgroundColor
);
2535 parentElement
.addElement(element
);
2543 * Creates a selection element for the given type T.
2546 * <strong>Selection elements not handled by this method:</strong>
2548 * <li>{@link TaxonNodeSelectionElement} see
2549 * {@link #createTaxonNodeSelectionElement(ConversationHolder, ICdmFormElement, String, TaxonNode, int, int)}
2551 * <li>{@link NomenclaturalAuthorTeamSelectionElement} see
2552 * {@link #createNomenclaturalAuthorTeamSelectionElement(ConversationHolder, ICdmFormElement, String, Team, int, int)}
2558 * a {@link Class} object of the type that you want the selection
2560 * @param parentElement
2561 * a {@link ICdmFormElement} object.
2562 * @param labelString
2563 * a {@link String} object.
2564 * @param selectionType
2566 * a {@link ICdmBase} object.
2569 * @param conversation
2570 * a {@link ConversationHolder} object.
2571 * @return a {@link EntitySelectionElement} object.
2573 public <T
extends ICdmBase
> EntitySelectionElement
<T
> createSelectionElement(Class
<T
> clazz
,
2574 ConversationHolder conversation
, ICdmFormElement parentElement
, String labelString
, T selection
, int mode
,
2576 EntitySelectionElement
<T
> element
= new EntitySelectionElement
<T
>(this, conversation
, parentElement
, clazz
,
2577 labelString
, selection
, mode
, style
);
2579 parentElement
.addElement(element
);
2583 public TaxonNodeSelectionElement
createTaxonNodeSelectionElement(ConversationHolder conversation
,
2584 ICdmFormElement parentElement
, String labelString
, TaxonNode selection
, int mode
, int style
) {
2585 TaxonNodeSelectionElement element
= new TaxonNodeSelectionElement(this, conversation
, parentElement
,
2586 labelString
, selection
, mode
, style
);
2588 parentElement
.addElement(element
);
2592 public NomenclaturalAuthorTeamSelectionElement
createNomenclaturalAuthorTeamSelectionElement(
2593 ConversationHolder conversation
, ICdmFormElement parentElement
, String labelString
, Team selection
,
2594 int mode
, int style
) {
2595 NomenclaturalAuthorTeamSelectionElement element
= new NomenclaturalAuthorTeamSelectionElement(this,
2596 conversation
, parentElement
, labelString
, selection
, mode
, style
);
2598 parentElement
.addElement(element
);
2602 /** {@inheritDoc} */
2603 public LabelElement
createLabel(ICdmFormElement parentElement
, String text
) {
2604 LabelElement labelElement
= new LabelElement(this, parentElement
, text
);
2605 adapt(labelElement
);
2606 parentElement
.addElement(labelElement
);
2607 return labelElement
;
2610 public DateElement
createDateElement(ICdmFormElement formElement
, String labelText
, DateTime dateTime
, int style
){
2611 Label label
= new Label(formElement
.getLayoutComposite(), style
);
2612 label
.setText(labelText
+" (yyyy-MM-dd)");
2613 DateElement dateElement
= new DateElement(formElement
.getLayoutComposite(), dateTime
, style
);
2614 dateElement
.initController(this, formElement
);
2620 * Getter for the field <code>selectionProvider</code>.
2623 * @return a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
2625 public ISelectionProvider
getSelectionProvider() {
2626 return selectionProvider
;
2631 * createDetailedDescriptionDetailElement
2634 * @param parentElement
2635 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
2639 * {@link eu.etaxonomy.cdm.model.description.DescriptionElementBase}
2644 * {@link eu.etaxonomy.taxeditor.ui.section.description.detail.AbstractDetailedDescriptionDetailElement}
2647 public AbstractDetailedDescriptionDetailElement
createDetailedDescriptionDetailElement(
2648 ICdmFormElement parentElement
, DescriptionElementBase entity
, int style
) {
2649 AbstractDetailedDescriptionDetailElement detailedDescriptionElement
= null;
2651 if (entity
instanceof CategoricalData
) {
2652 detailedDescriptionElement
= new CategoricalDataDetailElement(this, parentElement
,
2653 (CategoricalData
) entity
, style
);
2654 } else if (entity
instanceof CommonTaxonName
) {
2655 detailedDescriptionElement
= new CommonNameDetailElement(this, parentElement
, (CommonTaxonName
) entity
,
2657 } else if (entity
instanceof Distribution
) {
2658 detailedDescriptionElement
= new DistributionDetailElement(this, parentElement
, (Distribution
) entity
,
2660 } else if (entity
instanceof IndividualsAssociation
) {
2661 detailedDescriptionElement
= new IndividualsAssociationDetailElement(this, parentElement
,
2662 (IndividualsAssociation
) entity
, style
);
2663 } else if (entity
instanceof QuantitativeData
) {
2664 detailedDescriptionElement
= new QuantitativeDataDetailElement(this, parentElement
,
2665 (QuantitativeData
) entity
, style
);
2666 } else if (entity
instanceof TaxonInteraction
) {
2667 detailedDescriptionElement
= new TaxonInteractionDetailElement(this, parentElement
,
2668 (TaxonInteraction
) entity
, style
);
2669 } else if (entity
instanceof TextData
) {
2670 detailedDescriptionElement
= new TextDataDetailElement(this, parentElement
, (TextData
) entity
, style
);
2672 throw new IllegalStateException("There is no interface for the given description element");
2674 adapt(detailedDescriptionElement
);
2675 parentElement
.addElement(detailedDescriptionElement
);
2676 return detailedDescriptionElement
;
2681 * Creates a styled text as a part of the form.
2686 * the text initial value
2689 * @return the text widget
2691 public StyledText
createStyledText(Composite parent
, String value
, int style
) {
2692 StyledText text
= new StyledText(parent
, getBorderStyle() | style
| getOrientation());
2693 if (value
!= null) {
2694 text
.setText(value
);
2696 text
.setForeground(getColors().getForeground());
2697 text
.setBackground(getColors().getBackground());
2698 // text.addFocusListener(visibilityHandler);
2702 public PreservedSpecimenDetailSection
createPreservedSpecimenDetailsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
2703 PreservedSpecimenDetailSection section
= new PreservedSpecimenDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
2704 addAndAdaptSection(parentElement
, section
);