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
.occurrence
.SpecimenOrObservationType
;
94 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
95 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
96 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonNode
;
97 import eu
.etaxonomy
.cdm
.strategy
.parser
.ParserProblem
;
98 import eu
.etaxonomy
.taxeditor
.model
.AbstractUtility
;
99 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.basicFields
.NamedAreaFieldController
;
100 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.compatibility
.ICdmFormElement
;
101 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.fieldObservation
.FieldObservationDetailsElement
;
102 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.fieldObservation
.FieldObservationDetailsElementController
;
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
.FieldObservationSection
;
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
.specimen
.SpecimenGeneralElement
;
109 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.specimen
.SpecimenGeneralElementController
;
110 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.specimen
.SpecimenSection
;
111 import eu
.etaxonomy
.taxeditor
.ui
.combo
.EnumComboElement
;
112 import eu
.etaxonomy
.taxeditor
.ui
.combo
.TermComboElement
;
113 import eu
.etaxonomy
.taxeditor
.ui
.element
.MinMaxTextSection
.UnitType
;
114 import eu
.etaxonomy
.taxeditor
.ui
.openurl
.IOpenUrlEnabled
;
115 import eu
.etaxonomy
.taxeditor
.ui
.openurl
.OpenUrlSelectorElement
;
116 import eu
.etaxonomy
.taxeditor
.ui
.password
.EditPasswordElement
;
117 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailElement
;
118 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailSection
;
119 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionElement
;
120 import eu
.etaxonomy
.taxeditor
.ui
.section
.EmptyElement
;
121 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.InstitutionDetailElement
;
122 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.InstitutionDetailSection
;
123 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailElement
;
124 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailSection
;
125 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailElement
;
126 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailSection
;
127 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamMemberElement
;
128 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamMemberSection
;
129 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamOrPersonBaseDetailSection
;
130 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.ClassificationDetailElement
;
131 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.ClassificationDetailSection
;
132 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.TaxonNodeDetailElement
;
133 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.TaxonNodeDetailSection
;
134 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferenceEntityDetailElement
;
135 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferencedEntityDetailSection
;
136 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DerivedUnitElement
;
137 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescribedSpecimenSection
;
138 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailElement
;
139 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailSection
;
140 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailElement
;
141 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailSection
;
142 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementMediaSection
;
143 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceElement
;
144 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceSection
;
145 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceElement
;
146 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceSection
;
147 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.MediaDetailsSection
;
148 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ModifierElement
;
149 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ModifierSection
;
150 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageDetailElement
;
151 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageSection
;
152 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeElement
;
153 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeSection
;
154 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StateDataElement
;
155 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StateDataSection
;
156 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StatisticalMeasurementValueElement
;
157 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StatisticalMeasurementValueSection
;
158 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.AbstractDetailedDescriptionDetailElement
;
159 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.CategoricalDataDetailElement
;
160 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.CommonNameDetailElement
;
161 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.DistributionDetailElement
;
162 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.IndividualsAssociationDetailElement
;
163 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.QuantitativeDataDetailElement
;
164 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.TaxonInteractionDetailElement
;
165 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.TextDataDetailElement
;
166 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailElement
;
167 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailSection
;
168 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityCollectionElement
;
169 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailElement
;
170 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailSection
;
171 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailElement
;
172 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailSection
;
173 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailElement
;
174 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailSection
;
175 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.GeographicalScopeDetailSection
;
176 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailElement
;
177 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailSection
;
178 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailElement
;
179 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailSection
;
180 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.ScopeRestrictionSection
;
181 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.TaxonomicScopeSection
;
182 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.ImageFileElement
;
183 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaElement
;
184 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationElement
;
185 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationPartElement
;
186 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationPartSection
;
187 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationSection
;
188 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaSection
;
189 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.AuthorshipDetailElement
;
190 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.AuthorshipDetailSection
;
191 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.HybridDetailElement
;
192 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.HybridDetailSection
;
193 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameDetailElement
;
194 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameDetailSection
;
195 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailElement
;
196 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailSection
;
197 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameTypeDesignationElement
;
198 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusElement
;
199 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusSection
;
200 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailElement
;
201 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailSection
;
202 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.ProtologueElement
;
203 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.ProtologueSection
;
204 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.SpecimenTypeDesignationElement
;
205 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.TypeDesignationSection
;
206 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CollectingAreasDetailSection
;
207 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CollectionDetailElement
;
208 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CurrentDeterminationDetailSection
;
209 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitBaseDetailElement
;
210 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitBaseDetailSection
;
211 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitFacadeDetailElement
;
212 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitFacadeDetailSection
;
213 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailElement
;
214 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailSection
;
215 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationEventDetailElement
;
216 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationHistoryDetailSection
;
217 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldObservationDetailElement
;
218 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldObservationDetailSection
;
219 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailElement
;
220 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailSection
;
221 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GeneralDetailElement
;
222 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GeneralDetailSection
;
223 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.NamedAreaDetailElement
;
224 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SourceCollectionDetailSection
;
225 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SpecimenCollectionDetailElement
;
226 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SpecimenCollectionDetailSection
;
227 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailElement
;
228 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailSection
;
229 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailElement
;
230 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailSection
;
231 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.AnnotationElement
;
232 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.AnnotationSection
;
233 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CdmBaseElement
;
234 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CdmBaseSection
;
235 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CreditElement
;
236 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CreditSection
;
237 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.ExtensionElement
;
238 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.ExtensionSection
;
239 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.HeadlineSection
;
240 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.IdentifiableSourceElement
;
241 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.MarkerElement
;
242 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.MarkerSection
;
243 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.RightsElement
;
244 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.RightsSection
;
245 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.SourceSection
;
246 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.VersionElement
;
247 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.VersionSection
;
248 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessageElement
;
249 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessagesSection
;
250 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailElement
;
251 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailSection
;
252 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonDetailElement
;
253 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailElement
;
254 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailSection
;
255 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailElement
;
256 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailSection
;
257 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailElement
;
258 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailSection
;
259 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailElement
;
260 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailSection
;
261 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.DefinedTermDetailElement
;
262 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.DefinedTermDetailSection
;
263 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailSection
;
264 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailElement
;
265 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailSection
;
266 import eu
.etaxonomy
.taxeditor
.ui
.selection
.EntitySelectionElement
;
267 import eu
.etaxonomy
.taxeditor
.ui
.selection
.NomenclaturalAuthorTeamSelectionElement
;
268 import eu
.etaxonomy
.taxeditor
.ui
.selection
.TaxonNodeSelectionElement
;
272 * CdmFormFactory class.
276 * @created Feb 24, 2010
279 public class CdmFormFactory
extends FormToolkit
{
281 private BoldFontHolder2 boldFontHolder2
;
282 private MouseListener selectionMouseHandler
;
283 private FocusListener selectionFocusHandler
;
285 private final Set
<SelectionListener
> selectionListenerList
= new HashSet
<SelectionListener
>();
287 private final List
<IPropertyChangeListener
> propertyChangeListeners
= new ArrayList
<IPropertyChangeListener
>();
289 private final int orientation
= Window
.getDefaultOrientation();
290 private ISelectionProvider selectionProvider
;
292 /** Constant <code>EMPTY_SELECTION</code> */
293 public static ISelection EMPTY_SELECTION
= new ISelection() {
295 public boolean isEmpty() {
306 private class SelectionMouseHandler
extends MouseAdapter
{
308 public void mouseDown(MouseEvent e
) {
309 notifySelectionListeners(e
);
319 private class SelectionFocusHandler
extends FocusAdapter
{
321 public void focusGained(FocusEvent e
) {
322 notifySelectionListeners(e
);
326 private void notifySelectionListeners(TypedEvent e
) {
327 Event event
= new Event();
328 event
.widget
= e
.widget
;
329 SelectionEvent selectionEvent
= new SelectionEvent(event
);
331 for (SelectionListener listener
: selectionListenerList
) {
332 listener
.widgetSelected(selectionEvent
);
338 * Constructor for CdmFormFactory.
342 * a {@link org.eclipse.swt.widgets.Display} object.
343 * @param selectionProvider
344 * a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
346 public CdmFormFactory(Display display
, ISelectionProvider selectionProvider
) {
348 this.selectionProvider
= selectionProvider
;
354 * Constructor for CdmFormFactory.
358 * a {@link org.eclipse.swt.widgets.Display} object.
360 public CdmFormFactory(Display display
) {
368 private void init() {
369 boldFontHolder2
= new BoldFontHolder2();
370 selectionMouseHandler
= new SelectionMouseHandler();
371 selectionFocusHandler
= new SelectionFocusHandler();
375 * Creates an instance initialized with the correct selectionProvider
377 * Make sure to remove the instance when the entityComposite disposes via
378 * destroySelectionArbitrator(..)
380 * @param entityElement
381 * a {@link eu.etaxonomy.taxeditor.ui.element.IEntityElement}
383 * @return a {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator}
386 public SelectionArbitrator
createSelectionArbitrator(IEntityElement entityElement
) {
387 SelectionArbitrator selectionArbitrator
= new SelectionArbitrator(entityElement
);
388 selectionArbitrator
.addSelectionProvider(selectionProvider
);
389 selectionProvider
.addSelectionChangedListener(selectionArbitrator
);
390 addSelectionListener(selectionArbitrator
);
391 return selectionArbitrator
;
396 * destroySelectionArbitrator
399 * @param selectionArbitrator
401 * {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator}
404 public void destroySelectionArbitrator(SelectionArbitrator selectionArbitrator
) {
405 removeSelectionListener(selectionArbitrator
);
406 if (selectionProvider
!= null) {
407 selectionProvider
.removeSelectionChangedListener(selectionArbitrator
);
409 AbstractUtility
.error(this.getClass(),
410 "Tried to destroy a selection listener from this factories listeners but was null", null);
416 * Adapts the {@link AbstractCdmFormElement}:<br>
417 * - sets the {@link IPropertyChangeListener}s handled by this class
422 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement}
425 public void adapt(AbstractCdmFormElement formElement
) {
426 formElement
.setPropertyChangeListeners(propertyChangeListeners
);
431 public void adapt(Control control
, boolean trackFocus
, boolean trackKeyboard
) {
433 control
.addFocusListener(selectionFocusHandler
);
435 super.adapt(control
, trackFocus
, trackKeyboard
);
440 public void adapt(Composite composite
) {
441 composite
.addMouseListener(selectionMouseHandler
);
442 super.adapt(composite
);
451 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
454 public void destroyElement(ICdmFormElement formElement
) {
455 // return if element was not initialized
456 if (formElement
== null) {
459 // destroy selection arbitrator, if any
460 if (formElement
instanceof ISelectableElement
) {
461 destroySelectionArbitrator(((ISelectableElement
) formElement
).getSelectionArbitrator());
463 // remove this element form its parents list of elements
464 // ICdmFormElement parentElement = formElement.getParentElement();
465 // if(parentElement != null){
466 // parentElement.removeElement(formElement);
468 // call destroy on child elements recursively
469 for (ICdmFormElement childElement
: formElement
.getElements()) {
470 destroyElement(childElement
);
472 // dispose of the controls
473 for (Control control
: formElement
.getControls()) {
474 // we added the layoutComposite of the parental element as the
475 // layout composite to this formElement
476 // but we do not want to destroy it.
477 if (control
.equals(formElement
.getLayoutComposite())) {
492 * a {@link org.eclipse.swt.widgets.Composite} object.
493 * @return a {@link org.eclipse.swt.widgets.Label} object.
495 public Label
createEmptyCell(Composite parent
) {
496 return this.createLabel(parent
, null);
501 * createMultilineTextWithLabel
505 * a {@link java.lang.String} object.
510 * @param parentElement
511 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
513 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
516 public TextWithLabelElement
createMultilineTextWithLabel(ICdmFormElement parentElement
, String labelString
,
517 int textHeight
, int style
) {
518 TextWithLabelElement element
= new TextWithLabelElement(this, parentElement
, labelString
, "", textHeight
, style
);
520 parentElement
.addElement(element
);
526 * createMultiLanguageTextElement
529 * @param parentElement
530 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
533 * a {@link java.lang.String} object.
534 * @param multilanguageText
535 * a {@link java.util.Map} object.
541 * {@link eu.etaxonomy.taxeditor.ui.element.MultilanguageTextElement}
544 public MultilanguageTextElement
createMultiLanguageTextElement(ICdmFormElement parentElement
, String labelString
,
545 Map
<Language
, LanguageString
> multilanguageText
, int textHeight
, int style
) {
546 MultilanguageTextElement element
= new MultilanguageTextElement(this, parentElement
, labelString
,
547 multilanguageText
, textHeight
, style
);
549 parentElement
.addElement(element
);
553 public KeyStatementElement
createKeyStatementElement(ICdmFormElement parentElement
, String labelString
,
554 KeyStatement keyStatement
, int textHeight
, int style
) {
555 KeyStatementElement element
= new KeyStatementElement(this, parentElement
, labelString
, keyStatement
,
558 parentElement
.addElement(element
);
564 * createTextWithLabelElement
568 * a {@link java.lang.String} object.
570 * a {@link java.lang.String} object.
573 * @param parentElement
574 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
576 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
579 public TextWithLabelElement
createTextWithLabelElement(ICdmFormElement parentElement
, String labelString
,
580 String initialText
, int style
) {
581 TextWithLabelElement element
= new TextWithLabelElement(this, parentElement
, labelString
, initialText
, null,
584 parentElement
.addElement(element
);
588 public UriWithLabelElement
createUriWithLabelElement(ICdmFormElement parentElement
, String labelString
,
589 URI initialUri
, int style
) {
590 UriWithLabelElement element
= new UriWithLabelElement(this, parentElement
, labelString
, initialUri
, null, style
);
592 parentElement
.addElement(element
);
603 public OpenUrlSelectorElement
createOpenUrlSelectorElement(ICdmFormElement parentElement
, String labelString
,
604 IOpenUrlEnabled openUrlEnabled
, int style
) {
605 OpenUrlSelectorElement element
= new OpenUrlSelectorElement(this, parentElement
, labelString
, openUrlEnabled
,
608 parentElement
.addElement(element
);
614 * @param parentElement
616 * @param conversationEnabled
621 public EditPasswordElement
createEditPasswordElement(ICdmFormElement parentElement
, String labelString
,
622 ConversationHolder conversation
, User user
, int style
) {
623 EditPasswordElement element
= new EditPasswordElement(this, parentElement
, labelString
, user
, conversation
);
625 parentElement
.addElement(element
);
631 * createIntegerTextWithLabelElement
634 * @param parentElement
635 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
638 * a {@link java.lang.String} object.
639 * @param initialInteger
640 * a {@link java.lang.Integer} object.
644 * {@link eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement}
647 public NumberWithLabelElement
createNumberTextWithLabelElement(
648 ICdmFormElement parentElement
, String labelString
,
649 Number initialNumber
, int style
) {
650 NumberWithLabelElement element
= new NumberWithLabelElement(this,
651 parentElement
, labelString
, initialNumber
, style
);
653 parentElement
.addElement(element
);
659 * createLanguageStringWithLabelElement
662 * @param parentElement
663 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
666 * a {@link java.lang.String} object.
667 * @param languageString
668 * a {@link eu.etaxonomy.cdm.model.common.LanguageString} object.
672 * {@link eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement}
675 public LanguageStringWithLabelElement
createLanguageStringWithLabelElement(ICdmFormElement parentElement
,
676 String labelString
, LanguageString languageString
, int style
) {
677 LanguageStringWithLabelElement element
= new LanguageStringWithLabelElement(this, parentElement
, labelString
,
678 languageString
, style
);
680 parentElement
.addElement(element
);
686 * createLanguageStringWithLabelElement
689 * @param parentElement
690 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
693 * a {@link java.lang.String} object.
694 * @param languageString
695 * a {@link eu.etaxonomy.cdm.model.common.LanguageString} object.
701 * {@link eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement}
704 public LanguageStringWithLabelElement
createLanguageStringWithLabelElement(ICdmFormElement parentElement
,
705 String labelString
, LanguageString languageString
, int height
, int style
) {
706 LanguageStringWithLabelElement element
= new LanguageStringWithLabelElement(this, parentElement
, labelString
,
707 languageString
, height
, style
);
709 parentElement
.addElement(element
);
718 * @param parentElement
719 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
722 * a {@link java.lang.String} object.
725 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
728 public TextWithLabelElement
createTextElement(ICdmFormElement parentElement
, String initialText
, int style
) {
729 TextWithLabelElement element
= new TextWithLabelElement(this, parentElement
, null, initialText
, null, style
);
731 parentElement
.addElement(element
);
737 * createKeyValueViewerElement
740 * @param parentElement
741 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
744 * a {@link java.lang.String} object.
745 * @param valueHeading
746 * a {@link java.lang.String} object.
748 * a {@link java.util.Map} object.
749 * @return a {@link eu.etaxonomy.taxeditor.ui.element.KeyValueViewerElement}
752 public KeyValueViewerElement
createKeyValueViewerElement(ICdmFormElement parentElement
, String keyHeading
,
753 String valueHeading
, Map
<Object
, Object
> map
) {
754 KeyValueViewerElement element
= new KeyValueViewerElement(this, parentElement
, keyHeading
, valueHeading
, map
);
756 parentElement
.addElement(element
);
762 * createTermComboElement
765 * @param termComboType
767 * {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.TermComboType}
769 * @param parentElement
770 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
773 * a {@link java.lang.String} object.
775 * a {@link eu.etaxonomy.cdm.model.common.DefinedTermBase}
779 * @return a {@link eu.etaxonomy.taxeditor.ui.combo.TermComboElement}
783 public <T
extends DefinedTermBase
> TermComboElement
<T
> createTermComboElement(Class
<T
> termComboType
,
784 ICdmFormElement parentElement
, String labelString
, T selection
, int style
) {
785 TermComboElement
<T
> element
= new TermComboElement
<T
>(this, parentElement
, termComboType
, labelString
,
788 parentElement
.addElement(element
);
794 * createTermComboElement
797 * @param termComboType
799 * {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.TermComboType}
801 * @param parentElement
802 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
805 * a {@link java.lang.String} object.
807 * a {@link eu.etaxonomy.cdm.model.common.DefinedTermBase}
811 * @return a {@link eu.etaxonomy.taxeditor.ui.combo.TermComboElement}
815 public <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
817 ICdmFormElement parentElement
,
821 TermComboElement
<T
> element
= new TermComboElement
<T
>(this, parentElement
, termType
, labelString
, selection
, style
);
823 parentElement
.addElement(element
);
829 * createEnumComboElement
832 * @param enumComboType
834 * {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EnumComboType}
836 * @param parentElement
837 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
841 * @return a {@link eu.etaxonomy.taxeditor.ui.term.AbstractEnumComboElement}
844 public <T
extends IEnumTerm
> EnumComboElement
<T
> createEnumComboElement(
845 Class
<T
> enumComboType
, ICdmFormElement parentElement
,
847 EnumComboElement
<T
> element
= new EnumComboElement
<T
>(this, parentElement
, enumComboType
, style
);
849 parentElement
.addElement(element
);
855 * createBrowserElement
859 * a {@link java.net.URI} object.
862 * @param parentElement
863 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
865 * @return a {@link eu.etaxonomy.taxeditor.ui.element.BrowserElement}
868 public BrowserElement
createBrowserElement(ICdmFormElement parentElement
, URI imageUri
, int style
) {
869 BrowserElement element
= new BrowserElement(this, parentElement
, imageUri
, style
);
871 parentElement
.addElement(element
);
880 * @param parentElement
881 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
884 * a {@link java.net.URI} object.
887 * @return a {@link eu.etaxonomy.taxeditor.ui.element.ImageElement} object.
889 public ImageElement
createImageElement(ICdmFormElement parentElement
, URI imageUri
, int style
) {
890 ImageElement element
= new ImageElement(this, parentElement
, imageUri
, style
);
892 parentElement
.addElement(element
);
898 * createTextActionElement
902 * a {@link java.lang.String} object.
904 * a {@link java.lang.String} object.
907 * @param parentElement
908 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
911 * a {@link java.lang.String} object.
912 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextActionElement}
915 public TextActionElement
createTextActionElement(ICdmFormElement parentElement
, String labelString
,
916 String buttonLabel
, String initialText
, int style
) {
917 TextActionElement element
= new TextActionElement(this, parentElement
, labelString
, buttonLabel
, initialText
,
920 parentElement
.addElement(element
);
929 * @param parentElement
930 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
933 * a {@link java.lang.String} object.
934 * @param initialState
938 * @return a {@link eu.etaxonomy.taxeditor.ui.element.CheckboxElement}
941 public CheckboxElement
createCheckbox(ICdmFormElement parentElement
, String label
, boolean initialState
, int style
) {
942 CheckboxElement element
= new CheckboxElement(this, parentElement
, label
, initialState
, style
| orientation
);
944 parentElement
.addElement(element
);
949 * Creates a section as a part of the form.
951 * @return the section widget
954 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
957 public Section
adapt(AbstractFormSection section
) {
958 section
.setMenu(section
.getLayoutComposite().getMenu());
959 adapt(section
, true, true);
961 // handle focus and property change events for cdm use
962 section
.addFocusListener(selectionFocusHandler
);
963 section
.setPropertyChangeListeners(propertyChangeListeners
);
965 if (section
.getToggle() != null) {
966 section
.getToggle().setHoverDecorationColor(getColors().getColor(IFormColors
.TB_TOGGLE_HOVER
));
967 section
.getToggle().setDecorationColor(getColors().getColor(IFormColors
.TB_TOGGLE
));
970 section
.setFont(boldFontHolder2
.getBoldFont(section
.getLayoutComposite().getFont()));
972 if ((section
.getStyle() & ExpandableComposite
.TITLE_BAR
) != 0
973 || (section
.getStyle() & ExpandableComposite
.SHORT_TITLE_BAR
) != 0) {
974 getColors().initializeSectionToolBarColors();
975 section
.setTitleBarBackground(getColors().getColor(IFormColors
.TB_BG
));
976 section
.setTitleBarBorderColor(getColors().getColor(IFormColors
.TB_BORDER
));
978 // call setTitleBarForeground regardless as it also sets the label color
979 section
.setTitleBarForeground(getColors().getColor(IFormColors
.TB_TOGGLE
));
983 private class BoldFontHolder2
{
984 private Font normalFont
;
986 private Font boldFont
;
988 public BoldFontHolder2() {
991 public Font
getBoldFont(Font font
) {
992 createBoldFont(font
);
996 private void createBoldFont(Font font
) {
997 if (normalFont
== null || !normalFont
.equals(font
)) {
1001 if (boldFont
== null) {
1002 boldFont
= FormFonts
.getInstance().getBoldFont(getColors().getDisplay(), normalFont
);
1006 public void dispose() {
1007 if (boldFont
!= null) {
1008 FormFonts
.getInstance().markFinished(boldFont
, getColors().getDisplay());
1016 * createToggleableTextField
1019 * @param parentElement
1020 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1022 * @param labelString
1023 * a {@link java.lang.String} object.
1024 * @param initialText
1025 * a {@link java.lang.String} object.
1026 * @param initialState
1030 * @return a {@link eu.etaxonomy.taxeditor.ui.element.ToggleableTextElement}
1033 public ToggleableTextElement
createToggleableTextField(ICdmFormElement parentElement
, String labelString
,
1034 String initialText
, boolean initialState
, int style
) {
1035 ToggleableTextElement element
= new ToggleableTextElement(this, parentElement
, labelString
, initialText
,
1036 initialState
, style
| orientation
);
1038 parentElement
.addElement(element
);
1044 * createTimePeriodElement
1047 * @param parentElement
1048 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1050 * @param labelString
1051 * a {@link java.lang.String} object.
1053 * a {@link eu.etaxonomy.cdm.model.common.TimePeriod} object.
1056 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TimePeriodElement}
1059 public TimePeriodElement
createTimePeriodElement(ICdmFormElement parentElement
, String labelString
,
1060 TimePeriod timePeriod
, int style
) {
1061 TimePeriodElement element
= new TimePeriodElement(this, parentElement
, labelString
, timePeriod
, style
);
1063 parentElement
.addElement(element
);
1069 * createGatheringEventUnitElement
1072 * @param parentElement
1073 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1075 * @param labelString
1076 * a {@link java.lang.String} object.
1078 * a {@link eu.etaxonomy.cdm.model.common.GatheringEvent} object.
1081 * @return a {@link eu.etaxonomy.taxeditor.ui.element.GatheringEventUnitElement}
1084 public GatheringEventUnitElement
createGatheringEventUnitElement(
1085 ICdmFormElement parentElement
,
1087 DerivedUnitFacade gatheringEvent
,
1088 MinMaxTextSection
.UnitType unitType
,
1090 GatheringEventUnitElement element
= new GatheringEventUnitElement(this,
1097 parentElement
.addElement(element
);
1103 * createPointElement
1108 * @param parentElement
1109 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1112 * a {@link eu.etaxonomy.cdm.model.location.Point} object.
1113 * @return a {@link eu.etaxonomy.taxeditor.ui.element.PointElement} object.
1115 public PointElement
createPointElement(ICdmFormElement parentElement
, Point point
, int style
) {
1116 PointElement element
= new PointElement(this, parentElement
, point
, style
);
1118 parentElement
.addElement(element
);
1124 * createDateDetailSection
1127 * @param parentElement
1128 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1132 * @return a {@link eu.etaxonomy.taxeditor.ui.element.DateDetailSection}
1135 public DateDetailSection
createDateDetailSection(ICdmFormElement parentElement
, int style
) {
1136 DateDetailSection section
= new DateDetailSection(this, parentElement
, style
);
1137 parentElement
.addElement(section
);
1144 * createDateDetailSection
1147 * @param parentElement
1148 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1152 * @return a {@link eu.etaxonomy.taxeditor.ui.element.MinMaxTextSection}
1155 public MinMaxTextSection
createMinMaxTextSection(ICdmFormElement parentElement
, UnitType unitType
, int style
) {
1156 MinMaxTextSection section
= new MinMaxTextSection(this, parentElement
, unitType
, style
);
1157 parentElement
.addElement(section
);
1164 * createPartialElement
1167 * @param parentElement
1168 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1170 * @param labelString
1171 * a {@link java.lang.String} object.
1173 * a {@link org.joda.time.Partial} object.
1176 * @return a {@link eu.etaxonomy.taxeditor.ui.element.PartialElement}
1179 public PartialElement
createPartialElement(ICdmFormElement parentElement
, String labelString
, Partial partial
,
1181 PartialElement element
= new PartialElement(this, parentElement
, labelString
, style
);
1183 parentElement
.addElement(element
);
1189 * addSelectionListener
1193 * a {@link org.eclipse.swt.events.SelectionListener} object.
1195 public void addSelectionListener(SelectionListener listener
) {
1196 selectionListenerList
.add(listener
);
1201 * removeSelectionListener
1205 * a {@link org.eclipse.swt.events.SelectionListener} object.
1207 public void removeSelectionListener(SelectionListener listener
) {
1208 if (listener
== null) {
1209 AbstractUtility
.error(this.getClass(),
1210 "Tried to remove a selection listener from this factories listeners but was null", null);
1212 selectionListenerList
.remove(listener
);
1218 * addPropertyChangeListener
1222 * a {@link org.eclipse.jface.util.IPropertyChangeListener}
1225 public void addPropertyChangeListener(IPropertyChangeListener listener
) {
1226 if (propertyChangeListeners
.contains(listener
)) {
1229 propertyChangeListeners
.add(0, listener
);
1234 * removePropertyChangeListener
1238 * a {@link org.eclipse.jface.util.IPropertyChangeListener}
1241 public void removePropertyChangeListener(IPropertyChangeListener listener
) {
1242 propertyChangeListeners
.remove(listener
);
1246 * @return the propertyChangeListeners
1248 public List
<IPropertyChangeListener
> getPropertyChangeListeners() {
1249 return propertyChangeListeners
;
1254 * createHorizontalSeparator
1257 * @param parentElement
1258 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1262 * @return a {@link org.eclipse.swt.widgets.Label} object.
1264 public Label
createHorizontalSeparator(ICdmFormElement parentElement
, int style
) {
1265 Label separator
= this.createSeparator(parentElement
.getLayoutComposite(), SWT
.HORIZONTAL
| style
);
1266 separator
.setLayoutData(LayoutConstants
.FILL_HORIZONTALLY());
1272 * createVersionElement
1275 * @param parentElement
1276 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1279 * a {@link eu.etaxonomy.cdm.model.common.VersionableEntity}
1284 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.VersionElement}
1287 public VersionElement
createVersionElement(ICdmFormElement parentElement
, VersionableEntity entity
, int style
) {
1288 VersionElement element
= new VersionElement(this, parentElement
, entity
, style
);
1290 parentElement
.addElement(element
);
1295 * @param cdmBaseSection
1300 public CdmBaseElement
createCdmBaseElement(ICdmFormElement parentElement
, CdmBase entity
, int style
) {
1301 CdmBaseElement element
= new CdmBaseElement(this, parentElement
, entity
, style
);
1303 parentElement
.addElement(element
);
1309 * createVersionSection
1312 * @param parentElement
1313 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1318 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.VersionSection}
1321 public VersionSection
createVersionSection(ICdmFormElement parentElement
, int style
) {
1322 VersionSection section
= new VersionSection(this, parentElement
, style
);
1323 parentElement
.addElement(section
);
1333 public CdmBaseSection
createCdmBaseSection(ICdmFormElement parentElement
, int style
) {
1334 CdmBaseSection section
= new CdmBaseSection(this, parentElement
, style
);
1335 parentElement
.addElement(section
);
1342 * createEmptyElement
1345 * @param parentElement
1346 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1348 * @return a {@link eu.etaxonomy.taxeditor.ui.section.EmptyElement} object.
1350 public EmptyElement
createEmptyElement(ICdmFormElement parentElement
) {
1351 EmptyElement element
= new EmptyElement(this, parentElement
, null, SWT
.NULL
);
1353 parentElement
.addElement(element
);
1359 * createHeadlineSection
1362 * @param parentElement
1363 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1366 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.HeadlineSection}
1369 public HeadlineSection
createHeadlineSection(ICdmFormElement parentElement
) {
1370 HeadlineSection section
= new HeadlineSection(this, parentElement
, SWT
.NULL
);
1371 parentElement
.addElement(section
);
1378 * createParsingMessageElement
1381 * @param parentElement
1382 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1384 * @param parserProblem
1385 * a {@link eu.etaxonomy.cdm.strategy.parser.ParserProblem}
1390 * {@link eu.etaxonomy.taxeditor.ui.section.taxon.ParsingMessageElement}
1393 public ParsingMessageElement
createParsingMessageElement(ICdmFormElement parentElement
,
1394 ParserProblem parserProblem
, int style
) {
1395 ParsingMessageElement element
= new ParsingMessageElement(this, parentElement
, parserProblem
, style
);
1397 parentElement
.addElement(element
);
1401 public AbstractFormSection
createDefinedTermDetailSection(Class definedTermClass
, ConversationHolder conversation
,
1402 ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
1404 AbstractFormSection section
= new DefinedTermDetailSection(this, definedTermClass
, conversation
, parentElement
,
1405 selectionProvider
, style
);
1407 parentElement
.addElement(section
);
1414 * @param definedTermClass
1415 * @param formElement
1419 public AbstractCdmDetailElement
createDefinedTermDetailElement(Class definedTermClass
, AbstractCdmDetailSection parentElement
, int style
) {
1420 AbstractCdmDetailElement element
= null;
1422 if (NamedArea
.class.isAssignableFrom(definedTermClass
)) {
1423 element
= new eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement(this, parentElement
);
1425 element
= new DefinedTermDetailElement(this, parentElement
);
1429 parentElement
.addElement(element
);
1434 //--------DetailSections---------
1435 public NameDetailSection
createNameDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1436 NameDetailSection section
= new NameDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1437 addAndAdaptSection(parentElement
, section
);
1441 public ReferenceDetailSection
createReferenceDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1442 ReferenceDetailSection section
= new ReferenceDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1443 addAndAdaptSection(parentElement
, section
);
1447 public NomenclaturalReferenceDetailSection
createNomenclaturalReferenceDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1448 NomenclaturalReferenceDetailSection section
= new NomenclaturalReferenceDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1449 addAndAdaptSection(parentElement
, section
);
1453 public TaxonBaseDetailSection
createTaxonBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1454 TaxonBaseDetailSection section
= new TaxonBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1455 addAndAdaptSection(parentElement
, section
);
1459 public AuthorshipDetailSection
createAuthorshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1460 AuthorshipDetailSection section
= new AuthorshipDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1461 addAndAdaptSection(parentElement
, section
);
1465 public TeamOrPersonBaseDetailSection
createTeamOrPersonBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1466 TeamOrPersonBaseDetailSection section
= new TeamOrPersonBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1467 addAndAdaptSection(parentElement
, section
);
1471 public TeamDetailSection
createTeamDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1472 TeamDetailSection section
= new TeamDetailSection(this, conversation
, parentElement
, null, style
);
1473 addAndAdaptSection(parentElement
, section
);
1477 public PersonDetailSection
createPersonDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1478 PersonDetailSection section
= new PersonDetailSection(this, conversation
, parentElement
, null, style
);
1479 addAndAdaptSection(parentElement
, section
);
1483 public DescriptionDetailSection
createDescriptionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1484 DescriptionDetailSection section
= new DescriptionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1485 addAndAdaptSection(parentElement
, section
);
1489 public DescriptionElementDetailSection
createDescriptionElementDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1490 DescriptionElementDetailSection section
= new DescriptionElementDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1491 addAndAdaptSection(parentElement
, section
);
1495 public ParsingMessagesSection
createParsingMessagesSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1496 ParsingMessagesSection section
= new ParsingMessagesSection(this, conversation
, parentElement
, selectionProvider
, style
);
1497 addAndAdaptSection(parentElement
, section
);
1501 public NonViralNameDetailSection
createNonViralNameDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1502 NonViralNameDetailSection section
= new NonViralNameDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1503 addAndAdaptSection(parentElement
, section
);
1507 public MediaDetailsSection
createMediaDetailsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1508 MediaDetailsSection section
= new MediaDetailsSection(this, conversation
, parentElement
, selectionProvider
, style
);
1509 addAndAdaptSection(parentElement
, section
);
1513 public DerivedUnitFacadeDetailSection
createDerivedUnitFacadeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1514 DerivedUnitFacadeDetailSection section
= new DerivedUnitFacadeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1515 addAndAdaptSection(parentElement
, section
);
1519 public FieldObservationDetailSection
createFieldObservationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1520 FieldObservationDetailSection section
= new FieldObservationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1521 addAndAdaptSection(parentElement
, section
);
1525 public GatheringEventDetailSection
createGatheringEventDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1526 GatheringEventDetailSection section
= new GatheringEventDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1527 addAndAdaptSection(parentElement
, section
);
1531 public DerivedUnitBaseDetailSection
createDerivedUnitBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1532 DerivedUnitBaseDetailSection section
= new DerivedUnitBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1533 addAndAdaptSection(parentElement
, section
);
1537 public NaturalLanguageSection
createNaturalLanguageSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1538 NaturalLanguageSection section
= new NaturalLanguageSection(this, conversation
, parentElement
, selectionProvider
, style
);
1539 addAndAdaptSection(parentElement
, section
);
1543 public FeatureDistributionDetailSection
createFeatureDistributionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1544 FeatureDistributionDetailSection section
= new FeatureDistributionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1545 addAndAdaptSection(parentElement
, section
);
1549 public ClassificationDetailSection
createClassificationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1550 ClassificationDetailSection section
= new ClassificationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1551 addAndAdaptSection(parentElement
, section
);
1555 public TaxonNodeDetailSection
createTaxonNodeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1556 TaxonNodeDetailSection section
= new TaxonNodeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1557 addAndAdaptSection(parentElement
, section
);
1561 public PolytomousKeyDetailSection
createPolytomousKeyDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1562 PolytomousKeyDetailSection section
= new PolytomousKeyDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1563 addAndAdaptSection(parentElement
, section
);
1567 public PolytomousKeyNodeDetailSection
createPolytomousKeyNodeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1568 PolytomousKeyNodeDetailSection section
= new PolytomousKeyNodeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1569 addAndAdaptSection(parentElement
, section
);
1573 public InstitutionDetailSection
createInstitutionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1574 InstitutionDetailSection section
= new InstitutionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1575 addAndAdaptSection(parentElement
, section
);
1579 public GeneralDetailSection
createGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1580 GeneralDetailSection section
= new GeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1581 addAndAdaptSection(parentElement
, section
);
1585 public HybridDetailSection
createHybridDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1586 HybridDetailSection section
= new HybridDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1587 addAndAdaptSection(parentElement
, section
);
1591 public UserDetailSection
createUserDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1592 UserDetailSection section
= new UserDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1593 addAndAdaptSection(parentElement
, section
);
1597 public GroupDetailSection
createGroupDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1598 GroupDetailSection section
= new GroupDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1599 addAndAdaptSection(parentElement
, section
);
1603 public DeterminationDetailSection
createDeterminationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1604 DeterminationDetailSection section
= new DeterminationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1605 addAndAdaptSection(parentElement
, section
);
1609 public TaxonRelationshipDetailSection
createTaxonRelationshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1610 TaxonRelationshipDetailSection section
= new TaxonRelationshipDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1611 addAndAdaptSection(parentElement
, section
);
1615 public ReferencedEntityDetailSection
createReferencedEntityDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1616 ReferencedEntityDetailSection section
= new ReferencedEntityDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1617 addAndAdaptSection(parentElement
, section
);
1621 public TermVocabularyDetailSection
createTermVocabularyDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1622 TermVocabularyDetailSection section
= new TermVocabularyDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1623 addAndAdaptSection(parentElement
, section
);
1627 public GatheringEventDetailSection
createGatheringSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1628 GatheringEventDetailSection section
= new GatheringEventDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1629 addAndAdaptSection(parentElement
, section
);
1633 public NamedAreaDetailSection
createNamedAreaDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1634 NamedAreaDetailSection section
= new NamedAreaDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1635 addAndAdaptSection(parentElement
, section
);
1639 public UseRecordDetailSection
createUseRecordDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1640 UseRecordDetailSection section
= new UseRecordDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1641 addAndAdaptSection(parentElement
, section
);
1645 private void addAndAdaptSection(ICdmFormElement parentElement
, AbstractFormSection
<?
> section
) {
1646 parentElement
.addElement(section
);
1650 //--------DetailElements------------
1652 public UseRecordDetailElement
createUseRecordDetailElement(ICdmFormElement parentElement
){
1653 UseRecordDetailElement element
= new UseRecordDetailElement(this, parentElement
);
1654 addAndAdaptElement(parentElement
, element
);
1658 public DefinedTermDetailElement
<NamedAreaLevel
> createNamedAreaLevelElement(ICdmFormElement parentElement
){
1659 DefinedTermDetailElement
<NamedAreaLevel
> element
= new DefinedTermDetailElement
<NamedAreaLevel
>(this, parentElement
);
1660 addAndAdaptElement(parentElement
, element
);
1664 public eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement
createNamedAreaDetailElement(ICdmFormElement parentElement
){
1665 eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement element
= new eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement(this, parentElement
);
1666 addAndAdaptElement(parentElement
, element
);
1670 public TermVocabularyDetailElement
createTermVocabularyDetailElement(ICdmFormElement parentElement
){
1671 TermVocabularyDetailElement element
= new TermVocabularyDetailElement(this, parentElement
);
1672 addAndAdaptElement(parentElement
, element
);
1676 public ReferenceEntityDetailElement
createReferenceEntityDetailElement(ICdmFormElement parentElement
){
1677 ReferenceEntityDetailElement element
= new ReferenceEntityDetailElement(this, parentElement
);
1678 addAndAdaptElement(parentElement
, element
);
1682 public TaxonRelationshipDetailElement
createTaxonRelationshipDetailElement(ICdmFormElement parentElement
){
1683 TaxonRelationshipDetailElement element
= new TaxonRelationshipDetailElement(this, parentElement
);
1684 addAndAdaptElement(parentElement
, element
);
1688 public GrantedAuthorityDetailElement
createGrantedAuthorityDetailElement(ICdmFormElement parentElement
){
1689 GrantedAuthorityDetailElement element
= new GrantedAuthorityDetailElement(this, parentElement
);
1690 addAndAdaptElement(parentElement
, element
);
1694 public GroupDetailElement
createGroupDetailElement(ICdmFormElement parentElement
){
1695 GroupDetailElement element
= new GroupDetailElement(this, parentElement
);
1696 addAndAdaptElement(parentElement
, element
);
1700 public UserDetailElement
createUserDetailElement(ICdmFormElement parentElement
){
1701 UserDetailElement element
= new UserDetailElement(this, parentElement
);
1702 addAndAdaptElement(parentElement
, element
);
1706 public HybridDetailElement
createHybridDetailElement(ICdmFormElement parentElement
){
1707 HybridDetailElement element
= new HybridDetailElement(this, parentElement
);
1708 addAndAdaptElement(parentElement
, element
);
1712 public InstitutionDetailElement
createInstitutionDetailElement(ICdmFormElement parentElement
){
1713 InstitutionDetailElement element
= new InstitutionDetailElement(this, parentElement
);
1714 addAndAdaptElement(parentElement
, element
);
1718 public PolytomousKeyNodeDetailElement
createPolytomousKeyNodeDetailElement(ICdmFormElement parentElement
){
1719 PolytomousKeyNodeDetailElement element
= new PolytomousKeyNodeDetailElement(this, parentElement
);
1720 addAndAdaptElement(parentElement
, element
);
1724 public PolytomousKeyDetailElement
createPolytomousKeyDetailElement(ICdmFormElement parentElement
){
1725 PolytomousKeyDetailElement element
= new PolytomousKeyDetailElement(this, parentElement
);
1726 addAndAdaptElement(parentElement
, element
);
1730 public CollectionDetailElement
createCollectionDetailElement(ICdmFormElement parentElement
){
1731 CollectionDetailElement element
= new CollectionDetailElement(this, parentElement
);
1732 addAndAdaptElement(parentElement
, element
);
1736 public TaxonNodeDetailElement
createTaxonNodeDetailElement(ICdmFormElement parentElement
){
1737 TaxonNodeDetailElement element
= new TaxonNodeDetailElement(this, parentElement
);
1738 addAndAdaptElement(parentElement
, element
);
1742 public ClassificationDetailElement
createClassificationDetailElement(ICdmFormElement parentElement
){
1743 ClassificationDetailElement element
= new ClassificationDetailElement(this, parentElement
);
1744 addAndAdaptElement(parentElement
, element
);
1748 public FeatureDistributionDetailElement
createFeatureDistributionDetailElement(ICdmFormElement parentElement
){
1749 FeatureDistributionDetailElement element
= new FeatureDistributionDetailElement(this, parentElement
);
1750 addAndAdaptElement(parentElement
, element
);
1754 public NaturalLanguageDetailElement
createNaturalLanguageDetailElement(ICdmFormElement parentElement
){
1755 NaturalLanguageDetailElement element
= new NaturalLanguageDetailElement(this, parentElement
);
1756 addAndAdaptElement(parentElement
, element
);
1760 public DerivedUnitFacadeDetailElement
createDerivedUnitFacadeDetailElement(ICdmFormElement parentElement
){
1761 DerivedUnitFacadeDetailElement element
= new DerivedUnitFacadeDetailElement(this, parentElement
);
1762 addAndAdaptElement(parentElement
, element
);
1766 public NonViralNameDetailElement
createNonViralNameDetailElement(ICdmFormElement parentElement
){
1767 NonViralNameDetailElement element
= new NonViralNameDetailElement(this, parentElement
);
1768 addAndAdaptElement(parentElement
, element
);
1772 public DescriptionElementDetailElement
createDescriptionElementDetailElement(ICdmFormElement parentElement
, int style
){
1773 DescriptionElementDetailElement element
= new DescriptionElementDetailElement(this, parentElement
, style
);
1774 addAndAdaptElement(parentElement
, element
);
1778 public DescriptionDetailElement
createDescriptionDetailElement(ICdmFormElement parentElement
, int style
){
1779 DescriptionDetailElement element
= new DescriptionDetailElement(this, parentElement
, style
);
1780 addAndAdaptElement(parentElement
, element
);
1784 public PersonDetailElement
createPersonDetailElement(ICdmFormElement parentElement
, int style
){
1785 PersonDetailElement element
= new PersonDetailElement(this, parentElement
, style
);
1786 addAndAdaptElement(parentElement
, element
);
1790 public TeamDetailElement
createTeamDetailElement(ICdmFormElement parentElement
, int style
){
1791 TeamDetailElement element
= new TeamDetailElement(this, parentElement
, style
);
1792 addAndAdaptElement(parentElement
, element
);
1796 public AuthorshipDetailElement
createAuthorshipDetailElement(ICdmFormElement parentElement
, int style
){
1797 AuthorshipDetailElement element
= new AuthorshipDetailElement(this, parentElement
, style
);
1798 addAndAdaptElement(parentElement
, element
);
1802 public TaxonBaseDetailElement
createTaxonBaseDetailElement(ICdmFormElement parentElement
, int style
){
1803 TaxonBaseDetailElement element
= new TaxonBaseDetailElement(this, parentElement
, style
);
1804 addAndAdaptElement(parentElement
, element
);
1808 public NameDetailElement
createNameDetailElement(ICdmFormElement parentElement
, int style
){
1809 NameDetailElement element
= new NameDetailElement(this, parentElement
, style
);
1810 addAndAdaptElement(parentElement
, element
);
1814 public ReferenceDetailElement
createReferenceDetailElement(ICdmFormElement parentElement
, int style
){
1815 ReferenceDetailElement element
= new ReferenceDetailElement(this, parentElement
, style
);
1816 addAndAdaptElement(parentElement
, element
);
1820 public NomenclaturalReferenceDetailElement
createNomenclaturalReferenceDetailElement(ICdmFormElement parentElement
, int style
){
1821 NomenclaturalReferenceDetailElement element
= new NomenclaturalReferenceDetailElement(this, parentElement
, style
);
1822 addAndAdaptElement(parentElement
, element
);
1827 public GeneralDetailElement
createGeneralDetailElement(ICdmFormElement parentElement
){
1828 GeneralDetailElement element
= new GeneralDetailElement(this, parentElement
);
1829 addAndAdaptElement(parentElement
, element
);
1834 public GatheringEventDetailElement
createGatheringEventDetailElement(ICdmFormElement parentElement
) {
1835 GatheringEventDetailElement element
= new GatheringEventDetailElement(this, parentElement
);
1836 addAndAdaptElement(parentElement
, element
);
1840 public FieldObservationDetailElement
createFieldObservationDetailElement(ICdmFormElement parentElement
) {
1841 FieldObservationDetailElement element
= new FieldObservationDetailElement(this, parentElement
);
1842 addAndAdaptElement(parentElement
, element
);
1847 public DerivedUnitBaseDetailElement
createDerivedUnitBaseDetailElement(ICdmFormElement parentElement
) {
1848 DerivedUnitBaseDetailElement element
= new DerivedUnitBaseDetailElement(this, parentElement
);
1849 addAndAdaptElement(parentElement
, element
);
1853 public DeterminationDetailElement
createDeterminationDetailElement(ICdmFormElement parentElement
) {
1854 DeterminationDetailElement element
= new DeterminationDetailElement(this, parentElement
);
1855 addAndAdaptElement(parentElement
, element
);
1860 * @param parentElement
1863 private void addAndAdaptElement(ICdmFormElement parentElement
, AbstractCdmDetailElement
<?
> element
) {
1865 parentElement
.addElement(element
);
1868 //--------EntityCollectionSection----------
1869 public TeamMemberSection
createTeamMemberSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1870 TeamMemberSection section
= new TeamMemberSection(this, conversation
, parentElement
, style
);
1871 addAndAdaptSection(parentElement
, section
);
1875 public AnnotationSection
createAnnotationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1876 AnnotationSection section
= new AnnotationSection(this, conversation
, parentElement
, style
);
1877 addAndAdaptSection(parentElement
, section
);
1881 public CreditSection
createCreditSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1882 CreditSection section
= new CreditSection(this, conversation
, parentElement
, style
);
1883 addAndAdaptSection(parentElement
, section
);
1887 public DescriptionElementSourceSection
createDescriptionElementSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1888 DescriptionElementSourceSection section
= new DescriptionElementSourceSection(this, conversation
, parentElement
, style
);
1889 addAndAdaptSection(parentElement
, section
);
1893 public ExtensionSection
createExtensionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1894 ExtensionSection section
= new ExtensionSection(this, conversation
, parentElement
, style
);
1895 addAndAdaptSection(parentElement
, section
);
1899 public MarkerSection
createMarkerSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1900 MarkerSection section
= new MarkerSection(this, conversation
, parentElement
, style
);
1901 addAndAdaptSection(parentElement
, section
);
1905 public MediaSection
createMediaSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1906 MediaSection section
= new MediaSection(this, conversation
, parentElement
, style
);
1907 addAndAdaptSection(parentElement
, section
);
1911 public DescriptionElementMediaSection
createDescriptionElementMediaSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1912 DescriptionElementMediaSection section
= new DescriptionElementMediaSection(this, conversation
, parentElement
, style
);
1913 addAndAdaptSection(parentElement
, section
);
1917 public MediaRepresentationSection
createMediaRepresentationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1918 MediaRepresentationSection section
= new MediaRepresentationSection(this, conversation
, parentElement
, style
);
1919 addAndAdaptSection(parentElement
, section
);
1923 public MediaRepresentationPartSection
createMediaRepresentationPartSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1924 MediaRepresentationPartSection section
= new MediaRepresentationPartSection(this, conversation
, parentElement
, style
);
1925 addAndAdaptSection(parentElement
, section
);
1929 public ModifierSection
createModifierSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1930 ModifierSection section
= new ModifierSection(this, conversation
, parentElement
, style
);
1931 addAndAdaptSection(parentElement
, section
);
1935 public NomenclaturalStatusSection
createNomenclaturalStatusSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1936 NomenclaturalStatusSection section
= new NomenclaturalStatusSection(this, conversation
, parentElement
, style
);
1937 addAndAdaptSection(parentElement
, section
);
1941 public NameRelationshipDetailSection
createNameRelationshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1942 NameRelationshipDetailSection section
= new NameRelationshipDetailSection(this, conversation
, parentElement
, style
);
1943 addAndAdaptSection(parentElement
, section
);
1947 public ProtologueSection
createProtologueSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1948 ProtologueSection section
= new ProtologueSection(this, conversation
, parentElement
, style
);
1949 addAndAdaptSection(parentElement
, section
);
1953 public RightsSection
createRightsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1954 RightsSection section
= new RightsSection(this, conversation
, parentElement
, style
);
1955 addAndAdaptSection(parentElement
, section
);
1959 public SourceSection
createSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1960 SourceSection section
= new SourceSection(this, conversation
, parentElement
, style
);
1961 addAndAdaptSection(parentElement
, section
);
1965 public ScopeSection
createScopeSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1966 ScopeSection section
= new ScopeSection(this, conversation
, parentElement
, style
);
1967 addAndAdaptSection(parentElement
, section
);
1971 public DescriptionSourceSection
createDescriptionSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1972 DescriptionSourceSection section
= new DescriptionSourceSection(this, conversation
, parentElement
, style
);
1973 addAndAdaptSection(parentElement
, section
);
1977 public TypeDesignationSection
createTypeDesignationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1978 TypeDesignationSection section
= new TypeDesignationSection(this, conversation
, parentElement
, style
);
1979 addAndAdaptSection(parentElement
, section
);
1983 public StateDataSection
createStateDataSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1984 StateDataSection section
= new StateDataSection(this, conversation
, parentElement
, style
);
1985 addAndAdaptSection(parentElement
, section
);
1989 public StatisticalMeasurementValueSection
createStatisticalMeasurementValueSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1990 StatisticalMeasurementValueSection section
= new StatisticalMeasurementValueSection(this, conversation
, parentElement
, style
);
1991 addAndAdaptSection(parentElement
, section
);
1995 public DescribedSpecimenSection
createDescribedSpecimenSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1996 DescribedSpecimenSection section
= new DescribedSpecimenSection(this, conversation
, parentElement
, style
);
1997 addAndAdaptSection(parentElement
, section
);
2001 public CollectingAreasDetailSection
createCollectingAreasDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2002 CollectingAreasDetailSection section
= new CollectingAreasDetailSection(this, conversation
, parentElement
, style
);
2003 addAndAdaptSection(parentElement
, section
);
2007 public CurrentDeterminationDetailSection
createCurrentDeterminationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2008 CurrentDeterminationDetailSection section
= new CurrentDeterminationDetailSection(this, conversation
, parentElement
, style
);
2009 addAndAdaptSection(parentElement
, section
);
2013 public DeterminationHistoryDetailSection
createDeterminationHistoryDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2014 DeterminationHistoryDetailSection section
= new DeterminationHistoryDetailSection(this, conversation
, parentElement
, style
);
2015 addAndAdaptSection(parentElement
, section
);
2019 public SpecimenCollectionDetailSection
createSpecimenCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2020 SpecimenCollectionDetailSection section
= new SpecimenCollectionDetailSection(this, conversation
, parentElement
, style
);
2021 addAndAdaptSection(parentElement
, section
);
2025 public SourceCollectionDetailSection
createSourceCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2026 SourceCollectionDetailSection section
= new SourceCollectionDetailSection(this, conversation
, parentElement
, style
);
2027 addAndAdaptSection(parentElement
, section
);
2031 public GeographicalScopeDetailSection
createGeographicalScopeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2032 GeographicalScopeDetailSection section
= new GeographicalScopeDetailSection(this, conversation
, parentElement
, style
);
2033 addAndAdaptSection(parentElement
, section
);
2037 public ScopeRestrictionSection
createScopeRestrictionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2038 ScopeRestrictionSection section
= new ScopeRestrictionSection(this, conversation
, parentElement
, style
);
2039 addAndAdaptSection(parentElement
, section
);
2043 public MemberDetailSection
createMemberDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2044 MemberDetailSection section
= new MemberDetailSection(this, conversation
, parentElement
, style
);
2045 addAndAdaptSection(parentElement
, section
);
2049 public GrantedAuthorityDetailSection
createGrantedAuthorityDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2050 GrantedAuthorityDetailSection section
= new GrantedAuthorityDetailSection(this, conversation
, parentElement
, style
);
2051 addAndAdaptSection(parentElement
, section
);
2055 public GroupsByUserDetailSection
createGroupsByUserDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2056 GroupsByUserDetailSection section
= new GroupsByUserDetailSection(this, conversation
, parentElement
, style
);
2057 addAndAdaptSection(parentElement
, section
);
2061 public TaxonomicScopeSection
createTaxonomicScopeSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2062 TaxonomicScopeSection section
= new TaxonomicScopeSection(this, conversation
, parentElement
, style
);
2063 addAndAdaptSection(parentElement
, section
);
2069 * createEntityCollectionElement
2072 * @param removeListener
2073 * a {@link org.eclipse.swt.events.SelectionListener} object.
2076 * @param parentElement
2078 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
2080 * @param versionableEntity
2081 * a {@link eu.etaxonomy.cdm.model.common.IVersionableEntity}
2083 * @param backgroundColor
2084 * a {@link org.eclipse.swt.graphics.Color} object.
2086 * {@link eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement}
2089 public AbstractEntityCollectionElement
createEntityCollectionElement(AbstractFormSection parentElement
,
2090 Object versionableEntity
, SelectionListener removeListener
, Color backgroundColor
, int style
) {
2091 AbstractEntityCollectionElement element
= null;
2093 Object entity
= HibernateProxyHelper
.deproxy(versionableEntity
);
2095 if (entity
instanceof Annotation
) {
2096 element
= new AnnotationElement(this, parentElement
, (Annotation
) entity
, removeListener
, style
);
2097 } else if (entity
instanceof Person
) {
2098 element
= new TeamMemberElement(this, parentElement
, (Person
) entity
, removeListener
, style
);
2099 } else if (entity
instanceof Credit
) {
2100 element
= new CreditElement(this, parentElement
, (Credit
) entity
, removeListener
, style
);
2101 } else if (entity
instanceof Extension
) {
2102 element
= new ExtensionElement(this, parentElement
, (Extension
) entity
, removeListener
, style
);
2103 } else if (entity
instanceof Marker
) {
2104 element
= new MarkerElement(this, parentElement
, (Marker
) entity
, removeListener
, style
);
2105 } else if (entity
instanceof Media
) {
2106 element
= new MediaElement(this, parentElement
, (Media
) entity
, removeListener
, style
);
2107 } else if (entity
instanceof MediaRepresentation
) {
2108 element
= new MediaRepresentationElement(this, parentElement
, (MediaRepresentation
) entity
, removeListener
,
2110 } else if (entity
instanceof ImageFile
) {
2111 element
= new ImageFileElement(this, parentElement
, (ImageFile
) entity
, removeListener
, style
);
2112 } else if (entity
instanceof MediaRepresentationPart
) {
2113 element
= new MediaRepresentationPartElement(this, parentElement
, (MediaRepresentationPart
) entity
,
2114 removeListener
, style
);
2115 } else if (entity
instanceof NomenclaturalStatus
) {
2116 element
= new NomenclaturalStatusElement(this, parentElement
, (NomenclaturalStatus
) entity
, removeListener
,
2118 } else if (entity
instanceof Rights
) {
2119 element
= new RightsElement(this, parentElement
, (Rights
) entity
, removeListener
, style
);
2120 } else if (entity
instanceof DescriptionElementSource
) {
2121 element
= new DescriptionElementSourceElement(this, parentElement
, (DescriptionElementSource
) entity
,
2122 removeListener
, style
);
2123 } else if (entity
instanceof IdentifiableSource
) {
2124 element
= new IdentifiableSourceElement(this, parentElement
, (IdentifiableSource
) entity
, removeListener
,
2126 } else if (entity
instanceof DefinedTerm
) {
2127 switch(((DefinedTerm
)entity
).getTermType()) {
2129 element
= new ScopeElement(this,
2131 (DefinedTerm
) entity
,
2136 element
= new ModifierElement(this,
2138 (DefinedTerm
) entity
,
2143 //FIXME : Actually we should through an exception here
2148 } else if (entity
instanceof Reference
) {
2149 element
= new DescriptionSourceElement(this, parentElement
, (Reference
) entity
, removeListener
, style
);
2150 } else if (entity
instanceof NameTypeDesignation
) {
2151 element
= new NameTypeDesignationElement(this, parentElement
, (NameTypeDesignation
) entity
, removeListener
,
2153 } else if (entity
instanceof NameRelationship
) {
2154 element
= new NameRelationshipDetailElement(this, parentElement
, (NameRelationship
) entity
, removeListener
,
2156 } else if (entity
instanceof SpecimenTypeDesignation
) {
2157 element
= new SpecimenTypeDesignationElement(this, parentElement
, (SpecimenTypeDesignation
) entity
,
2158 removeListener
, style
);
2159 } else if (entity
instanceof StateData
) {
2160 element
= new StateDataElement(this, parentElement
, (StateData
) entity
, removeListener
, style
);
2161 } else if (entity
instanceof StatisticalMeasurementValue
) {
2162 element
= new StatisticalMeasurementValueElement(this, parentElement
, (StatisticalMeasurementValue
) entity
,
2163 removeListener
, style
);
2164 } else if (entity
instanceof DerivedUnit
) {
2165 switch(((DerivedUnit
)entity
).getRecordBasis()) {
2166 case LivingSpecimen
:
2167 case PreservedSpecimen
:
2169 element
= new SpecimenCollectionDetailElement(this,
2171 (DerivedUnit
) entity
,
2176 element
= new DerivedUnitElement(this,
2178 (DerivedUnit
) entity
,
2183 } else if (entity
instanceof NamedArea
) {
2184 element
= new NamedAreaDetailElement(this, parentElement
, (NamedArea
) entity
, removeListener
, style
);
2185 } else if (entity
instanceof DeterminationEvent
) {
2186 element
= new DeterminationEventDetailElement(this, parentElement
, (DeterminationEvent
) entity
, removeListener
, style
);
2187 } else if (entity
instanceof DerivedUnit
&& ((DerivedUnit
)entity
).getRecordBasis()==SpecimenOrObservationType
.PreservedSpecimen
) {
2188 element
= new SpecimenCollectionDetailElement(this, parentElement
, (DerivedUnit
) entity
, removeListener
, style
);
2189 } else if (entity
instanceof User
) {
2190 element
= new MemberDetailElement(this, parentElement
, (User
) entity
, removeListener
, style
);
2191 } else if (entity
instanceof GrantedAuthority
) {
2192 element
= new GrantedAuthorityCollectionElement(this, parentElement
, (GrantedAuthorityImpl
) entity
,
2193 removeListener
, style
);
2194 } else if (entity
instanceof Group
) {
2195 element
= new GroupsByUserDetailElement(this, parentElement
, (Group
) entity
, removeListener
, style
);
2196 } else if (entity
instanceof Taxon
) {
2197 element
= new TaxonDetailElement(this, parentElement
, (Taxon
) entity
, removeListener
, style
);
2198 } else if (entity
instanceof DescriptionElementBase
) {
2199 // this is the special case for protologs, maybe we can do this
2200 // differently when API improves
2201 DescriptionElementBase descriptionElement
= (DescriptionElementBase
) entity
;
2202 if (descriptionElement
.getFeature().equals(Feature
.PROTOLOGUE())) {
2203 element
= new ProtologueElement(this, parentElement
, descriptionElement
, removeListener
, style
);
2207 if (element
== null) {
2208 AbstractUtility
.errorDialog("No element for entity", this,
2209 "Could not generate element for entity. Looks like the case is not handled already. Check implementation. Entity: "
2213 else if (backgroundColor
!= null && !backgroundColor
.isDisposed()) {
2214 element
.setPersistentBackground(backgroundColor
);
2216 parentElement
.addElement(element
);
2222 public void createNamedAreaFieldController(AbstractFormSection parentElement
, NamedArea namedArea
, SelectionListener removeListener
){
2223 // Object entity = HibernateProxyHelper.deproxy(versionableEntity); TODO deproxy necessary??
2224 NamedAreaFieldController element
= new NamedAreaFieldController(this, parentElement
, namedArea
, removeListener
, SWT
.NONE
);
2226 parentElement
.addElement(element
);
2231 * Creates a selection element for the given type T.
2234 * <strong>Selection elements not handled by this method:</strong>
2236 * <li>{@link TaxonNodeSelectionElement} see
2237 * {@link #createTaxonNodeSelectionElement(ConversationHolder, ICdmFormElement, String, TaxonNode, int, int)}
2239 * <li>{@link NomenclaturalAuthorTeamSelectionElement} see
2240 * {@link #createNomenclaturalAuthorTeamSelectionElement(ConversationHolder, ICdmFormElement, String, Team, int, int)}
2246 * a {@link Class} object of the type that you want the selection
2248 * @param parentElement
2249 * a {@link ICdmFormElement} object.
2250 * @param labelString
2251 * a {@link String} object.
2252 * @param selectionType
2254 * a {@link ICdmBase} object.
2257 * @param conversation
2258 * a {@link ConversationHolder} object.
2259 * @return a {@link EntitySelectionElement} object.
2261 public <T
extends ICdmBase
> EntitySelectionElement
<T
> createSelectionElement(Class
<T
> clazz
,
2262 ConversationHolder conversation
, ICdmFormElement parentElement
, String labelString
, T selection
, int mode
,
2264 EntitySelectionElement
<T
> element
= new EntitySelectionElement
<T
>(this, conversation
, parentElement
, clazz
,
2265 labelString
, selection
, mode
, style
);
2267 parentElement
.addElement(element
);
2271 public TaxonNodeSelectionElement
createTaxonNodeSelectionElement(ConversationHolder conversation
,
2272 ICdmFormElement parentElement
, String labelString
, TaxonNode selection
, int mode
, int style
) {
2273 TaxonNodeSelectionElement element
= new TaxonNodeSelectionElement(this, conversation
, parentElement
,
2274 labelString
, selection
, mode
, style
);
2276 parentElement
.addElement(element
);
2280 public NomenclaturalAuthorTeamSelectionElement
createNomenclaturalAuthorTeamSelectionElement(
2281 ConversationHolder conversation
, ICdmFormElement parentElement
, String labelString
, Team selection
,
2282 int mode
, int style
) {
2283 NomenclaturalAuthorTeamSelectionElement element
= new NomenclaturalAuthorTeamSelectionElement(this,
2284 conversation
, parentElement
, labelString
, selection
, mode
, style
);
2286 parentElement
.addElement(element
);
2290 /** {@inheritDoc} */
2291 public LabelElement
createLabel(ICdmFormElement parentElement
, String text
) {
2292 LabelElement labelElement
= new LabelElement(this, parentElement
, text
);
2293 adapt(labelElement
);
2294 parentElement
.addElement(labelElement
);
2295 return labelElement
;
2300 * Getter for the field <code>selectionProvider</code>.
2303 * @return a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
2305 public ISelectionProvider
getSelectionProvider() {
2306 return selectionProvider
;
2311 * createDetailedDescriptionDetailElement
2314 * @param parentElement
2315 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
2319 * {@link eu.etaxonomy.cdm.model.description.DescriptionElementBase}
2324 * {@link eu.etaxonomy.taxeditor.ui.section.description.detail.AbstractDetailedDescriptionDetailElement}
2327 public AbstractDetailedDescriptionDetailElement
createDetailedDescriptionDetailElement(
2328 ICdmFormElement parentElement
, DescriptionElementBase entity
, int style
) {
2329 AbstractDetailedDescriptionDetailElement detailedDescriptionElement
= null;
2331 if (entity
instanceof CategoricalData
) {
2332 detailedDescriptionElement
= new CategoricalDataDetailElement(this, parentElement
,
2333 (CategoricalData
) entity
, style
);
2334 } else if (entity
instanceof CommonTaxonName
) {
2335 detailedDescriptionElement
= new CommonNameDetailElement(this, parentElement
, (CommonTaxonName
) entity
,
2337 } else if (entity
instanceof Distribution
) {
2338 detailedDescriptionElement
= new DistributionDetailElement(this, parentElement
, (Distribution
) entity
,
2340 } else if (entity
instanceof IndividualsAssociation
) {
2341 detailedDescriptionElement
= new IndividualsAssociationDetailElement(this, parentElement
,
2342 (IndividualsAssociation
) entity
, style
);
2343 } else if (entity
instanceof QuantitativeData
) {
2344 detailedDescriptionElement
= new QuantitativeDataDetailElement(this, parentElement
,
2345 (QuantitativeData
) entity
, style
);
2346 } else if (entity
instanceof TaxonInteraction
) {
2347 detailedDescriptionElement
= new TaxonInteractionDetailElement(this, parentElement
,
2348 (TaxonInteraction
) entity
, style
);
2349 } else if (entity
instanceof TextData
) {
2350 detailedDescriptionElement
= new TextDataDetailElement(this, parentElement
, (TextData
) entity
, style
);
2352 throw new IllegalStateException("There is no interface for the given description element");
2354 adapt(detailedDescriptionElement
);
2355 parentElement
.addElement(detailedDescriptionElement
);
2356 return detailedDescriptionElement
;
2361 * Creates a styled text as a part of the form.
2366 * the text initial value
2369 * @return the text widget
2371 public StyledText
createStyledText(Composite parent
, String value
, int style
) {
2372 StyledText text
= new StyledText(parent
, getBorderStyle() | style
| getOrientation());
2373 if (value
!= null) {
2374 text
.setText(value
);
2376 text
.setForeground(getColors().getForeground());
2377 text
.setBackground(getColors().getBackground());
2378 // text.addFocusListener(visibilityHandler);
2385 * @param conversationHolder
2387 * @param detailsViewer
2391 public FieldObservationSection
createFieldObservationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
2392 FieldObservationSection section
= new FieldObservationSection(this, conversation
, parentElement
, selectionProvider
, style
);
2393 addAndAdaptSection(parentElement
, section
);
2398 * @param conversationHolder
2400 * @param detailsViewer
2404 public SpecimenSection
createSpecimenSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
2405 SpecimenSection section
= new SpecimenSection(this, conversation
, parentElement
, selectionProvider
, style
);
2406 addAndAdaptSection(parentElement
, section
);
2410 public SpecimenGeneralElementController
createSpecimenGeneralElementController(ICdmFormElement parentElement
){
2411 SpecimenGeneralElement specimenGeneralElement
= new SpecimenGeneralElement(parentElement
.getLayoutComposite(), SWT
.NONE
);
2412 specimenGeneralElement
.setLayoutData(LayoutConstants
.FILL_HORIZONTALLY(2,1));
2413 SpecimenGeneralElementController element
= new SpecimenGeneralElementController(specimenGeneralElement
, this, parentElement
);
2414 addAndAdaptElement(parentElement
, element
);
2418 public FieldObservationGeneralElementController
createFieldObservationGeneralElement(ICdmFormElement parentElement
){
2419 FieldObservationGeneralElement fieldObservationGeneralElement
= new FieldObservationGeneralElement(parentElement
.getLayoutComposite(), SWT
.NONE
);
2420 fieldObservationGeneralElement
.setLayoutData(LayoutConstants
.FILL_HORIZONTALLY(2,1));
2421 FieldObservationGeneralElementController element
= new FieldObservationGeneralElementController(fieldObservationGeneralElement
, this, parentElement
);
2422 addAndAdaptElement(parentElement
, element
);
2426 public GatheringEventDetailsElementController
createGatheringEventDetailsElementController(ICdmFormElement parentElement
) {
2427 GatheringEventDetailsElement gatheringEventDetailsElement
= new GatheringEventDetailsElement(parentElement
.getLayoutComposite(), SWT
.NONE
);
2428 gatheringEventDetailsElement
.setLayoutData(LayoutConstants
.FILL_HORIZONTALLY(2,1));
2429 GatheringEventDetailsElementController element
= new GatheringEventDetailsElementController(gatheringEventDetailsElement
, this, parentElement
);
2431 parentElement
.addElement(element
);
2435 public FieldObservationDetailsElementController
createFieldObservationDetailsElementController(ICdmFormElement parentElement
) {
2436 FieldObservationDetailsElement fieldObservationDetailsElement
= new FieldObservationDetailsElement(parentElement
.getLayoutComposite(), SWT
.NONE
);
2437 fieldObservationDetailsElement
.setLayoutData(LayoutConstants
.FILL_HORIZONTALLY(2,1));
2438 FieldObservationDetailsElementController element
= new FieldObservationDetailsElementController(fieldObservationDetailsElement
, this, parentElement
);
2439 addAndAdaptElement(parentElement
, element
);