4 package eu
.etaxonomy
.taxeditor
.ui
.element
;
7 import java
.util
.ArrayList
;
8 import java
.util
.HashSet
;
13 import org
.eclipse
.jface
.util
.IPropertyChangeListener
;
14 import org
.eclipse
.jface
.viewers
.ISelection
;
15 import org
.eclipse
.jface
.viewers
.ISelectionProvider
;
16 import org
.eclipse
.jface
.window
.Window
;
17 import org
.eclipse
.swt
.SWT
;
18 import org
.eclipse
.swt
.custom
.StyledText
;
19 import org
.eclipse
.swt
.events
.FocusAdapter
;
20 import org
.eclipse
.swt
.events
.FocusEvent
;
21 import org
.eclipse
.swt
.events
.FocusListener
;
22 import org
.eclipse
.swt
.events
.MouseAdapter
;
23 import org
.eclipse
.swt
.events
.MouseEvent
;
24 import org
.eclipse
.swt
.events
.MouseListener
;
25 import org
.eclipse
.swt
.events
.SelectionEvent
;
26 import org
.eclipse
.swt
.events
.SelectionListener
;
27 import org
.eclipse
.swt
.events
.TypedEvent
;
28 import org
.eclipse
.swt
.graphics
.Color
;
29 import org
.eclipse
.swt
.graphics
.Font
;
30 import org
.eclipse
.swt
.widgets
.Composite
;
31 import org
.eclipse
.swt
.widgets
.Control
;
32 import org
.eclipse
.swt
.widgets
.Display
;
33 import org
.eclipse
.swt
.widgets
.Event
;
34 import org
.eclipse
.swt
.widgets
.Label
;
35 import org
.eclipse
.ui
.forms
.IFormColors
;
36 import org
.eclipse
.ui
.forms
.widgets
.ExpandableComposite
;
37 import org
.eclipse
.ui
.forms
.widgets
.FormToolkit
;
38 import org
.eclipse
.ui
.forms
.widgets
.Section
;
39 import org
.eclipse
.ui
.internal
.forms
.widgets
.FormFonts
;
40 import org
.joda
.time
.Partial
;
41 import org
.springframework
.security
.core
.GrantedAuthority
;
43 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
44 import eu
.etaxonomy
.cdm
.api
.facade
.DerivedUnitFacade
;
45 import eu
.etaxonomy
.cdm
.hibernate
.HibernateProxyHelper
;
46 import eu
.etaxonomy
.cdm
.model
.agent
.Person
;
47 import eu
.etaxonomy
.cdm
.model
.agent
.Team
;
48 import eu
.etaxonomy
.cdm
.model
.common
.Annotation
;
49 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
50 import eu
.etaxonomy
.cdm
.model
.common
.Credit
;
51 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTerm
;
52 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTermBase
;
53 import eu
.etaxonomy
.cdm
.model
.common
.Extension
;
54 import eu
.etaxonomy
.cdm
.model
.common
.GrantedAuthorityImpl
;
55 import eu
.etaxonomy
.cdm
.model
.common
.Group
;
56 import eu
.etaxonomy
.cdm
.model
.common
.ICdmBase
;
57 import eu
.etaxonomy
.cdm
.model
.common
.IEnumTerm
;
58 import eu
.etaxonomy
.cdm
.model
.common
.IdentifiableSource
;
59 import eu
.etaxonomy
.cdm
.model
.common
.Language
;
60 import eu
.etaxonomy
.cdm
.model
.common
.LanguageString
;
61 import eu
.etaxonomy
.cdm
.model
.common
.Marker
;
62 import eu
.etaxonomy
.cdm
.model
.common
.TermType
;
63 import eu
.etaxonomy
.cdm
.model
.common
.TimePeriod
;
64 import eu
.etaxonomy
.cdm
.model
.common
.User
;
65 import eu
.etaxonomy
.cdm
.model
.common
.VersionableEntity
;
66 import eu
.etaxonomy
.cdm
.model
.description
.CategoricalData
;
67 import eu
.etaxonomy
.cdm
.model
.description
.CommonTaxonName
;
68 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionElementBase
;
69 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionElementSource
;
70 import eu
.etaxonomy
.cdm
.model
.description
.Distribution
;
71 import eu
.etaxonomy
.cdm
.model
.description
.Feature
;
72 import eu
.etaxonomy
.cdm
.model
.description
.IndividualsAssociation
;
73 import eu
.etaxonomy
.cdm
.model
.description
.KeyStatement
;
74 import eu
.etaxonomy
.cdm
.model
.description
.QuantitativeData
;
75 import eu
.etaxonomy
.cdm
.model
.description
.StateData
;
76 import eu
.etaxonomy
.cdm
.model
.description
.StatisticalMeasurementValue
;
77 import eu
.etaxonomy
.cdm
.model
.description
.TaxonInteraction
;
78 import eu
.etaxonomy
.cdm
.model
.description
.TextData
;
79 import eu
.etaxonomy
.cdm
.model
.location
.NamedArea
;
80 import eu
.etaxonomy
.cdm
.model
.location
.NamedAreaLevel
;
81 import eu
.etaxonomy
.cdm
.model
.location
.Point
;
82 import eu
.etaxonomy
.cdm
.model
.media
.ImageFile
;
83 import eu
.etaxonomy
.cdm
.model
.media
.Media
;
84 import eu
.etaxonomy
.cdm
.model
.media
.MediaRepresentation
;
85 import eu
.etaxonomy
.cdm
.model
.media
.MediaRepresentationPart
;
86 import eu
.etaxonomy
.cdm
.model
.media
.Rights
;
87 import eu
.etaxonomy
.cdm
.model
.name
.NameRelationship
;
88 import eu
.etaxonomy
.cdm
.model
.name
.NameTypeDesignation
;
89 import eu
.etaxonomy
.cdm
.model
.name
.NomenclaturalStatus
;
90 import eu
.etaxonomy
.cdm
.model
.name
.SpecimenTypeDesignation
;
91 import eu
.etaxonomy
.cdm
.model
.occurrence
.DerivedUnit
;
92 import eu
.etaxonomy
.cdm
.model
.occurrence
.DeterminationEvent
;
93 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
94 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
95 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonNode
;
96 import eu
.etaxonomy
.cdm
.strategy
.parser
.ParserProblem
;
97 import eu
.etaxonomy
.taxeditor
.model
.AbstractUtility
;
98 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.basicFields
.NamedAreaFieldController
;
99 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.compatibility
.ICdmFormElement
;
100 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.fieldObservation
.FieldObservationDetailsElement
;
101 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.fieldObservation
.FieldObservationDetailsElementController
;
102 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.fieldObservation
.FieldObservationDetailsSection
;
103 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.fieldObservation
.FieldObservationGeneralElement
;
104 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.fieldObservation
.FieldObservationGeneralElementController
;
105 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.fieldObservation
.FieldObservationGeneralSection
;
106 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.fieldObservation
.GatheringEventDetailsElement
;
107 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.fieldObservation
.GatheringEventDetailsElementController
;
108 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.fieldObservation
.GatheringEventSection
;
109 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.specimen
.DerivedUnitDetailsElement
;
110 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.specimen
.DerivedUnitDetailsElementController
;
111 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.specimen
.DerivedUnitDetailsSection
;
112 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.specimen
.SpecimenDetailsElement
;
113 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.specimen
.SpecimenDetailsElementController
;
114 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.specimen
.SpecimenDetailsSection
;
115 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.specimen
.SpecimenGeneralSection
;
116 import eu
.etaxonomy
.taxeditor
.ui
.combo
.EnumComboElement
;
117 import eu
.etaxonomy
.taxeditor
.ui
.combo
.TermComboElement
;
118 import eu
.etaxonomy
.taxeditor
.ui
.element
.MinMaxTextSection
.UnitType
;
119 import eu
.etaxonomy
.taxeditor
.ui
.openurl
.IOpenUrlEnabled
;
120 import eu
.etaxonomy
.taxeditor
.ui
.openurl
.OpenUrlSelectorElement
;
121 import eu
.etaxonomy
.taxeditor
.ui
.password
.EditPasswordElement
;
122 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailElement
;
123 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailSection
;
124 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionElement
;
125 import eu
.etaxonomy
.taxeditor
.ui
.section
.EmptyElement
;
126 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.InstitutionDetailElement
;
127 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.InstitutionDetailSection
;
128 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailElement
;
129 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailSection
;
130 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailElement
;
131 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailSection
;
132 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamMemberElement
;
133 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamMemberSection
;
134 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamOrPersonBaseDetailSection
;
135 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.ClassificationDetailElement
;
136 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.ClassificationDetailSection
;
137 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.TaxonNodeDetailElement
;
138 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.TaxonNodeDetailSection
;
139 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferenceEntityDetailElement
;
140 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferencedEntityDetailSection
;
141 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DerivedUnitElement
;
142 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescribedSpecimenSection
;
143 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailElement
;
144 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailSection
;
145 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailElement
;
146 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailSection
;
147 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementMediaSection
;
148 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceElement
;
149 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceSection
;
150 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceElement
;
151 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceSection
;
152 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.MediaDetailsSection
;
153 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ModifierElement
;
154 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ModifierSection
;
155 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageDetailElement
;
156 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageSection
;
157 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeElement
;
158 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeSection
;
159 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StateDataElement
;
160 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StateDataSection
;
161 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StatisticalMeasurementValueElement
;
162 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StatisticalMeasurementValueSection
;
163 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.AbstractDetailedDescriptionDetailElement
;
164 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.CategoricalDataDetailElement
;
165 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.CommonNameDetailElement
;
166 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.DistributionDetailElement
;
167 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.IndividualsAssociationDetailElement
;
168 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.QuantitativeDataDetailElement
;
169 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.TaxonInteractionDetailElement
;
170 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.TextDataDetailElement
;
171 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailElement
;
172 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailSection
;
173 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityCollectionElement
;
174 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailElement
;
175 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailSection
;
176 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailElement
;
177 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailSection
;
178 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailElement
;
179 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailSection
;
180 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.GeographicalScopeDetailSection
;
181 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailElement
;
182 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailSection
;
183 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailElement
;
184 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailSection
;
185 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.ScopeRestrictionSection
;
186 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.TaxonomicScopeSection
;
187 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.ImageFileElement
;
188 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaElement
;
189 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationElement
;
190 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationPartElement
;
191 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationPartSection
;
192 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationSection
;
193 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaSection
;
194 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.AuthorshipDetailElement
;
195 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.AuthorshipDetailSection
;
196 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.HybridDetailElement
;
197 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.HybridDetailSection
;
198 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameDetailElement
;
199 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameDetailSection
;
200 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailElement
;
201 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailSection
;
202 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameTypeDesignationElement
;
203 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusElement
;
204 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusSection
;
205 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailElement
;
206 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailSection
;
207 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.ProtologueElement
;
208 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.ProtologueSection
;
209 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.SpecimenTypeDesignationElement
;
210 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.TypeDesignationSection
;
211 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CollectingAreasDetailSection
;
212 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CollectionDetailElement
;
213 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CurrentDeterminationDetailSection
;
214 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitBaseDetailElement
;
215 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitBaseDetailSection
;
216 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitFacadeDetailElement
;
217 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitFacadeDetailSection
;
218 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitGeneralDetailElement
;
219 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitGeneralDetailSection
;
220 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailElement
;
221 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailSection
;
222 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationEventDetailElement
;
223 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationHistoryDetailSection
;
224 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitDetailElement
;
225 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitDetailSection
;
226 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitGeneralDetailElement
;
227 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitGeneralDetailSection
;
228 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailElement
;
229 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailSection
;
230 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.NamedAreaDetailElement
;
231 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SourceCollectionDetailSection
;
232 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SpecimenCollectionDetailElement
;
233 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SpecimenCollectionDetailSection
;
234 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailElement
;
235 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailSection
;
236 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailElement
;
237 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailSection
;
238 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.AnnotationElement
;
239 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.AnnotationSection
;
240 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CdmBaseElement
;
241 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CdmBaseSection
;
242 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CreditElement
;
243 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CreditSection
;
244 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.ExtensionElement
;
245 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.ExtensionSection
;
246 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.HeadlineSection
;
247 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.IdentifiableSourceElement
;
248 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.MarkerElement
;
249 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.MarkerSection
;
250 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.RightsElement
;
251 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.RightsSection
;
252 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.SourceSection
;
253 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.VersionElement
;
254 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.VersionSection
;
255 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessageElement
;
256 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessagesSection
;
257 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailElement
;
258 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailSection
;
259 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonDetailElement
;
260 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailElement
;
261 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailSection
;
262 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailElement
;
263 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailSection
;
264 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailElement
;
265 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailSection
;
266 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailElement
;
267 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailSection
;
268 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.DefinedTermDetailElement
;
269 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.DefinedTermDetailSection
;
270 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.FeatureDetailElement
;
271 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailSection
;
272 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailElement
;
273 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailSection
;
274 import eu
.etaxonomy
.taxeditor
.ui
.selection
.EntitySelectionElement
;
275 import eu
.etaxonomy
.taxeditor
.ui
.selection
.NomenclaturalAuthorTeamSelectionElement
;
276 import eu
.etaxonomy
.taxeditor
.ui
.selection
.TaxonNodeSelectionElement
;
280 * CdmFormFactory class.
284 * @created Feb 24, 2010
287 public class CdmFormFactory
extends FormToolkit
{
289 private BoldFontHolder2 boldFontHolder2
;
290 private MouseListener selectionMouseHandler
;
291 private FocusListener selectionFocusHandler
;
293 private final Set
<SelectionListener
> selectionListenerList
= new HashSet
<SelectionListener
>();
295 private final List
<IPropertyChangeListener
> propertyChangeListeners
= new ArrayList
<IPropertyChangeListener
>();
297 private final int orientation
= Window
.getDefaultOrientation();
298 private ISelectionProvider selectionProvider
;
300 /** Constant <code>EMPTY_SELECTION</code> */
301 public static ISelection EMPTY_SELECTION
= new ISelection() {
303 public boolean isEmpty() {
314 private class SelectionMouseHandler
extends MouseAdapter
{
316 public void mouseDown(MouseEvent e
) {
317 notifySelectionListeners(e
);
327 private class SelectionFocusHandler
extends FocusAdapter
{
329 public void focusGained(FocusEvent e
) {
330 notifySelectionListeners(e
);
334 private void notifySelectionListeners(TypedEvent e
) {
335 Event event
= new Event();
336 event
.widget
= e
.widget
;
337 SelectionEvent selectionEvent
= new SelectionEvent(event
);
339 for (SelectionListener listener
: selectionListenerList
) {
340 listener
.widgetSelected(selectionEvent
);
346 * Constructor for CdmFormFactory.
350 * a {@link org.eclipse.swt.widgets.Display} object.
351 * @param selectionProvider
352 * a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
354 public CdmFormFactory(Display display
, ISelectionProvider selectionProvider
) {
356 this.selectionProvider
= selectionProvider
;
362 * Constructor for CdmFormFactory.
366 * a {@link org.eclipse.swt.widgets.Display} object.
368 public CdmFormFactory(Display display
) {
376 private void init() {
377 boldFontHolder2
= new BoldFontHolder2();
378 selectionMouseHandler
= new SelectionMouseHandler();
379 selectionFocusHandler
= new SelectionFocusHandler();
383 * Creates an instance initialized with the correct selectionProvider
385 * Make sure to remove the instance when the entityComposite disposes via
386 * destroySelectionArbitrator(..)
388 * @param entityElement
389 * a {@link eu.etaxonomy.taxeditor.ui.element.IEntityElement}
391 * @return a {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator}
394 public SelectionArbitrator
createSelectionArbitrator(IEntityElement entityElement
) {
395 SelectionArbitrator selectionArbitrator
= new SelectionArbitrator(entityElement
);
396 selectionArbitrator
.addSelectionProvider(selectionProvider
);
397 selectionProvider
.addSelectionChangedListener(selectionArbitrator
);
398 addSelectionListener(selectionArbitrator
);
399 return selectionArbitrator
;
404 * destroySelectionArbitrator
407 * @param selectionArbitrator
409 * {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator}
412 public void destroySelectionArbitrator(SelectionArbitrator selectionArbitrator
) {
413 removeSelectionListener(selectionArbitrator
);
414 if (selectionProvider
!= null) {
415 selectionProvider
.removeSelectionChangedListener(selectionArbitrator
);
417 AbstractUtility
.error(this.getClass(),
418 "Tried to destroy a selection listener from this factories listeners but was null", null);
424 * Adapts the {@link AbstractCdmFormElement}:<br>
425 * - sets the {@link IPropertyChangeListener}s handled by this class
430 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement}
433 public void adapt(AbstractCdmFormElement formElement
) {
434 formElement
.setPropertyChangeListeners(propertyChangeListeners
);
439 public void adapt(Control control
, boolean trackFocus
, boolean trackKeyboard
) {
441 control
.addFocusListener(selectionFocusHandler
);
443 super.adapt(control
, trackFocus
, trackKeyboard
);
448 public void adapt(Composite composite
) {
449 composite
.addMouseListener(selectionMouseHandler
);
450 super.adapt(composite
);
459 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
462 public void destroyElement(ICdmFormElement formElement
) {
463 // return if element was not initialized
464 if (formElement
== null) {
467 // destroy selection arbitrator, if any
468 if (formElement
instanceof ISelectableElement
) {
469 destroySelectionArbitrator(((ISelectableElement
) formElement
).getSelectionArbitrator());
471 // remove this element form its parents list of elements
472 // ICdmFormElement parentElement = formElement.getParentElement();
473 // if(parentElement != null){
474 // parentElement.removeElement(formElement);
476 // call destroy on child elements recursively
477 for (ICdmFormElement childElement
: formElement
.getElements()) {
478 destroyElement(childElement
);
480 // dispose of the controls
481 for (Control control
: formElement
.getControls()) {
482 // we added the layoutComposite of the parental element as the
483 // layout composite to this formElement
484 // but we do not want to destroy it.
485 if (control
.equals(formElement
.getLayoutComposite())) {
500 * a {@link org.eclipse.swt.widgets.Composite} object.
501 * @return a {@link org.eclipse.swt.widgets.Label} object.
503 public Label
createEmptyCell(Composite parent
) {
504 return this.createLabel(parent
, null);
509 * createMultilineTextWithLabel
513 * a {@link java.lang.String} object.
518 * @param parentElement
519 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
521 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
524 public TextWithLabelElement
createMultilineTextWithLabel(ICdmFormElement parentElement
, String labelString
,
525 int textHeight
, int style
) {
526 TextWithLabelElement element
= new TextWithLabelElement(this, parentElement
, labelString
, "", textHeight
, style
);
528 parentElement
.addElement(element
);
534 * createMultiLanguageTextElement
537 * @param parentElement
538 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
541 * a {@link java.lang.String} object.
542 * @param multilanguageText
543 * a {@link java.util.Map} object.
549 * {@link eu.etaxonomy.taxeditor.ui.element.MultilanguageTextElement}
552 public MultilanguageTextElement
createMultiLanguageTextElement(ICdmFormElement parentElement
, String labelString
,
553 Map
<Language
, LanguageString
> multilanguageText
, int textHeight
, int style
) {
554 MultilanguageTextElement element
= new MultilanguageTextElement(this, parentElement
, labelString
,
555 multilanguageText
, textHeight
, style
);
557 parentElement
.addElement(element
);
561 public KeyStatementElement
createKeyStatementElement(ICdmFormElement parentElement
, String labelString
,
562 KeyStatement keyStatement
, int textHeight
, int style
) {
563 KeyStatementElement element
= new KeyStatementElement(this, parentElement
, labelString
, keyStatement
,
566 parentElement
.addElement(element
);
572 * createTextWithLabelElement
576 * a {@link java.lang.String} object.
578 * a {@link java.lang.String} object.
581 * @param parentElement
582 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
584 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
587 public TextWithLabelElement
createTextWithLabelElement(ICdmFormElement parentElement
, String labelString
,
588 String initialText
, int style
) {
589 TextWithLabelElement element
= new TextWithLabelElement(this, parentElement
, labelString
, initialText
, null,
592 parentElement
.addElement(element
);
596 public UriWithLabelElement
createUriWithLabelElement(ICdmFormElement parentElement
, String labelString
,
597 URI initialUri
, int style
) {
598 UriWithLabelElement element
= new UriWithLabelElement(this, parentElement
, labelString
, initialUri
, null, style
);
600 parentElement
.addElement(element
);
611 public OpenUrlSelectorElement
createOpenUrlSelectorElement(ICdmFormElement parentElement
, String labelString
,
612 IOpenUrlEnabled openUrlEnabled
, int style
) {
613 OpenUrlSelectorElement element
= new OpenUrlSelectorElement(this, parentElement
, labelString
, openUrlEnabled
,
616 parentElement
.addElement(element
);
622 * @param parentElement
624 * @param conversationEnabled
629 public EditPasswordElement
createEditPasswordElement(ICdmFormElement parentElement
, String labelString
,
630 ConversationHolder conversation
, User user
, int style
) {
631 EditPasswordElement element
= new EditPasswordElement(this, parentElement
, labelString
, user
, conversation
);
633 parentElement
.addElement(element
);
639 * createIntegerTextWithLabelElement
642 * @param parentElement
643 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
646 * a {@link java.lang.String} object.
647 * @param initialInteger
648 * a {@link java.lang.Integer} object.
652 * {@link eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement}
655 public NumberWithLabelElement
createNumberTextWithLabelElement(
656 ICdmFormElement parentElement
, String labelString
,
657 Number initialNumber
, int style
) {
658 NumberWithLabelElement element
= new NumberWithLabelElement(this,
659 parentElement
, labelString
, initialNumber
, style
);
661 parentElement
.addElement(element
);
667 * createLanguageStringWithLabelElement
670 * @param parentElement
671 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
674 * a {@link java.lang.String} object.
675 * @param languageString
676 * a {@link eu.etaxonomy.cdm.model.common.LanguageString} object.
680 * {@link eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement}
683 public LanguageStringWithLabelElement
createLanguageStringWithLabelElement(ICdmFormElement parentElement
,
684 String labelString
, LanguageString languageString
, int style
) {
685 LanguageStringWithLabelElement element
= new LanguageStringWithLabelElement(this, parentElement
, labelString
,
686 languageString
, style
);
688 parentElement
.addElement(element
);
694 * createLanguageStringWithLabelElement
697 * @param parentElement
698 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
701 * a {@link java.lang.String} object.
702 * @param languageString
703 * a {@link eu.etaxonomy.cdm.model.common.LanguageString} object.
709 * {@link eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement}
712 public LanguageStringWithLabelElement
createLanguageStringWithLabelElement(ICdmFormElement parentElement
,
713 String labelString
, LanguageString languageString
, int height
, int style
) {
714 LanguageStringWithLabelElement element
= new LanguageStringWithLabelElement(this, parentElement
, labelString
,
715 languageString
, height
, style
);
717 parentElement
.addElement(element
);
726 * @param parentElement
727 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
730 * a {@link java.lang.String} object.
733 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
736 public TextWithLabelElement
createTextElement(ICdmFormElement parentElement
, String initialText
, int style
) {
737 TextWithLabelElement element
= new TextWithLabelElement(this, parentElement
, null, initialText
, null, style
);
739 parentElement
.addElement(element
);
745 * createKeyValueViewerElement
748 * @param parentElement
749 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
752 * a {@link java.lang.String} object.
753 * @param valueHeading
754 * a {@link java.lang.String} object.
756 * a {@link java.util.Map} object.
757 * @return a {@link eu.etaxonomy.taxeditor.ui.element.KeyValueViewerElement}
760 public KeyValueViewerElement
createKeyValueViewerElement(ICdmFormElement parentElement
, String keyHeading
,
761 String valueHeading
, Map
<Object
, Object
> map
) {
762 KeyValueViewerElement element
= new KeyValueViewerElement(this, parentElement
, keyHeading
, valueHeading
, map
);
764 parentElement
.addElement(element
);
770 * createTermComboElement
773 * @param termComboType
775 * {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.TermComboType}
777 * @param parentElement
778 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
781 * a {@link java.lang.String} object.
783 * a {@link eu.etaxonomy.cdm.model.common.DefinedTermBase}
787 * @return a {@link eu.etaxonomy.taxeditor.ui.combo.TermComboElement}
791 public <T
extends DefinedTermBase
> TermComboElement
<T
> createTermComboElement(Class
<T
> termComboType
,
792 ICdmFormElement parentElement
, String labelString
, T selection
, int style
) {
793 TermComboElement
<T
> element
= new TermComboElement
<T
>(this, parentElement
, termComboType
, labelString
,
796 parentElement
.addElement(element
);
802 * createTermComboElement
805 * @param termComboType
807 * {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.TermComboType}
809 * @param parentElement
810 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
813 * a {@link java.lang.String} object.
815 * a {@link eu.etaxonomy.cdm.model.common.DefinedTermBase}
819 * @return a {@link eu.etaxonomy.taxeditor.ui.combo.TermComboElement}
823 public <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
825 ICdmFormElement parentElement
,
829 TermComboElement
<T
> element
= new TermComboElement
<T
>(this, parentElement
, termType
, labelString
, selection
, style
);
831 parentElement
.addElement(element
);
837 * createEnumComboElement
840 * @param enumComboType
842 * {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EnumComboType}
844 * @param parentElement
845 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
849 * @return a {@link eu.etaxonomy.taxeditor.ui.term.AbstractEnumComboElement}
852 public <T
extends IEnumTerm
<T
>> EnumComboElement
<T
> createEnumComboElement(
853 Class
<T
> enumComboType
, ICdmFormElement parentElement
,
855 EnumComboElement
<T
> element
= new EnumComboElement
<T
>(this, parentElement
, enumComboType
, style
);
857 parentElement
.addElement(element
);
863 * createBrowserElement
867 * a {@link java.net.URI} object.
870 * @param parentElement
871 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
873 * @return a {@link eu.etaxonomy.taxeditor.ui.element.BrowserElement}
876 public BrowserElement
createBrowserElement(ICdmFormElement parentElement
, URI imageUri
, int style
) {
877 BrowserElement element
= new BrowserElement(this, parentElement
, imageUri
, style
);
879 parentElement
.addElement(element
);
888 * @param parentElement
889 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
892 * a {@link java.net.URI} object.
895 * @return a {@link eu.etaxonomy.taxeditor.ui.element.ImageElement} object.
897 public ImageElement
createImageElement(ICdmFormElement parentElement
, URI imageUri
, int style
) {
898 ImageElement element
= new ImageElement(this, parentElement
, imageUri
, style
);
900 parentElement
.addElement(element
);
906 * createTextActionElement
910 * a {@link java.lang.String} object.
912 * a {@link java.lang.String} object.
915 * @param parentElement
916 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
919 * a {@link java.lang.String} object.
920 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextActionElement}
923 public TextActionElement
createTextActionElement(ICdmFormElement parentElement
, String labelString
,
924 String buttonLabel
, String initialText
, int style
) {
925 TextActionElement element
= new TextActionElement(this, parentElement
, labelString
, buttonLabel
, initialText
,
928 parentElement
.addElement(element
);
937 * @param parentElement
938 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
941 * a {@link java.lang.String} object.
942 * @param initialState
946 * @return a {@link eu.etaxonomy.taxeditor.ui.element.CheckboxElement}
949 public CheckboxElement
createCheckbox(ICdmFormElement parentElement
, String label
, boolean initialState
, int style
) {
950 CheckboxElement element
= new CheckboxElement(this, parentElement
, label
, initialState
, style
| orientation
);
952 parentElement
.addElement(element
);
957 * Creates a section as a part of the form.
959 * @return the section widget
962 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
965 public Section
adapt(AbstractFormSection section
) {
966 section
.setMenu(section
.getLayoutComposite().getMenu());
967 adapt(section
, true, true);
969 // handle focus and property change events for cdm use
970 section
.addFocusListener(selectionFocusHandler
);
971 section
.setPropertyChangeListeners(propertyChangeListeners
);
973 if (section
.getToggle() != null) {
974 section
.getToggle().setHoverDecorationColor(getColors().getColor(IFormColors
.TB_TOGGLE_HOVER
));
975 section
.getToggle().setDecorationColor(getColors().getColor(IFormColors
.TB_TOGGLE
));
978 section
.setFont(boldFontHolder2
.getBoldFont(section
.getLayoutComposite().getFont()));
980 if ((section
.getStyle() & ExpandableComposite
.TITLE_BAR
) != 0
981 || (section
.getStyle() & ExpandableComposite
.SHORT_TITLE_BAR
) != 0) {
982 getColors().initializeSectionToolBarColors();
983 section
.setTitleBarBackground(getColors().getColor(IFormColors
.TB_BG
));
984 section
.setTitleBarBorderColor(getColors().getColor(IFormColors
.TB_BORDER
));
986 // call setTitleBarForeground regardless as it also sets the label color
987 section
.setTitleBarForeground(getColors().getColor(IFormColors
.TB_TOGGLE
));
991 private class BoldFontHolder2
{
992 private Font normalFont
;
994 private Font boldFont
;
996 public BoldFontHolder2() {
999 public Font
getBoldFont(Font font
) {
1000 createBoldFont(font
);
1004 private void createBoldFont(Font font
) {
1005 if (normalFont
== null || !normalFont
.equals(font
)) {
1009 if (boldFont
== null) {
1010 boldFont
= FormFonts
.getInstance().getBoldFont(getColors().getDisplay(), normalFont
);
1014 public void dispose() {
1015 if (boldFont
!= null) {
1016 FormFonts
.getInstance().markFinished(boldFont
, getColors().getDisplay());
1024 * createToggleableTextField
1027 * @param parentElement
1028 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1030 * @param labelString
1031 * a {@link java.lang.String} object.
1032 * @param initialText
1033 * a {@link java.lang.String} object.
1034 * @param initialState
1038 * @return a {@link eu.etaxonomy.taxeditor.ui.element.ToggleableTextElement}
1041 public ToggleableTextElement
createToggleableTextField(ICdmFormElement parentElement
, String labelString
,
1042 String initialText
, boolean initialState
, int style
) {
1043 ToggleableTextElement element
= new ToggleableTextElement(this, parentElement
, labelString
, initialText
,
1044 initialState
, style
| orientation
);
1046 parentElement
.addElement(element
);
1052 * createTimePeriodElement
1055 * @param parentElement
1056 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1058 * @param labelString
1059 * a {@link java.lang.String} object.
1061 * a {@link eu.etaxonomy.cdm.model.common.TimePeriod} object.
1064 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TimePeriodElement}
1067 public TimePeriodElement
createTimePeriodElement(ICdmFormElement parentElement
, String labelString
,
1068 TimePeriod timePeriod
, int style
) {
1069 TimePeriodElement element
= new TimePeriodElement(this, parentElement
, labelString
, timePeriod
, style
);
1071 parentElement
.addElement(element
);
1077 * createGatheringEventUnitElement
1080 * @param parentElement
1081 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1083 * @param labelString
1084 * a {@link java.lang.String} object.
1086 * a {@link eu.etaxonomy.cdm.model.common.GatheringEvent} object.
1089 * @return a {@link eu.etaxonomy.taxeditor.ui.element.GatheringEventUnitElement}
1092 public GatheringEventUnitElement
createGatheringEventUnitElement(
1093 ICdmFormElement parentElement
,
1095 DerivedUnitFacade gatheringEvent
,
1096 MinMaxTextSection
.UnitType unitType
,
1098 GatheringEventUnitElement element
= new GatheringEventUnitElement(this,
1105 parentElement
.addElement(element
);
1111 * createPointElement
1116 * @param parentElement
1117 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1120 * a {@link eu.etaxonomy.cdm.model.location.Point} object.
1121 * @return a {@link eu.etaxonomy.taxeditor.ui.element.PointElement} object.
1123 public PointElement
createPointElement(ICdmFormElement parentElement
, Point point
, int style
) {
1124 PointElement element
= new PointElement(this, parentElement
, point
, style
);
1126 parentElement
.addElement(element
);
1132 * createDateDetailSection
1135 * @param parentElement
1136 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1140 * @return a {@link eu.etaxonomy.taxeditor.ui.element.DateDetailSection}
1143 public DateDetailSection
createDateDetailSection(ICdmFormElement parentElement
, int style
) {
1144 DateDetailSection section
= new DateDetailSection(this, parentElement
, style
);
1145 parentElement
.addElement(section
);
1152 * createDateDetailSection
1155 * @param parentElement
1156 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1160 * @return a {@link eu.etaxonomy.taxeditor.ui.element.MinMaxTextSection}
1163 public MinMaxTextSection
createMinMaxTextSection(ICdmFormElement parentElement
, UnitType unitType
, int style
) {
1164 MinMaxTextSection section
= new MinMaxTextSection(this, parentElement
, unitType
, style
);
1165 parentElement
.addElement(section
);
1172 * createPartialElement
1175 * @param parentElement
1176 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1178 * @param labelString
1179 * a {@link java.lang.String} object.
1181 * a {@link org.joda.time.Partial} object.
1184 * @return a {@link eu.etaxonomy.taxeditor.ui.element.PartialElement}
1187 public PartialElement
createPartialElement(ICdmFormElement parentElement
, String labelString
, Partial partial
,
1189 PartialElement element
= new PartialElement(this, parentElement
, labelString
, style
);
1191 parentElement
.addElement(element
);
1197 * addSelectionListener
1201 * a {@link org.eclipse.swt.events.SelectionListener} object.
1203 public void addSelectionListener(SelectionListener listener
) {
1204 selectionListenerList
.add(listener
);
1209 * removeSelectionListener
1213 * a {@link org.eclipse.swt.events.SelectionListener} object.
1215 public void removeSelectionListener(SelectionListener listener
) {
1216 if (listener
== null) {
1217 AbstractUtility
.error(this.getClass(),
1218 "Tried to remove a selection listener from this factories listeners but was null", null);
1220 selectionListenerList
.remove(listener
);
1226 * addPropertyChangeListener
1230 * a {@link org.eclipse.jface.util.IPropertyChangeListener}
1233 public void addPropertyChangeListener(IPropertyChangeListener listener
) {
1234 if (propertyChangeListeners
.contains(listener
)) {
1237 propertyChangeListeners
.add(0, listener
);
1242 * removePropertyChangeListener
1246 * a {@link org.eclipse.jface.util.IPropertyChangeListener}
1249 public void removePropertyChangeListener(IPropertyChangeListener listener
) {
1250 propertyChangeListeners
.remove(listener
);
1254 * @return the propertyChangeListeners
1256 public List
<IPropertyChangeListener
> getPropertyChangeListeners() {
1257 return propertyChangeListeners
;
1262 * createHorizontalSeparator
1265 * @param parentElement
1266 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1270 * @return a {@link org.eclipse.swt.widgets.Label} object.
1272 public Label
createHorizontalSeparator(ICdmFormElement parentElement
, int style
) {
1273 Label separator
= this.createSeparator(parentElement
.getLayoutComposite(), SWT
.HORIZONTAL
| style
);
1274 separator
.setLayoutData(LayoutConstants
.FILL_HORIZONTALLY());
1280 * createVersionElement
1283 * @param parentElement
1284 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1287 * a {@link eu.etaxonomy.cdm.model.common.VersionableEntity}
1292 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.VersionElement}
1295 public VersionElement
createVersionElement(ICdmFormElement parentElement
, VersionableEntity entity
, int style
) {
1296 VersionElement element
= new VersionElement(this, parentElement
, entity
, style
);
1298 parentElement
.addElement(element
);
1303 * @param cdmBaseSection
1308 public CdmBaseElement
createCdmBaseElement(ICdmFormElement parentElement
, CdmBase entity
, int style
) {
1309 CdmBaseElement element
= new CdmBaseElement(this, parentElement
, entity
, style
);
1311 parentElement
.addElement(element
);
1317 * createVersionSection
1320 * @param parentElement
1321 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1326 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.VersionSection}
1329 public VersionSection
createVersionSection(ICdmFormElement parentElement
, int style
) {
1330 VersionSection section
= new VersionSection(this, parentElement
, style
);
1331 parentElement
.addElement(section
);
1341 public CdmBaseSection
createCdmBaseSection(ICdmFormElement parentElement
, int style
) {
1342 CdmBaseSection section
= new CdmBaseSection(this, parentElement
, style
);
1343 parentElement
.addElement(section
);
1350 * createEmptyElement
1353 * @param parentElement
1354 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1356 * @return a {@link eu.etaxonomy.taxeditor.ui.section.EmptyElement} object.
1358 public EmptyElement
createEmptyElement(ICdmFormElement parentElement
) {
1359 EmptyElement element
= new EmptyElement(this, parentElement
, null, SWT
.NULL
);
1361 parentElement
.addElement(element
);
1367 * createHeadlineSection
1370 * @param parentElement
1371 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1374 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.HeadlineSection}
1377 public HeadlineSection
createHeadlineSection(ICdmFormElement parentElement
) {
1378 HeadlineSection section
= new HeadlineSection(this, parentElement
, SWT
.NULL
);
1379 parentElement
.addElement(section
);
1386 * createParsingMessageElement
1389 * @param parentElement
1390 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1392 * @param parserProblem
1393 * a {@link eu.etaxonomy.cdm.strategy.parser.ParserProblem}
1398 * {@link eu.etaxonomy.taxeditor.ui.section.taxon.ParsingMessageElement}
1401 public ParsingMessageElement
createParsingMessageElement(ICdmFormElement parentElement
,
1402 ParserProblem parserProblem
, int style
) {
1403 ParsingMessageElement element
= new ParsingMessageElement(this, parentElement
, parserProblem
, style
);
1405 parentElement
.addElement(element
);
1409 public AbstractFormSection
createDefinedTermDetailSection(Class definedTermClass
, ConversationHolder conversation
,
1410 ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
1412 AbstractFormSection section
= new DefinedTermDetailSection(this, definedTermClass
, conversation
, parentElement
,
1413 selectionProvider
, style
);
1415 parentElement
.addElement(section
);
1422 * @param definedTermClass
1423 * @param formElement
1427 public AbstractCdmDetailElement
createDefinedTermDetailElement(Class definedTermClass
,
1428 AbstractCdmDetailSection parentElement
, int style
) {
1429 AbstractCdmDetailElement element
= null;
1431 if (NamedArea
.class.isAssignableFrom(definedTermClass
)) {
1432 element
= new eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement(this, parentElement
);
1433 } else if (definedTermClass
.equals(Feature
.class)) {
1434 element
= new FeatureDetailElement(this, parentElement
);
1436 element
= new DefinedTermDetailElement(this, parentElement
);
1440 parentElement
.addElement(element
);
1445 //--------DetailSections---------
1446 public NameDetailSection
createNameDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1447 NameDetailSection section
= new NameDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1448 addAndAdaptSection(parentElement
, section
);
1452 public ReferenceDetailSection
createReferenceDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1453 ReferenceDetailSection section
= new ReferenceDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1454 addAndAdaptSection(parentElement
, section
);
1458 public NomenclaturalReferenceDetailSection
createNomenclaturalReferenceDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1459 NomenclaturalReferenceDetailSection section
= new NomenclaturalReferenceDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1460 addAndAdaptSection(parentElement
, section
);
1464 public TaxonBaseDetailSection
createTaxonBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1465 TaxonBaseDetailSection section
= new TaxonBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1466 addAndAdaptSection(parentElement
, section
);
1470 public AuthorshipDetailSection
createAuthorshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1471 AuthorshipDetailSection section
= new AuthorshipDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1472 addAndAdaptSection(parentElement
, section
);
1476 public TeamOrPersonBaseDetailSection
createTeamOrPersonBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1477 TeamOrPersonBaseDetailSection section
= new TeamOrPersonBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1478 addAndAdaptSection(parentElement
, section
);
1482 public TeamDetailSection
createTeamDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1483 TeamDetailSection section
= new TeamDetailSection(this, conversation
, parentElement
, null, style
);
1484 addAndAdaptSection(parentElement
, section
);
1488 public PersonDetailSection
createPersonDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1489 PersonDetailSection section
= new PersonDetailSection(this, conversation
, parentElement
, null, style
);
1490 addAndAdaptSection(parentElement
, section
);
1494 public DescriptionDetailSection
createDescriptionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1495 DescriptionDetailSection section
= new DescriptionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1496 addAndAdaptSection(parentElement
, section
);
1500 public DescriptionElementDetailSection
createDescriptionElementDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1501 DescriptionElementDetailSection section
= new DescriptionElementDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1502 addAndAdaptSection(parentElement
, section
);
1506 public ParsingMessagesSection
createParsingMessagesSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1507 ParsingMessagesSection section
= new ParsingMessagesSection(this, conversation
, parentElement
, selectionProvider
, style
);
1508 addAndAdaptSection(parentElement
, section
);
1512 public NonViralNameDetailSection
createNonViralNameDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1513 NonViralNameDetailSection section
= new NonViralNameDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1514 addAndAdaptSection(parentElement
, section
);
1518 public MediaDetailsSection
createMediaDetailsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1519 MediaDetailsSection section
= new MediaDetailsSection(this, conversation
, parentElement
, selectionProvider
, style
);
1520 addAndAdaptSection(parentElement
, section
);
1524 public DerivedUnitFacadeDetailSection
createDerivedUnitFacadeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1525 DerivedUnitFacadeDetailSection section
= new DerivedUnitFacadeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1526 addAndAdaptSection(parentElement
, section
);
1530 public FieldUnitDetailSection
createFieldUnitDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1531 FieldUnitDetailSection section
= new FieldUnitDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1532 addAndAdaptSection(parentElement
, section
);
1536 public GatheringEventDetailSection
createGatheringEventDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1537 GatheringEventDetailSection section
= new GatheringEventDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1538 addAndAdaptSection(parentElement
, section
);
1542 public DerivedUnitBaseDetailSection
createDerivedUnitBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1543 DerivedUnitBaseDetailSection section
= new DerivedUnitBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1544 addAndAdaptSection(parentElement
, section
);
1548 public NaturalLanguageSection
createNaturalLanguageSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1549 NaturalLanguageSection section
= new NaturalLanguageSection(this, conversation
, parentElement
, selectionProvider
, style
);
1550 addAndAdaptSection(parentElement
, section
);
1554 public FeatureDistributionDetailSection
createFeatureDistributionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1555 FeatureDistributionDetailSection section
= new FeatureDistributionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1556 addAndAdaptSection(parentElement
, section
);
1560 public ClassificationDetailSection
createClassificationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1561 ClassificationDetailSection section
= new ClassificationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1562 addAndAdaptSection(parentElement
, section
);
1566 public TaxonNodeDetailSection
createTaxonNodeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1567 TaxonNodeDetailSection section
= new TaxonNodeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1568 addAndAdaptSection(parentElement
, section
);
1572 public PolytomousKeyDetailSection
createPolytomousKeyDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1573 PolytomousKeyDetailSection section
= new PolytomousKeyDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1574 addAndAdaptSection(parentElement
, section
);
1578 public PolytomousKeyNodeDetailSection
createPolytomousKeyNodeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1579 PolytomousKeyNodeDetailSection section
= new PolytomousKeyNodeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1580 addAndAdaptSection(parentElement
, section
);
1584 public InstitutionDetailSection
createInstitutionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1585 InstitutionDetailSection section
= new InstitutionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1586 addAndAdaptSection(parentElement
, section
);
1590 public FieldUnitGeneralDetailSection
createFieldUnitGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1591 FieldUnitGeneralDetailSection section
= new FieldUnitGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1592 addAndAdaptSection(parentElement
, section
);
1596 public DerivedUnitGeneralDetailSection
createDerivedUnitGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1597 DerivedUnitGeneralDetailSection section
= new DerivedUnitGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1598 addAndAdaptSection(parentElement
, section
);
1602 public HybridDetailSection
createHybridDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1603 HybridDetailSection section
= new HybridDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1604 addAndAdaptSection(parentElement
, section
);
1608 public UserDetailSection
createUserDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1609 UserDetailSection section
= new UserDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1610 addAndAdaptSection(parentElement
, section
);
1614 public GroupDetailSection
createGroupDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1615 GroupDetailSection section
= new GroupDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1616 addAndAdaptSection(parentElement
, section
);
1620 public DeterminationDetailSection
createDeterminationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1621 DeterminationDetailSection section
= new DeterminationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1622 addAndAdaptSection(parentElement
, section
);
1626 public TaxonRelationshipDetailSection
createTaxonRelationshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1627 TaxonRelationshipDetailSection section
= new TaxonRelationshipDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1628 addAndAdaptSection(parentElement
, section
);
1632 public ReferencedEntityDetailSection
createReferencedEntityDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1633 ReferencedEntityDetailSection section
= new ReferencedEntityDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1634 addAndAdaptSection(parentElement
, section
);
1638 public TermVocabularyDetailSection
createTermVocabularyDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1639 TermVocabularyDetailSection section
= new TermVocabularyDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1640 addAndAdaptSection(parentElement
, section
);
1644 public GatheringEventDetailSection
createGatheringSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1645 GatheringEventDetailSection section
= new GatheringEventDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1646 addAndAdaptSection(parentElement
, section
);
1650 public NamedAreaDetailSection
createNamedAreaDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1651 NamedAreaDetailSection section
= new NamedAreaDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1652 addAndAdaptSection(parentElement
, section
);
1656 public UseRecordDetailSection
createUseRecordDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1657 UseRecordDetailSection section
= new UseRecordDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1658 addAndAdaptSection(parentElement
, section
);
1662 private void addAndAdaptSection(ICdmFormElement parentElement
, AbstractFormSection
<?
> section
) {
1663 parentElement
.addElement(section
);
1667 //--------DetailElements------------
1669 public UseRecordDetailElement
createUseRecordDetailElement(ICdmFormElement parentElement
){
1670 UseRecordDetailElement element
= new UseRecordDetailElement(this, parentElement
);
1671 addAndAdaptElement(parentElement
, element
);
1675 public DefinedTermDetailElement
<NamedAreaLevel
> createNamedAreaLevelElement(ICdmFormElement parentElement
){
1676 DefinedTermDetailElement
<NamedAreaLevel
> element
= new DefinedTermDetailElement
<NamedAreaLevel
>(this, parentElement
);
1677 addAndAdaptElement(parentElement
, element
);
1681 public eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement
createNamedAreaDetailElement(ICdmFormElement parentElement
){
1682 eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement element
= new eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement(this, parentElement
);
1683 addAndAdaptElement(parentElement
, element
);
1687 public TermVocabularyDetailElement
createTermVocabularyDetailElement(ICdmFormElement parentElement
){
1688 TermVocabularyDetailElement element
= new TermVocabularyDetailElement(this, parentElement
);
1689 addAndAdaptElement(parentElement
, element
);
1693 public ReferenceEntityDetailElement
createReferenceEntityDetailElement(ICdmFormElement parentElement
){
1694 ReferenceEntityDetailElement element
= new ReferenceEntityDetailElement(this, parentElement
);
1695 addAndAdaptElement(parentElement
, element
);
1699 public TaxonRelationshipDetailElement
createTaxonRelationshipDetailElement(ICdmFormElement parentElement
){
1700 TaxonRelationshipDetailElement element
= new TaxonRelationshipDetailElement(this, parentElement
);
1701 addAndAdaptElement(parentElement
, element
);
1705 public GrantedAuthorityDetailElement
createGrantedAuthorityDetailElement(ICdmFormElement parentElement
){
1706 GrantedAuthorityDetailElement element
= new GrantedAuthorityDetailElement(this, parentElement
);
1707 addAndAdaptElement(parentElement
, element
);
1711 public GroupDetailElement
createGroupDetailElement(ICdmFormElement parentElement
){
1712 GroupDetailElement element
= new GroupDetailElement(this, parentElement
);
1713 addAndAdaptElement(parentElement
, element
);
1717 public UserDetailElement
createUserDetailElement(ICdmFormElement parentElement
){
1718 UserDetailElement element
= new UserDetailElement(this, parentElement
);
1719 addAndAdaptElement(parentElement
, element
);
1723 public HybridDetailElement
createHybridDetailElement(ICdmFormElement parentElement
){
1724 HybridDetailElement element
= new HybridDetailElement(this, parentElement
);
1725 addAndAdaptElement(parentElement
, element
);
1729 public InstitutionDetailElement
createInstitutionDetailElement(ICdmFormElement parentElement
){
1730 InstitutionDetailElement element
= new InstitutionDetailElement(this, parentElement
);
1731 addAndAdaptElement(parentElement
, element
);
1735 public PolytomousKeyNodeDetailElement
createPolytomousKeyNodeDetailElement(ICdmFormElement parentElement
){
1736 PolytomousKeyNodeDetailElement element
= new PolytomousKeyNodeDetailElement(this, parentElement
);
1737 addAndAdaptElement(parentElement
, element
);
1741 public PolytomousKeyDetailElement
createPolytomousKeyDetailElement(ICdmFormElement parentElement
){
1742 PolytomousKeyDetailElement element
= new PolytomousKeyDetailElement(this, parentElement
);
1743 addAndAdaptElement(parentElement
, element
);
1747 public CollectionDetailElement
createCollectionDetailElement(ICdmFormElement parentElement
){
1748 CollectionDetailElement element
= new CollectionDetailElement(this, parentElement
);
1749 addAndAdaptElement(parentElement
, element
);
1753 public TaxonNodeDetailElement
createTaxonNodeDetailElement(ICdmFormElement parentElement
){
1754 TaxonNodeDetailElement element
= new TaxonNodeDetailElement(this, parentElement
);
1755 addAndAdaptElement(parentElement
, element
);
1759 public ClassificationDetailElement
createClassificationDetailElement(ICdmFormElement parentElement
){
1760 ClassificationDetailElement element
= new ClassificationDetailElement(this, parentElement
);
1761 addAndAdaptElement(parentElement
, element
);
1765 public FeatureDistributionDetailElement
createFeatureDistributionDetailElement(ICdmFormElement parentElement
){
1766 FeatureDistributionDetailElement element
= new FeatureDistributionDetailElement(this, parentElement
);
1767 addAndAdaptElement(parentElement
, element
);
1771 public NaturalLanguageDetailElement
createNaturalLanguageDetailElement(ICdmFormElement parentElement
){
1772 NaturalLanguageDetailElement element
= new NaturalLanguageDetailElement(this, parentElement
);
1773 addAndAdaptElement(parentElement
, element
);
1777 public DerivedUnitFacadeDetailElement
createDerivedUnitFacadeDetailElement(ICdmFormElement parentElement
){
1778 DerivedUnitFacadeDetailElement element
= new DerivedUnitFacadeDetailElement(this, parentElement
);
1779 addAndAdaptElement(parentElement
, element
);
1783 public NonViralNameDetailElement
createNonViralNameDetailElement(ICdmFormElement parentElement
){
1784 NonViralNameDetailElement element
= new NonViralNameDetailElement(this, parentElement
);
1785 addAndAdaptElement(parentElement
, element
);
1789 public DescriptionElementDetailElement
createDescriptionElementDetailElement(ICdmFormElement parentElement
, int style
){
1790 DescriptionElementDetailElement element
= new DescriptionElementDetailElement(this, parentElement
, style
);
1791 addAndAdaptElement(parentElement
, element
);
1795 public DescriptionDetailElement
createDescriptionDetailElement(ICdmFormElement parentElement
, int style
){
1796 DescriptionDetailElement element
= new DescriptionDetailElement(this, parentElement
, style
);
1797 addAndAdaptElement(parentElement
, element
);
1801 public PersonDetailElement
createPersonDetailElement(ICdmFormElement parentElement
, int style
){
1802 PersonDetailElement element
= new PersonDetailElement(this, parentElement
, style
);
1803 addAndAdaptElement(parentElement
, element
);
1807 public TeamDetailElement
createTeamDetailElement(ICdmFormElement parentElement
, int style
){
1808 TeamDetailElement element
= new TeamDetailElement(this, parentElement
, style
);
1809 addAndAdaptElement(parentElement
, element
);
1813 public AuthorshipDetailElement
createAuthorshipDetailElement(ICdmFormElement parentElement
, int style
){
1814 AuthorshipDetailElement element
= new AuthorshipDetailElement(this, parentElement
, style
);
1815 addAndAdaptElement(parentElement
, element
);
1819 public TaxonBaseDetailElement
createTaxonBaseDetailElement(ICdmFormElement parentElement
, int style
){
1820 TaxonBaseDetailElement element
= new TaxonBaseDetailElement(this, parentElement
, style
);
1821 addAndAdaptElement(parentElement
, element
);
1825 public NameDetailElement
createNameDetailElement(ICdmFormElement parentElement
, int style
){
1826 NameDetailElement element
= new NameDetailElement(this, parentElement
, style
);
1827 addAndAdaptElement(parentElement
, element
);
1831 public ReferenceDetailElement
createReferenceDetailElement(ICdmFormElement parentElement
, int style
){
1832 ReferenceDetailElement element
= new ReferenceDetailElement(this, parentElement
, style
);
1833 addAndAdaptElement(parentElement
, element
);
1837 public NomenclaturalReferenceDetailElement
createNomenclaturalReferenceDetailElement(ICdmFormElement parentElement
, int style
){
1838 NomenclaturalReferenceDetailElement element
= new NomenclaturalReferenceDetailElement(this, parentElement
, style
);
1839 addAndAdaptElement(parentElement
, element
);
1844 public FieldUnitGeneralDetailElement
createFieldUnitGeneralDetailElement(ICdmFormElement parentElement
){
1845 FieldUnitGeneralDetailElement element
= new FieldUnitGeneralDetailElement(this, parentElement
);
1846 addAndAdaptElement(parentElement
, element
);
1850 public DerivedUnitGeneralDetailElement
createDerivedUnitGeneralDetailElement(ICdmFormElement parentElement
){
1851 DerivedUnitGeneralDetailElement element
= new DerivedUnitGeneralDetailElement(this, parentElement
);
1852 addAndAdaptElement(parentElement
, element
);
1857 public GatheringEventDetailElement
createGatheringEventDetailElement(ICdmFormElement parentElement
) {
1858 GatheringEventDetailElement element
= new GatheringEventDetailElement(this, parentElement
);
1859 addAndAdaptElement(parentElement
, element
);
1863 public FieldUnitDetailElement
createFieldUnitDetailElement(ICdmFormElement parentElement
) {
1864 FieldUnitDetailElement element
= new FieldUnitDetailElement(this, parentElement
);
1865 addAndAdaptElement(parentElement
, element
);
1870 public DerivedUnitBaseDetailElement
createDerivedUnitBaseDetailElement(ICdmFormElement parentElement
) {
1871 DerivedUnitBaseDetailElement element
= new DerivedUnitBaseDetailElement(this, parentElement
);
1872 addAndAdaptElement(parentElement
, element
);
1876 public DeterminationDetailElement
createDeterminationDetailElement(ICdmFormElement parentElement
) {
1877 DeterminationDetailElement element
= new DeterminationDetailElement(this, parentElement
);
1878 addAndAdaptElement(parentElement
, element
);
1883 * @param parentElement
1886 private void addAndAdaptElement(ICdmFormElement parentElement
, AbstractCdmDetailElement
<?
> element
) {
1888 parentElement
.addElement(element
);
1891 //--------EntityCollectionSection----------
1892 public TeamMemberSection
createTeamMemberSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1893 TeamMemberSection section
= new TeamMemberSection(this, conversation
, parentElement
, style
);
1894 addAndAdaptSection(parentElement
, section
);
1898 public AnnotationSection
createAnnotationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1899 AnnotationSection section
= new AnnotationSection(this, conversation
, parentElement
, style
);
1900 addAndAdaptSection(parentElement
, section
);
1904 public CreditSection
createCreditSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1905 CreditSection section
= new CreditSection(this, conversation
, parentElement
, style
);
1906 addAndAdaptSection(parentElement
, section
);
1910 public DescriptionElementSourceSection
createDescriptionElementSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1911 DescriptionElementSourceSection section
= new DescriptionElementSourceSection(this, conversation
, parentElement
, style
);
1912 addAndAdaptSection(parentElement
, section
);
1916 public ExtensionSection
createExtensionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1917 ExtensionSection section
= new ExtensionSection(this, conversation
, parentElement
, style
);
1918 addAndAdaptSection(parentElement
, section
);
1922 public MarkerSection
createMarkerSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1923 MarkerSection section
= new MarkerSection(this, conversation
, parentElement
, style
);
1924 addAndAdaptSection(parentElement
, section
);
1928 public MediaSection
createMediaSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1929 MediaSection section
= new MediaSection(this, conversation
, parentElement
, style
);
1930 addAndAdaptSection(parentElement
, section
);
1934 public DescriptionElementMediaSection
createDescriptionElementMediaSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1935 DescriptionElementMediaSection section
= new DescriptionElementMediaSection(this, conversation
, parentElement
, style
);
1936 addAndAdaptSection(parentElement
, section
);
1940 public MediaRepresentationSection
createMediaRepresentationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1941 MediaRepresentationSection section
= new MediaRepresentationSection(this, conversation
, parentElement
, style
);
1942 addAndAdaptSection(parentElement
, section
);
1946 public MediaRepresentationPartSection
createMediaRepresentationPartSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1947 MediaRepresentationPartSection section
= new MediaRepresentationPartSection(this, conversation
, parentElement
, style
);
1948 addAndAdaptSection(parentElement
, section
);
1952 public ModifierSection
createModifierSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1953 ModifierSection section
= new ModifierSection(this, conversation
, parentElement
, style
);
1954 addAndAdaptSection(parentElement
, section
);
1958 public NomenclaturalStatusSection
createNomenclaturalStatusSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1959 NomenclaturalStatusSection section
= new NomenclaturalStatusSection(this, conversation
, parentElement
, style
);
1960 addAndAdaptSection(parentElement
, section
);
1964 public NameRelationshipDetailSection
createNameRelationshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1965 NameRelationshipDetailSection section
= new NameRelationshipDetailSection(this, conversation
, parentElement
, style
);
1966 addAndAdaptSection(parentElement
, section
);
1970 public ProtologueSection
createProtologueSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1971 ProtologueSection section
= new ProtologueSection(this, conversation
, parentElement
, style
);
1972 addAndAdaptSection(parentElement
, section
);
1976 public RightsSection
createRightsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1977 RightsSection section
= new RightsSection(this, conversation
, parentElement
, style
);
1978 addAndAdaptSection(parentElement
, section
);
1982 public SourceSection
createSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1983 SourceSection section
= new SourceSection(this, conversation
, parentElement
, style
);
1984 addAndAdaptSection(parentElement
, section
);
1988 public ScopeSection
createScopeSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1989 ScopeSection section
= new ScopeSection(this, conversation
, parentElement
, style
);
1990 addAndAdaptSection(parentElement
, section
);
1994 public DescriptionSourceSection
createDescriptionSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1995 DescriptionSourceSection section
= new DescriptionSourceSection(this, conversation
, parentElement
, style
);
1996 addAndAdaptSection(parentElement
, section
);
2000 public TypeDesignationSection
createTypeDesignationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2001 TypeDesignationSection section
= new TypeDesignationSection(this, conversation
, parentElement
, style
);
2002 addAndAdaptSection(parentElement
, section
);
2006 public StateDataSection
createStateDataSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2007 StateDataSection section
= new StateDataSection(this, conversation
, parentElement
, style
);
2008 addAndAdaptSection(parentElement
, section
);
2012 public StatisticalMeasurementValueSection
createStatisticalMeasurementValueSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2013 StatisticalMeasurementValueSection section
= new StatisticalMeasurementValueSection(this, conversation
, parentElement
, style
);
2014 addAndAdaptSection(parentElement
, section
);
2018 public DescribedSpecimenSection
createDescribedSpecimenSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2019 DescribedSpecimenSection section
= new DescribedSpecimenSection(this, conversation
, parentElement
, style
);
2020 addAndAdaptSection(parentElement
, section
);
2024 public CollectingAreasDetailSection
createCollectingAreasDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2025 CollectingAreasDetailSection section
= new CollectingAreasDetailSection(this, conversation
, parentElement
, style
);
2026 addAndAdaptSection(parentElement
, section
);
2030 public CurrentDeterminationDetailSection
createCurrentDeterminationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2031 CurrentDeterminationDetailSection section
= new CurrentDeterminationDetailSection(this, conversation
, parentElement
, style
);
2032 addAndAdaptSection(parentElement
, section
);
2036 public DeterminationHistoryDetailSection
createDeterminationHistoryDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2037 DeterminationHistoryDetailSection section
= new DeterminationHistoryDetailSection(this, conversation
, parentElement
, style
);
2038 addAndAdaptSection(parentElement
, section
);
2042 public SpecimenCollectionDetailSection
createSpecimenCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2043 SpecimenCollectionDetailSection section
= new SpecimenCollectionDetailSection(this, conversation
, parentElement
, style
);
2044 addAndAdaptSection(parentElement
, section
);
2048 public SourceCollectionDetailSection
createSourceCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2049 SourceCollectionDetailSection section
= new SourceCollectionDetailSection(this, conversation
, parentElement
, style
);
2050 addAndAdaptSection(parentElement
, section
);
2054 public GeographicalScopeDetailSection
createGeographicalScopeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2055 GeographicalScopeDetailSection section
= new GeographicalScopeDetailSection(this, conversation
, parentElement
, style
);
2056 addAndAdaptSection(parentElement
, section
);
2060 public ScopeRestrictionSection
createScopeRestrictionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2061 ScopeRestrictionSection section
= new ScopeRestrictionSection(this, conversation
, parentElement
, style
);
2062 addAndAdaptSection(parentElement
, section
);
2066 public MemberDetailSection
createMemberDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2067 MemberDetailSection section
= new MemberDetailSection(this, conversation
, parentElement
, style
);
2068 addAndAdaptSection(parentElement
, section
);
2072 public GrantedAuthorityDetailSection
createGrantedAuthorityDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2073 GrantedAuthorityDetailSection section
= new GrantedAuthorityDetailSection(this, conversation
, parentElement
, style
);
2074 addAndAdaptSection(parentElement
, section
);
2078 public GroupsByUserDetailSection
createGroupsByUserDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2079 GroupsByUserDetailSection section
= new GroupsByUserDetailSection(this, conversation
, parentElement
, style
);
2080 addAndAdaptSection(parentElement
, section
);
2084 public TaxonomicScopeSection
createTaxonomicScopeSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2085 TaxonomicScopeSection section
= new TaxonomicScopeSection(this, conversation
, parentElement
, style
);
2086 addAndAdaptSection(parentElement
, section
);
2092 * createEntityCollectionElement
2095 * @param removeListener
2096 * a {@link org.eclipse.swt.events.SelectionListener} object.
2099 * @param parentElement
2101 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
2103 * @param versionableEntity
2104 * a {@link eu.etaxonomy.cdm.model.common.IVersionableEntity}
2106 * @param backgroundColor
2107 * a {@link org.eclipse.swt.graphics.Color} object.
2109 * {@link eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement}
2112 public AbstractEntityCollectionElement
createEntityCollectionElement(AbstractFormSection parentElement
,
2113 Object versionableEntity
, SelectionListener removeListener
, Color backgroundColor
, int style
) {
2114 AbstractEntityCollectionElement element
= null;
2116 Object entity
= HibernateProxyHelper
.deproxy(versionableEntity
);
2118 if (entity
instanceof Annotation
) {
2119 element
= new AnnotationElement(this, parentElement
, (Annotation
) entity
, removeListener
, style
);
2120 } else if (entity
instanceof Person
) {
2121 element
= new TeamMemberElement(this, parentElement
, (Person
) entity
, removeListener
, style
);
2122 } else if (entity
instanceof Credit
) {
2123 element
= new CreditElement(this, parentElement
, (Credit
) entity
, removeListener
, style
);
2124 } else if (entity
instanceof Extension
) {
2125 element
= new ExtensionElement(this, parentElement
, (Extension
) entity
, removeListener
, style
);
2126 } else if (entity
instanceof Marker
) {
2127 element
= new MarkerElement(this, parentElement
, (Marker
) entity
, removeListener
, style
);
2128 } else if (entity
instanceof Media
) {
2129 element
= new MediaElement(this, parentElement
, (Media
) entity
, removeListener
, style
);
2130 } else if (entity
instanceof MediaRepresentation
) {
2131 element
= new MediaRepresentationElement(this, parentElement
, (MediaRepresentation
) entity
, removeListener
,
2133 } else if (entity
instanceof ImageFile
) {
2134 element
= new ImageFileElement(this, parentElement
, (ImageFile
) entity
, removeListener
, style
);
2135 } else if (entity
instanceof MediaRepresentationPart
) {
2136 element
= new MediaRepresentationPartElement(this, parentElement
, (MediaRepresentationPart
) entity
,
2137 removeListener
, style
);
2138 } else if (entity
instanceof NomenclaturalStatus
) {
2139 element
= new NomenclaturalStatusElement(this, parentElement
, (NomenclaturalStatus
) entity
, removeListener
,
2141 } else if (entity
instanceof Rights
) {
2142 element
= new RightsElement(this, parentElement
, (Rights
) entity
, removeListener
, style
);
2143 } else if (entity
instanceof DescriptionElementSource
) {
2144 element
= new DescriptionElementSourceElement(this, parentElement
, (DescriptionElementSource
) entity
,
2145 removeListener
, style
);
2146 } else if (entity
instanceof IdentifiableSource
) {
2147 element
= new IdentifiableSourceElement(this, parentElement
, (IdentifiableSource
) entity
, removeListener
,
2149 } else if (entity
instanceof DefinedTerm
) {
2150 switch(((DefinedTerm
)entity
).getTermType()) {
2152 element
= new ScopeElement(this,
2154 (DefinedTerm
) entity
,
2159 element
= new ModifierElement(this,
2161 (DefinedTerm
) entity
,
2166 //FIXME : Actually we should through an exception here
2171 } else if (entity
instanceof Reference
) {
2172 element
= new DescriptionSourceElement(this, parentElement
, (Reference
) entity
, removeListener
, style
);
2173 } else if (entity
instanceof NameTypeDesignation
) {
2174 element
= new NameTypeDesignationElement(this, parentElement
, (NameTypeDesignation
) entity
, removeListener
,
2176 } else if (entity
instanceof NameRelationship
) {
2177 element
= new NameRelationshipDetailElement(this, parentElement
, (NameRelationship
) entity
, removeListener
,
2179 } else if (entity
instanceof SpecimenTypeDesignation
) {
2180 element
= new SpecimenTypeDesignationElement(this, parentElement
, (SpecimenTypeDesignation
) entity
,
2181 removeListener
, style
);
2182 } else if (entity
instanceof StateData
) {
2183 element
= new StateDataElement(this, parentElement
, (StateData
) entity
, removeListener
, style
);
2184 } else if (entity
instanceof StatisticalMeasurementValue
) {
2185 element
= new StatisticalMeasurementValueElement(this, parentElement
, (StatisticalMeasurementValue
) entity
,
2186 removeListener
, style
);
2187 } else if (entity
instanceof DerivedUnit
) {
2188 switch(((DerivedUnit
)entity
).getRecordBasis()) {
2189 case LivingSpecimen
:
2190 case PreservedSpecimen
:
2192 element
= new SpecimenCollectionDetailElement(this,
2194 (DerivedUnit
) entity
,
2199 element
= new DerivedUnitElement(this,
2201 (DerivedUnit
) entity
,
2206 } else if (entity
instanceof NamedArea
) {
2207 element
= new NamedAreaDetailElement(this, parentElement
, (NamedArea
) entity
, removeListener
, style
);
2208 } else if (entity
instanceof DeterminationEvent
) {
2209 element
= new DeterminationEventDetailElement(this, parentElement
, (DeterminationEvent
) entity
, removeListener
, style
);
2210 } else if (entity
instanceof User
) {
2211 element
= new MemberDetailElement(this, parentElement
, (User
) entity
, removeListener
, style
);
2212 } else if (entity
instanceof GrantedAuthority
) {
2213 element
= new GrantedAuthorityCollectionElement(this, parentElement
, (GrantedAuthorityImpl
) entity
,
2214 removeListener
, style
);
2215 } else if (entity
instanceof Group
) {
2216 element
= new GroupsByUserDetailElement(this, parentElement
, (Group
) entity
, removeListener
, style
);
2217 } else if (entity
instanceof Taxon
) {
2218 element
= new TaxonDetailElement(this, parentElement
, (Taxon
) entity
, removeListener
, style
);
2219 } else if (entity
instanceof DescriptionElementBase
) {
2220 // this is the special case for protologs, maybe we can do this
2221 // differently when API improves
2222 DescriptionElementBase descriptionElement
= (DescriptionElementBase
) entity
;
2223 if (descriptionElement
.getFeature().equals(Feature
.PROTOLOGUE())) {
2224 element
= new ProtologueElement(this, parentElement
, descriptionElement
, removeListener
, style
);
2228 if (element
== null) {
2229 AbstractUtility
.errorDialog("No element for entity", this,
2230 "Could not generate element for entity. Looks like the case is not handled already. Check implementation. Entity: "
2234 else if (backgroundColor
!= null && !backgroundColor
.isDisposed()) {
2235 element
.setPersistentBackground(backgroundColor
);
2237 parentElement
.addElement(element
);
2243 public void createNamedAreaFieldController(AbstractFormSection parentElement
, NamedArea namedArea
, SelectionListener removeListener
){
2244 // Object entity = HibernateProxyHelper.deproxy(versionableEntity); TODO deproxy necessary??
2245 NamedAreaFieldController element
= new NamedAreaFieldController(this, parentElement
, namedArea
, removeListener
, SWT
.NONE
);
2247 parentElement
.addElement(element
);
2252 * Creates a selection element for the given type T.
2255 * <strong>Selection elements not handled by this method:</strong>
2257 * <li>{@link TaxonNodeSelectionElement} see
2258 * {@link #createTaxonNodeSelectionElement(ConversationHolder, ICdmFormElement, String, TaxonNode, int, int)}
2260 * <li>{@link NomenclaturalAuthorTeamSelectionElement} see
2261 * {@link #createNomenclaturalAuthorTeamSelectionElement(ConversationHolder, ICdmFormElement, String, Team, int, int)}
2267 * a {@link Class} object of the type that you want the selection
2269 * @param parentElement
2270 * a {@link ICdmFormElement} object.
2271 * @param labelString
2272 * a {@link String} object.
2273 * @param selectionType
2275 * a {@link ICdmBase} object.
2278 * @param conversation
2279 * a {@link ConversationHolder} object.
2280 * @return a {@link EntitySelectionElement} object.
2282 public <T
extends ICdmBase
> EntitySelectionElement
<T
> createSelectionElement(Class
<T
> clazz
,
2283 ConversationHolder conversation
, ICdmFormElement parentElement
, String labelString
, T selection
, int mode
,
2285 EntitySelectionElement
<T
> element
= new EntitySelectionElement
<T
>(this, conversation
, parentElement
, clazz
,
2286 labelString
, selection
, mode
, style
);
2288 parentElement
.addElement(element
);
2292 public TaxonNodeSelectionElement
createTaxonNodeSelectionElement(ConversationHolder conversation
,
2293 ICdmFormElement parentElement
, String labelString
, TaxonNode selection
, int mode
, int style
) {
2294 TaxonNodeSelectionElement element
= new TaxonNodeSelectionElement(this, conversation
, parentElement
,
2295 labelString
, selection
, mode
, style
);
2297 parentElement
.addElement(element
);
2301 public NomenclaturalAuthorTeamSelectionElement
createNomenclaturalAuthorTeamSelectionElement(
2302 ConversationHolder conversation
, ICdmFormElement parentElement
, String labelString
, Team selection
,
2303 int mode
, int style
) {
2304 NomenclaturalAuthorTeamSelectionElement element
= new NomenclaturalAuthorTeamSelectionElement(this,
2305 conversation
, parentElement
, labelString
, selection
, mode
, style
);
2307 parentElement
.addElement(element
);
2311 /** {@inheritDoc} */
2312 public LabelElement
createLabel(ICdmFormElement parentElement
, String text
) {
2313 LabelElement labelElement
= new LabelElement(this, parentElement
, text
);
2314 adapt(labelElement
);
2315 parentElement
.addElement(labelElement
);
2316 return labelElement
;
2321 * Getter for the field <code>selectionProvider</code>.
2324 * @return a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
2326 public ISelectionProvider
getSelectionProvider() {
2327 return selectionProvider
;
2332 * createDetailedDescriptionDetailElement
2335 * @param parentElement
2336 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
2340 * {@link eu.etaxonomy.cdm.model.description.DescriptionElementBase}
2345 * {@link eu.etaxonomy.taxeditor.ui.section.description.detail.AbstractDetailedDescriptionDetailElement}
2348 public AbstractDetailedDescriptionDetailElement
createDetailedDescriptionDetailElement(
2349 ICdmFormElement parentElement
, DescriptionElementBase entity
, int style
) {
2350 AbstractDetailedDescriptionDetailElement detailedDescriptionElement
= null;
2352 if (entity
instanceof CategoricalData
) {
2353 detailedDescriptionElement
= new CategoricalDataDetailElement(this, parentElement
,
2354 (CategoricalData
) entity
, style
);
2355 } else if (entity
instanceof CommonTaxonName
) {
2356 detailedDescriptionElement
= new CommonNameDetailElement(this, parentElement
, (CommonTaxonName
) entity
,
2358 } else if (entity
instanceof Distribution
) {
2359 detailedDescriptionElement
= new DistributionDetailElement(this, parentElement
, (Distribution
) entity
,
2361 } else if (entity
instanceof IndividualsAssociation
) {
2362 detailedDescriptionElement
= new IndividualsAssociationDetailElement(this, parentElement
,
2363 (IndividualsAssociation
) entity
, style
);
2364 } else if (entity
instanceof QuantitativeData
) {
2365 detailedDescriptionElement
= new QuantitativeDataDetailElement(this, parentElement
,
2366 (QuantitativeData
) entity
, style
);
2367 } else if (entity
instanceof TaxonInteraction
) {
2368 detailedDescriptionElement
= new TaxonInteractionDetailElement(this, parentElement
,
2369 (TaxonInteraction
) entity
, style
);
2370 } else if (entity
instanceof TextData
) {
2371 detailedDescriptionElement
= new TextDataDetailElement(this, parentElement
, (TextData
) entity
, style
);
2373 throw new IllegalStateException("There is no interface for the given description element");
2375 adapt(detailedDescriptionElement
);
2376 parentElement
.addElement(detailedDescriptionElement
);
2377 return detailedDescriptionElement
;
2382 * Creates a styled text as a part of the form.
2387 * the text initial value
2390 * @return the text widget
2392 public StyledText
createStyledText(Composite parent
, String value
, int style
) {
2393 StyledText text
= new StyledText(parent
, getBorderStyle() | style
| getOrientation());
2394 if (value
!= null) {
2395 text
.setText(value
);
2397 text
.setForeground(getColors().getForeground());
2398 text
.setBackground(getColors().getBackground());
2399 // text.addFocusListener(visibilityHandler);
2406 * @param conversationHolder
2408 * @param detailsViewer
2412 public FieldObservationGeneralSection
createFieldObservationGeneralSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
2413 FieldObservationGeneralSection section
= new FieldObservationGeneralSection(this, conversation
, parentElement
, selectionProvider
, style
);
2414 addAndAdaptSection(parentElement
, section
);
2418 * @param conversationHolder
2420 * @param detailsViewer
2424 public GatheringEventSection
createGatheringEventSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
2425 GatheringEventSection section
= new GatheringEventSection(this, conversation
, parentElement
, selectionProvider
, style
);
2426 addAndAdaptSection(parentElement
, section
);
2430 * @param conversationHolder
2432 * @param detailsViewer
2436 public FieldObservationDetailsSection
createFieldObservationDetailsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
2437 FieldObservationDetailsSection section
= new FieldObservationDetailsSection(this, conversation
, parentElement
, selectionProvider
, style
);
2438 addAndAdaptSection(parentElement
, section
);
2442 public SpecimenGeneralSection
createSpecimenSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
2443 SpecimenGeneralSection section
= new SpecimenGeneralSection(this, conversation
, parentElement
, selectionProvider
, style
);
2444 addAndAdaptSection(parentElement
, section
);
2448 public SpecimenDetailsSection
createSpecimenDetailsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
2449 SpecimenDetailsSection section
= new SpecimenDetailsSection(this, conversation
, parentElement
, selectionProvider
, style
);
2450 addAndAdaptSection(parentElement
, section
);
2454 public DerivedUnitDetailsSection
createDerivedUnitDetailsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
2455 DerivedUnitDetailsSection section
= new DerivedUnitDetailsSection(this, conversation
, parentElement
, selectionProvider
, style
);
2456 addAndAdaptSection(parentElement
, section
);
2460 public FieldObservationGeneralElementController
createSpecimenGeneralElementController(ICdmFormElement parentElement
){
2461 return createFieldObservationGeneralElementController_internal(parentElement
, true, false);
2464 public SpecimenDetailsElementController
createSpecimenDetailsElementController(ICdmFormElement parentElement
){
2465 SpecimenDetailsElement element
= new SpecimenDetailsElement(parentElement
.getLayoutComposite(), SWT
.NONE
);
2466 element
.setLayoutData(LayoutConstants
.FILL_HORIZONTALLY(2,1));
2467 SpecimenDetailsElementController controller
= new SpecimenDetailsElementController(element
, this, parentElement
);
2468 addAndAdaptElement(parentElement
, controller
);
2472 public DerivedUnitDetailsElementController
createDerivedUnitDetailsElementController(ICdmFormElement parentElement
){
2473 DerivedUnitDetailsElement element
= new DerivedUnitDetailsElement(parentElement
.getLayoutComposite(), SWT
.NONE
);
2474 element
.setLayoutData(LayoutConstants
.FILL_HORIZONTALLY(2,1));
2475 DerivedUnitDetailsElementController controller
= new DerivedUnitDetailsElementController(element
, this, parentElement
);
2476 addAndAdaptElement(parentElement
, controller
);
2480 public FieldObservationGeneralElementController
createSpecimenGeneralElementControllerWizard(ICdmFormElement parentElement
){
2481 return createFieldObservationGeneralElementController_internal(parentElement
, true, true);
2484 public FieldObservationGeneralElementController
createFieldObservationGeneralElementControllerWizard(ICdmFormElement parentElement
){
2485 return createFieldObservationGeneralElementController_internal(parentElement
, false, true);
2488 public FieldObservationGeneralElementController
createFieldObservationGeneralElementController(ICdmFormElement parentElement
){
2489 return createFieldObservationGeneralElementController_internal(parentElement
, false, false);
2492 private FieldObservationGeneralElementController
createFieldObservationGeneralElementController_internal(ICdmFormElement parentElement
, boolean isSpecimen
, boolean isWizard
){
2493 FieldObservationGeneralElement element
= new FieldObservationGeneralElement(parentElement
.getLayoutComposite(), SWT
.NONE
);
2494 element
.setLayoutData(LayoutConstants
.FILL_HORIZONTALLY(2,1));
2495 FieldObservationGeneralElementController controller
= new FieldObservationGeneralElementController(element
, this, parentElement
, isSpecimen
, isWizard
);
2496 addAndAdaptElement(parentElement
, controller
);
2500 public GatheringEventDetailsElementController
createGatheringEventDetailsElementController(ICdmFormElement parentElement
) {
2501 GatheringEventDetailsElement element
= new GatheringEventDetailsElement(parentElement
.getLayoutComposite(), SWT
.NONE
);
2502 element
.setLayoutData(LayoutConstants
.FILL_HORIZONTALLY(2,1));
2503 GatheringEventDetailsElementController controller
= new GatheringEventDetailsElementController(element
, this, parentElement
);
2505 parentElement
.addElement(controller
);
2509 public FieldObservationDetailsElementController
createFieldObservationDetailsElementController(ICdmFormElement parentElement
) {
2510 FieldObservationDetailsElement element
= new FieldObservationDetailsElement(parentElement
.getLayoutComposite(), SWT
.NONE
);
2511 element
.setLayoutData(LayoutConstants
.FILL_HORIZONTALLY(2,1));
2512 FieldObservationDetailsElementController controller
= new FieldObservationDetailsElementController(element
, this, parentElement
);
2513 addAndAdaptElement(parentElement
, controller
);