4 package eu
.etaxonomy
.taxeditor
.ui
.element
;
7 import java
.util
.ArrayList
;
8 import java
.util
.HashSet
;
13 import org
.eclipse
.jface
.util
.IPropertyChangeListener
;
14 import org
.eclipse
.jface
.viewers
.ISelection
;
15 import org
.eclipse
.jface
.viewers
.ISelectionProvider
;
16 import org
.eclipse
.jface
.window
.Window
;
17 import org
.eclipse
.swt
.SWT
;
18 import org
.eclipse
.swt
.custom
.StyledText
;
19 import org
.eclipse
.swt
.events
.FocusAdapter
;
20 import org
.eclipse
.swt
.events
.FocusEvent
;
21 import org
.eclipse
.swt
.events
.FocusListener
;
22 import org
.eclipse
.swt
.events
.MouseAdapter
;
23 import org
.eclipse
.swt
.events
.MouseEvent
;
24 import org
.eclipse
.swt
.events
.MouseListener
;
25 import org
.eclipse
.swt
.events
.SelectionEvent
;
26 import org
.eclipse
.swt
.events
.SelectionListener
;
27 import org
.eclipse
.swt
.events
.TypedEvent
;
28 import org
.eclipse
.swt
.graphics
.Color
;
29 import org
.eclipse
.swt
.graphics
.Font
;
30 import org
.eclipse
.swt
.widgets
.Composite
;
31 import org
.eclipse
.swt
.widgets
.Control
;
32 import org
.eclipse
.swt
.widgets
.Display
;
33 import org
.eclipse
.swt
.widgets
.Event
;
34 import org
.eclipse
.swt
.widgets
.Label
;
35 import org
.eclipse
.ui
.forms
.IFormColors
;
36 import org
.eclipse
.ui
.forms
.widgets
.ExpandableComposite
;
37 import org
.eclipse
.ui
.forms
.widgets
.FormToolkit
;
38 import org
.eclipse
.ui
.forms
.widgets
.Section
;
39 import org
.eclipse
.ui
.internal
.forms
.widgets
.FormFonts
;
40 import org
.joda
.time
.Partial
;
41 import org
.springframework
.security
.core
.GrantedAuthority
;
43 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
44 import eu
.etaxonomy
.cdm
.api
.facade
.DerivedUnitFacade
;
45 import eu
.etaxonomy
.cdm
.hibernate
.HibernateProxyHelper
;
46 import eu
.etaxonomy
.cdm
.model
.agent
.Person
;
47 import eu
.etaxonomy
.cdm
.model
.agent
.Team
;
48 import eu
.etaxonomy
.cdm
.model
.common
.Annotation
;
49 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
50 import eu
.etaxonomy
.cdm
.model
.common
.Credit
;
51 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTerm
;
52 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTermBase
;
53 import eu
.etaxonomy
.cdm
.model
.common
.Extension
;
54 import eu
.etaxonomy
.cdm
.model
.common
.GrantedAuthorityImpl
;
55 import eu
.etaxonomy
.cdm
.model
.common
.Group
;
56 import eu
.etaxonomy
.cdm
.model
.common
.ICdmBase
;
57 import eu
.etaxonomy
.cdm
.model
.common
.IEnumTerm
;
58 import eu
.etaxonomy
.cdm
.model
.common
.IdentifiableSource
;
59 import eu
.etaxonomy
.cdm
.model
.common
.Language
;
60 import eu
.etaxonomy
.cdm
.model
.common
.LanguageString
;
61 import eu
.etaxonomy
.cdm
.model
.common
.Marker
;
62 import eu
.etaxonomy
.cdm
.model
.common
.TermType
;
63 import eu
.etaxonomy
.cdm
.model
.common
.TimePeriod
;
64 import eu
.etaxonomy
.cdm
.model
.common
.User
;
65 import eu
.etaxonomy
.cdm
.model
.common
.VersionableEntity
;
66 import eu
.etaxonomy
.cdm
.model
.description
.CategoricalData
;
67 import eu
.etaxonomy
.cdm
.model
.description
.CommonTaxonName
;
68 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionElementBase
;
69 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionElementSource
;
70 import eu
.etaxonomy
.cdm
.model
.description
.Distribution
;
71 import eu
.etaxonomy
.cdm
.model
.description
.Feature
;
72 import eu
.etaxonomy
.cdm
.model
.description
.IndividualsAssociation
;
73 import eu
.etaxonomy
.cdm
.model
.description
.KeyStatement
;
74 import eu
.etaxonomy
.cdm
.model
.description
.QuantitativeData
;
75 import eu
.etaxonomy
.cdm
.model
.description
.StateData
;
76 import eu
.etaxonomy
.cdm
.model
.description
.StatisticalMeasurementValue
;
77 import eu
.etaxonomy
.cdm
.model
.description
.TaxonInteraction
;
78 import eu
.etaxonomy
.cdm
.model
.description
.TextData
;
79 import eu
.etaxonomy
.cdm
.model
.location
.NamedArea
;
80 import eu
.etaxonomy
.cdm
.model
.location
.NamedAreaLevel
;
81 import eu
.etaxonomy
.cdm
.model
.location
.Point
;
82 import eu
.etaxonomy
.cdm
.model
.media
.ImageFile
;
83 import eu
.etaxonomy
.cdm
.model
.media
.Media
;
84 import eu
.etaxonomy
.cdm
.model
.media
.MediaRepresentation
;
85 import eu
.etaxonomy
.cdm
.model
.media
.MediaRepresentationPart
;
86 import eu
.etaxonomy
.cdm
.model
.media
.Rights
;
87 import eu
.etaxonomy
.cdm
.model
.name
.NameRelationship
;
88 import eu
.etaxonomy
.cdm
.model
.name
.NameTypeDesignation
;
89 import eu
.etaxonomy
.cdm
.model
.name
.NomenclaturalStatus
;
90 import eu
.etaxonomy
.cdm
.model
.name
.SpecimenTypeDesignation
;
91 import eu
.etaxonomy
.cdm
.model
.occurrence
.DerivedUnit
;
92 import eu
.etaxonomy
.cdm
.model
.occurrence
.DeterminationEvent
;
93 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
94 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
95 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonNode
;
96 import eu
.etaxonomy
.cdm
.strategy
.parser
.ParserProblem
;
97 import eu
.etaxonomy
.taxeditor
.model
.AbstractUtility
;
98 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.basicFields
.NamedAreaFieldController
;
99 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.compatibility
.ICdmFormElement
;
100 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.fieldObservation
.FieldObservationDetailsElement
;
101 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.fieldObservation
.FieldObservationDetailsElementController
;
102 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.fieldObservation
.FieldObservationDetailsSection
;
103 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.fieldObservation
.FieldObservationGeneralElement
;
104 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.fieldObservation
.FieldObservationGeneralElementController
;
105 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.fieldObservation
.FieldObservationGeneralSection
;
106 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.fieldObservation
.GatheringEventDetailsElement
;
107 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.fieldObservation
.GatheringEventDetailsElementController
;
108 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.fieldObservation
.GatheringEventSection
;
109 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.specimen
.SpecimenGeneralElement
;
110 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.specimen
.SpecimenGeneralElementController
;
111 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.specimen
.SpecimenSection
;
112 import eu
.etaxonomy
.taxeditor
.ui
.combo
.EnumComboElement
;
113 import eu
.etaxonomy
.taxeditor
.ui
.combo
.TermComboElement
;
114 import eu
.etaxonomy
.taxeditor
.ui
.element
.MinMaxTextSection
.UnitType
;
115 import eu
.etaxonomy
.taxeditor
.ui
.openurl
.IOpenUrlEnabled
;
116 import eu
.etaxonomy
.taxeditor
.ui
.openurl
.OpenUrlSelectorElement
;
117 import eu
.etaxonomy
.taxeditor
.ui
.password
.EditPasswordElement
;
118 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailElement
;
119 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailSection
;
120 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionElement
;
121 import eu
.etaxonomy
.taxeditor
.ui
.section
.EmptyElement
;
122 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.InstitutionDetailElement
;
123 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.InstitutionDetailSection
;
124 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailElement
;
125 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailSection
;
126 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailElement
;
127 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailSection
;
128 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamMemberElement
;
129 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamMemberSection
;
130 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamOrPersonBaseDetailSection
;
131 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.ClassificationDetailElement
;
132 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.ClassificationDetailSection
;
133 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.TaxonNodeDetailElement
;
134 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.TaxonNodeDetailSection
;
135 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferenceEntityDetailElement
;
136 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferencedEntityDetailSection
;
137 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DerivedUnitElement
;
138 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescribedSpecimenSection
;
139 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailElement
;
140 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailSection
;
141 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailElement
;
142 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailSection
;
143 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementMediaSection
;
144 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceElement
;
145 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceSection
;
146 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceElement
;
147 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceSection
;
148 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.MediaDetailsSection
;
149 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ModifierElement
;
150 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ModifierSection
;
151 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageDetailElement
;
152 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageSection
;
153 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeElement
;
154 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeSection
;
155 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StateDataElement
;
156 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StateDataSection
;
157 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StatisticalMeasurementValueElement
;
158 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StatisticalMeasurementValueSection
;
159 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.AbstractDetailedDescriptionDetailElement
;
160 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.CategoricalDataDetailElement
;
161 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.CommonNameDetailElement
;
162 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.DistributionDetailElement
;
163 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.IndividualsAssociationDetailElement
;
164 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.QuantitativeDataDetailElement
;
165 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.TaxonInteractionDetailElement
;
166 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.TextDataDetailElement
;
167 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailElement
;
168 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailSection
;
169 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityCollectionElement
;
170 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailElement
;
171 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailSection
;
172 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailElement
;
173 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailSection
;
174 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailElement
;
175 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailSection
;
176 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.GeographicalScopeDetailSection
;
177 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailElement
;
178 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailSection
;
179 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailElement
;
180 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailSection
;
181 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.ScopeRestrictionSection
;
182 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.TaxonomicScopeSection
;
183 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.ImageFileElement
;
184 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaElement
;
185 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationElement
;
186 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationPartElement
;
187 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationPartSection
;
188 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationSection
;
189 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaSection
;
190 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.AuthorshipDetailElement
;
191 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.AuthorshipDetailSection
;
192 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.HybridDetailElement
;
193 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.HybridDetailSection
;
194 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameDetailElement
;
195 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameDetailSection
;
196 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailElement
;
197 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailSection
;
198 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameTypeDesignationElement
;
199 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusElement
;
200 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusSection
;
201 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailElement
;
202 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailSection
;
203 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.ProtologueElement
;
204 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.ProtologueSection
;
205 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.SpecimenTypeDesignationElement
;
206 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.TypeDesignationSection
;
207 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CollectingAreasDetailSection
;
208 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CollectionDetailElement
;
209 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CurrentDeterminationDetailSection
;
210 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitBaseDetailElement
;
211 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitBaseDetailSection
;
212 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitFacadeDetailElement
;
213 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitFacadeDetailSection
;
214 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailElement
;
215 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailSection
;
216 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationEventDetailElement
;
217 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationHistoryDetailSection
;
218 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldObservationDetailElement
;
219 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldObservationDetailSection
;
220 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailElement
;
221 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailSection
;
222 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GeneralDetailElement
;
223 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GeneralDetailSection
;
224 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.NamedAreaDetailElement
;
225 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SourceCollectionDetailSection
;
226 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SpecimenCollectionDetailElement
;
227 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SpecimenCollectionDetailSection
;
228 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailElement
;
229 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailSection
;
230 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailElement
;
231 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailSection
;
232 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.AnnotationElement
;
233 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.AnnotationSection
;
234 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CdmBaseElement
;
235 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CdmBaseSection
;
236 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CreditElement
;
237 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CreditSection
;
238 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.ExtensionElement
;
239 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.ExtensionSection
;
240 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.HeadlineSection
;
241 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.IdentifiableSourceElement
;
242 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.MarkerElement
;
243 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.MarkerSection
;
244 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.RightsElement
;
245 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.RightsSection
;
246 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.SourceSection
;
247 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.VersionElement
;
248 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.VersionSection
;
249 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessageElement
;
250 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessagesSection
;
251 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailElement
;
252 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailSection
;
253 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonDetailElement
;
254 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailElement
;
255 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailSection
;
256 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailElement
;
257 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailSection
;
258 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailElement
;
259 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailSection
;
260 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailElement
;
261 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailSection
;
262 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.DefinedTermDetailElement
;
263 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.DefinedTermDetailSection
;
264 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailSection
;
265 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailElement
;
266 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailSection
;
267 import eu
.etaxonomy
.taxeditor
.ui
.selection
.EntitySelectionElement
;
268 import eu
.etaxonomy
.taxeditor
.ui
.selection
.NomenclaturalAuthorTeamSelectionElement
;
269 import eu
.etaxonomy
.taxeditor
.ui
.selection
.TaxonNodeSelectionElement
;
273 * CdmFormFactory class.
277 * @created Feb 24, 2010
280 public class CdmFormFactory
extends FormToolkit
{
282 private BoldFontHolder2 boldFontHolder2
;
283 private MouseListener selectionMouseHandler
;
284 private FocusListener selectionFocusHandler
;
286 private final Set
<SelectionListener
> selectionListenerList
= new HashSet
<SelectionListener
>();
288 private final List
<IPropertyChangeListener
> propertyChangeListeners
= new ArrayList
<IPropertyChangeListener
>();
290 private final int orientation
= Window
.getDefaultOrientation();
291 private ISelectionProvider selectionProvider
;
293 /** Constant <code>EMPTY_SELECTION</code> */
294 public static ISelection EMPTY_SELECTION
= new ISelection() {
296 public boolean isEmpty() {
307 private class SelectionMouseHandler
extends MouseAdapter
{
309 public void mouseDown(MouseEvent e
) {
310 notifySelectionListeners(e
);
320 private class SelectionFocusHandler
extends FocusAdapter
{
322 public void focusGained(FocusEvent e
) {
323 notifySelectionListeners(e
);
327 private void notifySelectionListeners(TypedEvent e
) {
328 Event event
= new Event();
329 event
.widget
= e
.widget
;
330 SelectionEvent selectionEvent
= new SelectionEvent(event
);
332 for (SelectionListener listener
: selectionListenerList
) {
333 listener
.widgetSelected(selectionEvent
);
339 * Constructor for CdmFormFactory.
343 * a {@link org.eclipse.swt.widgets.Display} object.
344 * @param selectionProvider
345 * a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
347 public CdmFormFactory(Display display
, ISelectionProvider selectionProvider
) {
349 this.selectionProvider
= selectionProvider
;
355 * Constructor for CdmFormFactory.
359 * a {@link org.eclipse.swt.widgets.Display} object.
361 public CdmFormFactory(Display display
) {
369 private void init() {
370 boldFontHolder2
= new BoldFontHolder2();
371 selectionMouseHandler
= new SelectionMouseHandler();
372 selectionFocusHandler
= new SelectionFocusHandler();
376 * Creates an instance initialized with the correct selectionProvider
378 * Make sure to remove the instance when the entityComposite disposes via
379 * destroySelectionArbitrator(..)
381 * @param entityElement
382 * a {@link eu.etaxonomy.taxeditor.ui.element.IEntityElement}
384 * @return a {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator}
387 public SelectionArbitrator
createSelectionArbitrator(IEntityElement entityElement
) {
388 SelectionArbitrator selectionArbitrator
= new SelectionArbitrator(entityElement
);
389 selectionArbitrator
.addSelectionProvider(selectionProvider
);
390 selectionProvider
.addSelectionChangedListener(selectionArbitrator
);
391 addSelectionListener(selectionArbitrator
);
392 return selectionArbitrator
;
397 * destroySelectionArbitrator
400 * @param selectionArbitrator
402 * {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator}
405 public void destroySelectionArbitrator(SelectionArbitrator selectionArbitrator
) {
406 removeSelectionListener(selectionArbitrator
);
407 if (selectionProvider
!= null) {
408 selectionProvider
.removeSelectionChangedListener(selectionArbitrator
);
410 AbstractUtility
.error(this.getClass(),
411 "Tried to destroy a selection listener from this factories listeners but was null", null);
417 * Adapts the {@link AbstractCdmFormElement}:<br>
418 * - sets the {@link IPropertyChangeListener}s handled by this class
423 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement}
426 public void adapt(AbstractCdmFormElement formElement
) {
427 formElement
.setPropertyChangeListeners(propertyChangeListeners
);
432 public void adapt(Control control
, boolean trackFocus
, boolean trackKeyboard
) {
434 control
.addFocusListener(selectionFocusHandler
);
436 super.adapt(control
, trackFocus
, trackKeyboard
);
441 public void adapt(Composite composite
) {
442 composite
.addMouseListener(selectionMouseHandler
);
443 super.adapt(composite
);
452 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
455 public void destroyElement(ICdmFormElement formElement
) {
456 // return if element was not initialized
457 if (formElement
== null) {
460 // destroy selection arbitrator, if any
461 if (formElement
instanceof ISelectableElement
) {
462 destroySelectionArbitrator(((ISelectableElement
) formElement
).getSelectionArbitrator());
464 // remove this element form its parents list of elements
465 // ICdmFormElement parentElement = formElement.getParentElement();
466 // if(parentElement != null){
467 // parentElement.removeElement(formElement);
469 // call destroy on child elements recursively
470 for (ICdmFormElement childElement
: formElement
.getElements()) {
471 destroyElement(childElement
);
473 // dispose of the controls
474 for (Control control
: formElement
.getControls()) {
475 // we added the layoutComposite of the parental element as the
476 // layout composite to this formElement
477 // but we do not want to destroy it.
478 if (control
.equals(formElement
.getLayoutComposite())) {
493 * a {@link org.eclipse.swt.widgets.Composite} object.
494 * @return a {@link org.eclipse.swt.widgets.Label} object.
496 public Label
createEmptyCell(Composite parent
) {
497 return this.createLabel(parent
, null);
502 * createMultilineTextWithLabel
506 * a {@link java.lang.String} object.
511 * @param parentElement
512 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
514 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
517 public TextWithLabelElement
createMultilineTextWithLabel(ICdmFormElement parentElement
, String labelString
,
518 int textHeight
, int style
) {
519 TextWithLabelElement element
= new TextWithLabelElement(this, parentElement
, labelString
, "", textHeight
, style
);
521 parentElement
.addElement(element
);
527 * createMultiLanguageTextElement
530 * @param parentElement
531 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
534 * a {@link java.lang.String} object.
535 * @param multilanguageText
536 * a {@link java.util.Map} object.
542 * {@link eu.etaxonomy.taxeditor.ui.element.MultilanguageTextElement}
545 public MultilanguageTextElement
createMultiLanguageTextElement(ICdmFormElement parentElement
, String labelString
,
546 Map
<Language
, LanguageString
> multilanguageText
, int textHeight
, int style
) {
547 MultilanguageTextElement element
= new MultilanguageTextElement(this, parentElement
, labelString
,
548 multilanguageText
, textHeight
, style
);
550 parentElement
.addElement(element
);
554 public KeyStatementElement
createKeyStatementElement(ICdmFormElement parentElement
, String labelString
,
555 KeyStatement keyStatement
, int textHeight
, int style
) {
556 KeyStatementElement element
= new KeyStatementElement(this, parentElement
, labelString
, keyStatement
,
559 parentElement
.addElement(element
);
565 * createTextWithLabelElement
569 * a {@link java.lang.String} object.
571 * a {@link java.lang.String} object.
574 * @param parentElement
575 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
577 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
580 public TextWithLabelElement
createTextWithLabelElement(ICdmFormElement parentElement
, String labelString
,
581 String initialText
, int style
) {
582 TextWithLabelElement element
= new TextWithLabelElement(this, parentElement
, labelString
, initialText
, null,
585 parentElement
.addElement(element
);
589 public UriWithLabelElement
createUriWithLabelElement(ICdmFormElement parentElement
, String labelString
,
590 URI initialUri
, int style
) {
591 UriWithLabelElement element
= new UriWithLabelElement(this, parentElement
, labelString
, initialUri
, null, style
);
593 parentElement
.addElement(element
);
604 public OpenUrlSelectorElement
createOpenUrlSelectorElement(ICdmFormElement parentElement
, String labelString
,
605 IOpenUrlEnabled openUrlEnabled
, int style
) {
606 OpenUrlSelectorElement element
= new OpenUrlSelectorElement(this, parentElement
, labelString
, openUrlEnabled
,
609 parentElement
.addElement(element
);
615 * @param parentElement
617 * @param conversationEnabled
622 public EditPasswordElement
createEditPasswordElement(ICdmFormElement parentElement
, String labelString
,
623 ConversationHolder conversation
, User user
, int style
) {
624 EditPasswordElement element
= new EditPasswordElement(this, parentElement
, labelString
, user
, conversation
);
626 parentElement
.addElement(element
);
632 * createIntegerTextWithLabelElement
635 * @param parentElement
636 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
639 * a {@link java.lang.String} object.
640 * @param initialInteger
641 * a {@link java.lang.Integer} object.
645 * {@link eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement}
648 public NumberWithLabelElement
createNumberTextWithLabelElement(
649 ICdmFormElement parentElement
, String labelString
,
650 Number initialNumber
, int style
) {
651 NumberWithLabelElement element
= new NumberWithLabelElement(this,
652 parentElement
, labelString
, initialNumber
, style
);
654 parentElement
.addElement(element
);
660 * createLanguageStringWithLabelElement
663 * @param parentElement
664 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
667 * a {@link java.lang.String} object.
668 * @param languageString
669 * a {@link eu.etaxonomy.cdm.model.common.LanguageString} object.
673 * {@link eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement}
676 public LanguageStringWithLabelElement
createLanguageStringWithLabelElement(ICdmFormElement parentElement
,
677 String labelString
, LanguageString languageString
, int style
) {
678 LanguageStringWithLabelElement element
= new LanguageStringWithLabelElement(this, parentElement
, labelString
,
679 languageString
, style
);
681 parentElement
.addElement(element
);
687 * createLanguageStringWithLabelElement
690 * @param parentElement
691 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
694 * a {@link java.lang.String} object.
695 * @param languageString
696 * a {@link eu.etaxonomy.cdm.model.common.LanguageString} object.
702 * {@link eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement}
705 public LanguageStringWithLabelElement
createLanguageStringWithLabelElement(ICdmFormElement parentElement
,
706 String labelString
, LanguageString languageString
, int height
, int style
) {
707 LanguageStringWithLabelElement element
= new LanguageStringWithLabelElement(this, parentElement
, labelString
,
708 languageString
, height
, style
);
710 parentElement
.addElement(element
);
719 * @param parentElement
720 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
723 * a {@link java.lang.String} object.
726 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
729 public TextWithLabelElement
createTextElement(ICdmFormElement parentElement
, String initialText
, int style
) {
730 TextWithLabelElement element
= new TextWithLabelElement(this, parentElement
, null, initialText
, null, style
);
732 parentElement
.addElement(element
);
738 * createKeyValueViewerElement
741 * @param parentElement
742 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
745 * a {@link java.lang.String} object.
746 * @param valueHeading
747 * a {@link java.lang.String} object.
749 * a {@link java.util.Map} object.
750 * @return a {@link eu.etaxonomy.taxeditor.ui.element.KeyValueViewerElement}
753 public KeyValueViewerElement
createKeyValueViewerElement(ICdmFormElement parentElement
, String keyHeading
,
754 String valueHeading
, Map
<Object
, Object
> map
) {
755 KeyValueViewerElement element
= new KeyValueViewerElement(this, parentElement
, keyHeading
, valueHeading
, map
);
757 parentElement
.addElement(element
);
763 * createTermComboElement
766 * @param termComboType
768 * {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.TermComboType}
770 * @param parentElement
771 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
774 * a {@link java.lang.String} object.
776 * a {@link eu.etaxonomy.cdm.model.common.DefinedTermBase}
780 * @return a {@link eu.etaxonomy.taxeditor.ui.combo.TermComboElement}
784 public <T
extends DefinedTermBase
> TermComboElement
<T
> createTermComboElement(Class
<T
> termComboType
,
785 ICdmFormElement parentElement
, String labelString
, T selection
, int style
) {
786 TermComboElement
<T
> element
= new TermComboElement
<T
>(this, parentElement
, termComboType
, labelString
,
789 parentElement
.addElement(element
);
795 * createTermComboElement
798 * @param termComboType
800 * {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.TermComboType}
802 * @param parentElement
803 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
806 * a {@link java.lang.String} object.
808 * a {@link eu.etaxonomy.cdm.model.common.DefinedTermBase}
812 * @return a {@link eu.etaxonomy.taxeditor.ui.combo.TermComboElement}
816 public <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
818 ICdmFormElement parentElement
,
822 TermComboElement
<T
> element
= new TermComboElement
<T
>(this, parentElement
, termType
, labelString
, selection
, style
);
824 parentElement
.addElement(element
);
830 * createEnumComboElement
833 * @param enumComboType
835 * {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EnumComboType}
837 * @param parentElement
838 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
842 * @return a {@link eu.etaxonomy.taxeditor.ui.term.AbstractEnumComboElement}
845 public <T
extends IEnumTerm
> EnumComboElement
<T
> createEnumComboElement(
846 Class
<T
> enumComboType
, ICdmFormElement parentElement
,
848 EnumComboElement
<T
> element
= new EnumComboElement
<T
>(this, parentElement
, enumComboType
, style
);
850 parentElement
.addElement(element
);
856 * createBrowserElement
860 * a {@link java.net.URI} object.
863 * @param parentElement
864 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
866 * @return a {@link eu.etaxonomy.taxeditor.ui.element.BrowserElement}
869 public BrowserElement
createBrowserElement(ICdmFormElement parentElement
, URI imageUri
, int style
) {
870 BrowserElement element
= new BrowserElement(this, parentElement
, imageUri
, style
);
872 parentElement
.addElement(element
);
881 * @param parentElement
882 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
885 * a {@link java.net.URI} object.
888 * @return a {@link eu.etaxonomy.taxeditor.ui.element.ImageElement} object.
890 public ImageElement
createImageElement(ICdmFormElement parentElement
, URI imageUri
, int style
) {
891 ImageElement element
= new ImageElement(this, parentElement
, imageUri
, style
);
893 parentElement
.addElement(element
);
899 * createTextActionElement
903 * a {@link java.lang.String} object.
905 * a {@link java.lang.String} object.
908 * @param parentElement
909 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
912 * a {@link java.lang.String} object.
913 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextActionElement}
916 public TextActionElement
createTextActionElement(ICdmFormElement parentElement
, String labelString
,
917 String buttonLabel
, String initialText
, int style
) {
918 TextActionElement element
= new TextActionElement(this, parentElement
, labelString
, buttonLabel
, initialText
,
921 parentElement
.addElement(element
);
930 * @param parentElement
931 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
934 * a {@link java.lang.String} object.
935 * @param initialState
939 * @return a {@link eu.etaxonomy.taxeditor.ui.element.CheckboxElement}
942 public CheckboxElement
createCheckbox(ICdmFormElement parentElement
, String label
, boolean initialState
, int style
) {
943 CheckboxElement element
= new CheckboxElement(this, parentElement
, label
, initialState
, style
| orientation
);
945 parentElement
.addElement(element
);
950 * Creates a section as a part of the form.
952 * @return the section widget
955 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
958 public Section
adapt(AbstractFormSection section
) {
959 section
.setMenu(section
.getLayoutComposite().getMenu());
960 adapt(section
, true, true);
962 // handle focus and property change events for cdm use
963 section
.addFocusListener(selectionFocusHandler
);
964 section
.setPropertyChangeListeners(propertyChangeListeners
);
966 if (section
.getToggle() != null) {
967 section
.getToggle().setHoverDecorationColor(getColors().getColor(IFormColors
.TB_TOGGLE_HOVER
));
968 section
.getToggle().setDecorationColor(getColors().getColor(IFormColors
.TB_TOGGLE
));
971 section
.setFont(boldFontHolder2
.getBoldFont(section
.getLayoutComposite().getFont()));
973 if ((section
.getStyle() & ExpandableComposite
.TITLE_BAR
) != 0
974 || (section
.getStyle() & ExpandableComposite
.SHORT_TITLE_BAR
) != 0) {
975 getColors().initializeSectionToolBarColors();
976 section
.setTitleBarBackground(getColors().getColor(IFormColors
.TB_BG
));
977 section
.setTitleBarBorderColor(getColors().getColor(IFormColors
.TB_BORDER
));
979 // call setTitleBarForeground regardless as it also sets the label color
980 section
.setTitleBarForeground(getColors().getColor(IFormColors
.TB_TOGGLE
));
984 private class BoldFontHolder2
{
985 private Font normalFont
;
987 private Font boldFont
;
989 public BoldFontHolder2() {
992 public Font
getBoldFont(Font font
) {
993 createBoldFont(font
);
997 private void createBoldFont(Font font
) {
998 if (normalFont
== null || !normalFont
.equals(font
)) {
1002 if (boldFont
== null) {
1003 boldFont
= FormFonts
.getInstance().getBoldFont(getColors().getDisplay(), normalFont
);
1007 public void dispose() {
1008 if (boldFont
!= null) {
1009 FormFonts
.getInstance().markFinished(boldFont
, getColors().getDisplay());
1017 * createToggleableTextField
1020 * @param parentElement
1021 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1023 * @param labelString
1024 * a {@link java.lang.String} object.
1025 * @param initialText
1026 * a {@link java.lang.String} object.
1027 * @param initialState
1031 * @return a {@link eu.etaxonomy.taxeditor.ui.element.ToggleableTextElement}
1034 public ToggleableTextElement
createToggleableTextField(ICdmFormElement parentElement
, String labelString
,
1035 String initialText
, boolean initialState
, int style
) {
1036 ToggleableTextElement element
= new ToggleableTextElement(this, parentElement
, labelString
, initialText
,
1037 initialState
, style
| orientation
);
1039 parentElement
.addElement(element
);
1045 * createTimePeriodElement
1048 * @param parentElement
1049 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1051 * @param labelString
1052 * a {@link java.lang.String} object.
1054 * a {@link eu.etaxonomy.cdm.model.common.TimePeriod} object.
1057 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TimePeriodElement}
1060 public TimePeriodElement
createTimePeriodElement(ICdmFormElement parentElement
, String labelString
,
1061 TimePeriod timePeriod
, int style
) {
1062 TimePeriodElement element
= new TimePeriodElement(this, parentElement
, labelString
, timePeriod
, style
);
1064 parentElement
.addElement(element
);
1070 * createGatheringEventUnitElement
1073 * @param parentElement
1074 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1076 * @param labelString
1077 * a {@link java.lang.String} object.
1079 * a {@link eu.etaxonomy.cdm.model.common.GatheringEvent} object.
1082 * @return a {@link eu.etaxonomy.taxeditor.ui.element.GatheringEventUnitElement}
1085 public GatheringEventUnitElement
createGatheringEventUnitElement(
1086 ICdmFormElement parentElement
,
1088 DerivedUnitFacade gatheringEvent
,
1089 MinMaxTextSection
.UnitType unitType
,
1091 GatheringEventUnitElement element
= new GatheringEventUnitElement(this,
1098 parentElement
.addElement(element
);
1104 * createPointElement
1109 * @param parentElement
1110 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1113 * a {@link eu.etaxonomy.cdm.model.location.Point} object.
1114 * @return a {@link eu.etaxonomy.taxeditor.ui.element.PointElement} object.
1116 public PointElement
createPointElement(ICdmFormElement parentElement
, Point point
, int style
) {
1117 PointElement element
= new PointElement(this, parentElement
, point
, style
);
1119 parentElement
.addElement(element
);
1125 * createDateDetailSection
1128 * @param parentElement
1129 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1133 * @return a {@link eu.etaxonomy.taxeditor.ui.element.DateDetailSection}
1136 public DateDetailSection
createDateDetailSection(ICdmFormElement parentElement
, int style
) {
1137 DateDetailSection section
= new DateDetailSection(this, parentElement
, style
);
1138 parentElement
.addElement(section
);
1145 * createDateDetailSection
1148 * @param parentElement
1149 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1153 * @return a {@link eu.etaxonomy.taxeditor.ui.element.MinMaxTextSection}
1156 public MinMaxTextSection
createMinMaxTextSection(ICdmFormElement parentElement
, UnitType unitType
, int style
) {
1157 MinMaxTextSection section
= new MinMaxTextSection(this, parentElement
, unitType
, style
);
1158 parentElement
.addElement(section
);
1165 * createPartialElement
1168 * @param parentElement
1169 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1171 * @param labelString
1172 * a {@link java.lang.String} object.
1174 * a {@link org.joda.time.Partial} object.
1177 * @return a {@link eu.etaxonomy.taxeditor.ui.element.PartialElement}
1180 public PartialElement
createPartialElement(ICdmFormElement parentElement
, String labelString
, Partial partial
,
1182 PartialElement element
= new PartialElement(this, parentElement
, labelString
, style
);
1184 parentElement
.addElement(element
);
1190 * addSelectionListener
1194 * a {@link org.eclipse.swt.events.SelectionListener} object.
1196 public void addSelectionListener(SelectionListener listener
) {
1197 selectionListenerList
.add(listener
);
1202 * removeSelectionListener
1206 * a {@link org.eclipse.swt.events.SelectionListener} object.
1208 public void removeSelectionListener(SelectionListener listener
) {
1209 if (listener
== null) {
1210 AbstractUtility
.error(this.getClass(),
1211 "Tried to remove a selection listener from this factories listeners but was null", null);
1213 selectionListenerList
.remove(listener
);
1219 * addPropertyChangeListener
1223 * a {@link org.eclipse.jface.util.IPropertyChangeListener}
1226 public void addPropertyChangeListener(IPropertyChangeListener listener
) {
1227 if (propertyChangeListeners
.contains(listener
)) {
1230 propertyChangeListeners
.add(0, listener
);
1235 * removePropertyChangeListener
1239 * a {@link org.eclipse.jface.util.IPropertyChangeListener}
1242 public void removePropertyChangeListener(IPropertyChangeListener listener
) {
1243 propertyChangeListeners
.remove(listener
);
1247 * @return the propertyChangeListeners
1249 public List
<IPropertyChangeListener
> getPropertyChangeListeners() {
1250 return propertyChangeListeners
;
1255 * createHorizontalSeparator
1258 * @param parentElement
1259 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1263 * @return a {@link org.eclipse.swt.widgets.Label} object.
1265 public Label
createHorizontalSeparator(ICdmFormElement parentElement
, int style
) {
1266 Label separator
= this.createSeparator(parentElement
.getLayoutComposite(), SWT
.HORIZONTAL
| style
);
1267 separator
.setLayoutData(LayoutConstants
.FILL_HORIZONTALLY());
1273 * createVersionElement
1276 * @param parentElement
1277 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1280 * a {@link eu.etaxonomy.cdm.model.common.VersionableEntity}
1285 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.VersionElement}
1288 public VersionElement
createVersionElement(ICdmFormElement parentElement
, VersionableEntity entity
, int style
) {
1289 VersionElement element
= new VersionElement(this, parentElement
, entity
, style
);
1291 parentElement
.addElement(element
);
1296 * @param cdmBaseSection
1301 public CdmBaseElement
createCdmBaseElement(ICdmFormElement parentElement
, CdmBase entity
, int style
) {
1302 CdmBaseElement element
= new CdmBaseElement(this, parentElement
, entity
, style
);
1304 parentElement
.addElement(element
);
1310 * createVersionSection
1313 * @param parentElement
1314 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1319 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.VersionSection}
1322 public VersionSection
createVersionSection(ICdmFormElement parentElement
, int style
) {
1323 VersionSection section
= new VersionSection(this, parentElement
, style
);
1324 parentElement
.addElement(section
);
1334 public CdmBaseSection
createCdmBaseSection(ICdmFormElement parentElement
, int style
) {
1335 CdmBaseSection section
= new CdmBaseSection(this, parentElement
, style
);
1336 parentElement
.addElement(section
);
1343 * createEmptyElement
1346 * @param parentElement
1347 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1349 * @return a {@link eu.etaxonomy.taxeditor.ui.section.EmptyElement} object.
1351 public EmptyElement
createEmptyElement(ICdmFormElement parentElement
) {
1352 EmptyElement element
= new EmptyElement(this, parentElement
, null, SWT
.NULL
);
1354 parentElement
.addElement(element
);
1360 * createHeadlineSection
1363 * @param parentElement
1364 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1367 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.HeadlineSection}
1370 public HeadlineSection
createHeadlineSection(ICdmFormElement parentElement
) {
1371 HeadlineSection section
= new HeadlineSection(this, parentElement
, SWT
.NULL
);
1372 parentElement
.addElement(section
);
1379 * createParsingMessageElement
1382 * @param parentElement
1383 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1385 * @param parserProblem
1386 * a {@link eu.etaxonomy.cdm.strategy.parser.ParserProblem}
1391 * {@link eu.etaxonomy.taxeditor.ui.section.taxon.ParsingMessageElement}
1394 public ParsingMessageElement
createParsingMessageElement(ICdmFormElement parentElement
,
1395 ParserProblem parserProblem
, int style
) {
1396 ParsingMessageElement element
= new ParsingMessageElement(this, parentElement
, parserProblem
, style
);
1398 parentElement
.addElement(element
);
1402 public AbstractFormSection
createDefinedTermDetailSection(Class definedTermClass
, ConversationHolder conversation
,
1403 ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
1405 AbstractFormSection section
= new DefinedTermDetailSection(this, definedTermClass
, conversation
, parentElement
,
1406 selectionProvider
, style
);
1408 parentElement
.addElement(section
);
1415 * @param definedTermClass
1416 * @param formElement
1420 public AbstractCdmDetailElement
createDefinedTermDetailElement(Class definedTermClass
, AbstractCdmDetailSection parentElement
, int style
) {
1421 AbstractCdmDetailElement element
= null;
1423 if (NamedArea
.class.isAssignableFrom(definedTermClass
)) {
1424 element
= new eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement(this, parentElement
);
1426 element
= new DefinedTermDetailElement(this, parentElement
);
1430 parentElement
.addElement(element
);
1435 //--------DetailSections---------
1436 public NameDetailSection
createNameDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1437 NameDetailSection section
= new NameDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1438 addAndAdaptSection(parentElement
, section
);
1442 public ReferenceDetailSection
createReferenceDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1443 ReferenceDetailSection section
= new ReferenceDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1444 addAndAdaptSection(parentElement
, section
);
1448 public NomenclaturalReferenceDetailSection
createNomenclaturalReferenceDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1449 NomenclaturalReferenceDetailSection section
= new NomenclaturalReferenceDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1450 addAndAdaptSection(parentElement
, section
);
1454 public TaxonBaseDetailSection
createTaxonBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1455 TaxonBaseDetailSection section
= new TaxonBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1456 addAndAdaptSection(parentElement
, section
);
1460 public AuthorshipDetailSection
createAuthorshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1461 AuthorshipDetailSection section
= new AuthorshipDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1462 addAndAdaptSection(parentElement
, section
);
1466 public TeamOrPersonBaseDetailSection
createTeamOrPersonBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1467 TeamOrPersonBaseDetailSection section
= new TeamOrPersonBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1468 addAndAdaptSection(parentElement
, section
);
1472 public TeamDetailSection
createTeamDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1473 TeamDetailSection section
= new TeamDetailSection(this, conversation
, parentElement
, null, style
);
1474 addAndAdaptSection(parentElement
, section
);
1478 public PersonDetailSection
createPersonDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1479 PersonDetailSection section
= new PersonDetailSection(this, conversation
, parentElement
, null, style
);
1480 addAndAdaptSection(parentElement
, section
);
1484 public DescriptionDetailSection
createDescriptionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1485 DescriptionDetailSection section
= new DescriptionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1486 addAndAdaptSection(parentElement
, section
);
1490 public DescriptionElementDetailSection
createDescriptionElementDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1491 DescriptionElementDetailSection section
= new DescriptionElementDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1492 addAndAdaptSection(parentElement
, section
);
1496 public ParsingMessagesSection
createParsingMessagesSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1497 ParsingMessagesSection section
= new ParsingMessagesSection(this, conversation
, parentElement
, selectionProvider
, style
);
1498 addAndAdaptSection(parentElement
, section
);
1502 public NonViralNameDetailSection
createNonViralNameDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1503 NonViralNameDetailSection section
= new NonViralNameDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1504 addAndAdaptSection(parentElement
, section
);
1508 public MediaDetailsSection
createMediaDetailsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1509 MediaDetailsSection section
= new MediaDetailsSection(this, conversation
, parentElement
, selectionProvider
, style
);
1510 addAndAdaptSection(parentElement
, section
);
1514 public DerivedUnitFacadeDetailSection
createDerivedUnitFacadeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1515 DerivedUnitFacadeDetailSection section
= new DerivedUnitFacadeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1516 addAndAdaptSection(parentElement
, section
);
1520 public FieldObservationDetailSection
createFieldObservationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1521 FieldObservationDetailSection section
= new FieldObservationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1522 addAndAdaptSection(parentElement
, section
);
1526 public GatheringEventDetailSection
createGatheringEventDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1527 GatheringEventDetailSection section
= new GatheringEventDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1528 addAndAdaptSection(parentElement
, section
);
1532 public DerivedUnitBaseDetailSection
createDerivedUnitBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1533 DerivedUnitBaseDetailSection section
= new DerivedUnitBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1534 addAndAdaptSection(parentElement
, section
);
1538 public NaturalLanguageSection
createNaturalLanguageSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1539 NaturalLanguageSection section
= new NaturalLanguageSection(this, conversation
, parentElement
, selectionProvider
, style
);
1540 addAndAdaptSection(parentElement
, section
);
1544 public FeatureDistributionDetailSection
createFeatureDistributionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1545 FeatureDistributionDetailSection section
= new FeatureDistributionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1546 addAndAdaptSection(parentElement
, section
);
1550 public ClassificationDetailSection
createClassificationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1551 ClassificationDetailSection section
= new ClassificationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1552 addAndAdaptSection(parentElement
, section
);
1556 public TaxonNodeDetailSection
createTaxonNodeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1557 TaxonNodeDetailSection section
= new TaxonNodeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1558 addAndAdaptSection(parentElement
, section
);
1562 public PolytomousKeyDetailSection
createPolytomousKeyDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1563 PolytomousKeyDetailSection section
= new PolytomousKeyDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1564 addAndAdaptSection(parentElement
, section
);
1568 public PolytomousKeyNodeDetailSection
createPolytomousKeyNodeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1569 PolytomousKeyNodeDetailSection section
= new PolytomousKeyNodeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1570 addAndAdaptSection(parentElement
, section
);
1574 public InstitutionDetailSection
createInstitutionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1575 InstitutionDetailSection section
= new InstitutionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1576 addAndAdaptSection(parentElement
, section
);
1580 public GeneralDetailSection
createGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1581 GeneralDetailSection section
= new GeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1582 addAndAdaptSection(parentElement
, section
);
1586 public HybridDetailSection
createHybridDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1587 HybridDetailSection section
= new HybridDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1588 addAndAdaptSection(parentElement
, section
);
1592 public UserDetailSection
createUserDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1593 UserDetailSection section
= new UserDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1594 addAndAdaptSection(parentElement
, section
);
1598 public GroupDetailSection
createGroupDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1599 GroupDetailSection section
= new GroupDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1600 addAndAdaptSection(parentElement
, section
);
1604 public DeterminationDetailSection
createDeterminationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1605 DeterminationDetailSection section
= new DeterminationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1606 addAndAdaptSection(parentElement
, section
);
1610 public TaxonRelationshipDetailSection
createTaxonRelationshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1611 TaxonRelationshipDetailSection section
= new TaxonRelationshipDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1612 addAndAdaptSection(parentElement
, section
);
1616 public ReferencedEntityDetailSection
createReferencedEntityDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1617 ReferencedEntityDetailSection section
= new ReferencedEntityDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1618 addAndAdaptSection(parentElement
, section
);
1622 public TermVocabularyDetailSection
createTermVocabularyDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1623 TermVocabularyDetailSection section
= new TermVocabularyDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1624 addAndAdaptSection(parentElement
, section
);
1628 public GatheringEventDetailSection
createGatheringSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1629 GatheringEventDetailSection section
= new GatheringEventDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1630 addAndAdaptSection(parentElement
, section
);
1634 public NamedAreaDetailSection
createNamedAreaDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1635 NamedAreaDetailSection section
= new NamedAreaDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1636 addAndAdaptSection(parentElement
, section
);
1640 public UseRecordDetailSection
createUseRecordDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1641 UseRecordDetailSection section
= new UseRecordDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1642 addAndAdaptSection(parentElement
, section
);
1646 private void addAndAdaptSection(ICdmFormElement parentElement
, AbstractFormSection
<?
> section
) {
1647 parentElement
.addElement(section
);
1651 //--------DetailElements------------
1653 public UseRecordDetailElement
createUseRecordDetailElement(ICdmFormElement parentElement
){
1654 UseRecordDetailElement element
= new UseRecordDetailElement(this, parentElement
);
1655 addAndAdaptElement(parentElement
, element
);
1659 public DefinedTermDetailElement
<NamedAreaLevel
> createNamedAreaLevelElement(ICdmFormElement parentElement
){
1660 DefinedTermDetailElement
<NamedAreaLevel
> element
= new DefinedTermDetailElement
<NamedAreaLevel
>(this, parentElement
);
1661 addAndAdaptElement(parentElement
, element
);
1665 public eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement
createNamedAreaDetailElement(ICdmFormElement parentElement
){
1666 eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement element
= new eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement(this, parentElement
);
1667 addAndAdaptElement(parentElement
, element
);
1671 public TermVocabularyDetailElement
createTermVocabularyDetailElement(ICdmFormElement parentElement
){
1672 TermVocabularyDetailElement element
= new TermVocabularyDetailElement(this, parentElement
);
1673 addAndAdaptElement(parentElement
, element
);
1677 public ReferenceEntityDetailElement
createReferenceEntityDetailElement(ICdmFormElement parentElement
){
1678 ReferenceEntityDetailElement element
= new ReferenceEntityDetailElement(this, parentElement
);
1679 addAndAdaptElement(parentElement
, element
);
1683 public TaxonRelationshipDetailElement
createTaxonRelationshipDetailElement(ICdmFormElement parentElement
){
1684 TaxonRelationshipDetailElement element
= new TaxonRelationshipDetailElement(this, parentElement
);
1685 addAndAdaptElement(parentElement
, element
);
1689 public GrantedAuthorityDetailElement
createGrantedAuthorityDetailElement(ICdmFormElement parentElement
){
1690 GrantedAuthorityDetailElement element
= new GrantedAuthorityDetailElement(this, parentElement
);
1691 addAndAdaptElement(parentElement
, element
);
1695 public GroupDetailElement
createGroupDetailElement(ICdmFormElement parentElement
){
1696 GroupDetailElement element
= new GroupDetailElement(this, parentElement
);
1697 addAndAdaptElement(parentElement
, element
);
1701 public UserDetailElement
createUserDetailElement(ICdmFormElement parentElement
){
1702 UserDetailElement element
= new UserDetailElement(this, parentElement
);
1703 addAndAdaptElement(parentElement
, element
);
1707 public HybridDetailElement
createHybridDetailElement(ICdmFormElement parentElement
){
1708 HybridDetailElement element
= new HybridDetailElement(this, parentElement
);
1709 addAndAdaptElement(parentElement
, element
);
1713 public InstitutionDetailElement
createInstitutionDetailElement(ICdmFormElement parentElement
){
1714 InstitutionDetailElement element
= new InstitutionDetailElement(this, parentElement
);
1715 addAndAdaptElement(parentElement
, element
);
1719 public PolytomousKeyNodeDetailElement
createPolytomousKeyNodeDetailElement(ICdmFormElement parentElement
){
1720 PolytomousKeyNodeDetailElement element
= new PolytomousKeyNodeDetailElement(this, parentElement
);
1721 addAndAdaptElement(parentElement
, element
);
1725 public PolytomousKeyDetailElement
createPolytomousKeyDetailElement(ICdmFormElement parentElement
){
1726 PolytomousKeyDetailElement element
= new PolytomousKeyDetailElement(this, parentElement
);
1727 addAndAdaptElement(parentElement
, element
);
1731 public CollectionDetailElement
createCollectionDetailElement(ICdmFormElement parentElement
){
1732 CollectionDetailElement element
= new CollectionDetailElement(this, parentElement
);
1733 addAndAdaptElement(parentElement
, element
);
1737 public TaxonNodeDetailElement
createTaxonNodeDetailElement(ICdmFormElement parentElement
){
1738 TaxonNodeDetailElement element
= new TaxonNodeDetailElement(this, parentElement
);
1739 addAndAdaptElement(parentElement
, element
);
1743 public ClassificationDetailElement
createClassificationDetailElement(ICdmFormElement parentElement
){
1744 ClassificationDetailElement element
= new ClassificationDetailElement(this, parentElement
);
1745 addAndAdaptElement(parentElement
, element
);
1749 public FeatureDistributionDetailElement
createFeatureDistributionDetailElement(ICdmFormElement parentElement
){
1750 FeatureDistributionDetailElement element
= new FeatureDistributionDetailElement(this, parentElement
);
1751 addAndAdaptElement(parentElement
, element
);
1755 public NaturalLanguageDetailElement
createNaturalLanguageDetailElement(ICdmFormElement parentElement
){
1756 NaturalLanguageDetailElement element
= new NaturalLanguageDetailElement(this, parentElement
);
1757 addAndAdaptElement(parentElement
, element
);
1761 public DerivedUnitFacadeDetailElement
createDerivedUnitFacadeDetailElement(ICdmFormElement parentElement
){
1762 DerivedUnitFacadeDetailElement element
= new DerivedUnitFacadeDetailElement(this, parentElement
);
1763 addAndAdaptElement(parentElement
, element
);
1767 public NonViralNameDetailElement
createNonViralNameDetailElement(ICdmFormElement parentElement
){
1768 NonViralNameDetailElement element
= new NonViralNameDetailElement(this, parentElement
);
1769 addAndAdaptElement(parentElement
, element
);
1773 public DescriptionElementDetailElement
createDescriptionElementDetailElement(ICdmFormElement parentElement
, int style
){
1774 DescriptionElementDetailElement element
= new DescriptionElementDetailElement(this, parentElement
, style
);
1775 addAndAdaptElement(parentElement
, element
);
1779 public DescriptionDetailElement
createDescriptionDetailElement(ICdmFormElement parentElement
, int style
){
1780 DescriptionDetailElement element
= new DescriptionDetailElement(this, parentElement
, style
);
1781 addAndAdaptElement(parentElement
, element
);
1785 public PersonDetailElement
createPersonDetailElement(ICdmFormElement parentElement
, int style
){
1786 PersonDetailElement element
= new PersonDetailElement(this, parentElement
, style
);
1787 addAndAdaptElement(parentElement
, element
);
1791 public TeamDetailElement
createTeamDetailElement(ICdmFormElement parentElement
, int style
){
1792 TeamDetailElement element
= new TeamDetailElement(this, parentElement
, style
);
1793 addAndAdaptElement(parentElement
, element
);
1797 public AuthorshipDetailElement
createAuthorshipDetailElement(ICdmFormElement parentElement
, int style
){
1798 AuthorshipDetailElement element
= new AuthorshipDetailElement(this, parentElement
, style
);
1799 addAndAdaptElement(parentElement
, element
);
1803 public TaxonBaseDetailElement
createTaxonBaseDetailElement(ICdmFormElement parentElement
, int style
){
1804 TaxonBaseDetailElement element
= new TaxonBaseDetailElement(this, parentElement
, style
);
1805 addAndAdaptElement(parentElement
, element
);
1809 public NameDetailElement
createNameDetailElement(ICdmFormElement parentElement
, int style
){
1810 NameDetailElement element
= new NameDetailElement(this, parentElement
, style
);
1811 addAndAdaptElement(parentElement
, element
);
1815 public ReferenceDetailElement
createReferenceDetailElement(ICdmFormElement parentElement
, int style
){
1816 ReferenceDetailElement element
= new ReferenceDetailElement(this, parentElement
, style
);
1817 addAndAdaptElement(parentElement
, element
);
1821 public NomenclaturalReferenceDetailElement
createNomenclaturalReferenceDetailElement(ICdmFormElement parentElement
, int style
){
1822 NomenclaturalReferenceDetailElement element
= new NomenclaturalReferenceDetailElement(this, parentElement
, style
);
1823 addAndAdaptElement(parentElement
, element
);
1828 public GeneralDetailElement
createGeneralDetailElement(ICdmFormElement parentElement
){
1829 GeneralDetailElement element
= new GeneralDetailElement(this, parentElement
);
1830 addAndAdaptElement(parentElement
, element
);
1835 public GatheringEventDetailElement
createGatheringEventDetailElement(ICdmFormElement parentElement
) {
1836 GatheringEventDetailElement element
= new GatheringEventDetailElement(this, parentElement
);
1837 addAndAdaptElement(parentElement
, element
);
1841 public FieldObservationDetailElement
createFieldObservationDetailElement(ICdmFormElement parentElement
) {
1842 FieldObservationDetailElement element
= new FieldObservationDetailElement(this, parentElement
);
1843 addAndAdaptElement(parentElement
, element
);
1848 public DerivedUnitBaseDetailElement
createDerivedUnitBaseDetailElement(ICdmFormElement parentElement
) {
1849 DerivedUnitBaseDetailElement element
= new DerivedUnitBaseDetailElement(this, parentElement
);
1850 addAndAdaptElement(parentElement
, element
);
1854 public DeterminationDetailElement
createDeterminationDetailElement(ICdmFormElement parentElement
) {
1855 DeterminationDetailElement element
= new DeterminationDetailElement(this, parentElement
);
1856 addAndAdaptElement(parentElement
, element
);
1861 * @param parentElement
1864 private void addAndAdaptElement(ICdmFormElement parentElement
, AbstractCdmDetailElement
<?
> element
) {
1866 parentElement
.addElement(element
);
1869 //--------EntityCollectionSection----------
1870 public TeamMemberSection
createTeamMemberSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1871 TeamMemberSection section
= new TeamMemberSection(this, conversation
, parentElement
, style
);
1872 addAndAdaptSection(parentElement
, section
);
1876 public AnnotationSection
createAnnotationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1877 AnnotationSection section
= new AnnotationSection(this, conversation
, parentElement
, style
);
1878 addAndAdaptSection(parentElement
, section
);
1882 public CreditSection
createCreditSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1883 CreditSection section
= new CreditSection(this, conversation
, parentElement
, style
);
1884 addAndAdaptSection(parentElement
, section
);
1888 public DescriptionElementSourceSection
createDescriptionElementSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1889 DescriptionElementSourceSection section
= new DescriptionElementSourceSection(this, conversation
, parentElement
, style
);
1890 addAndAdaptSection(parentElement
, section
);
1894 public ExtensionSection
createExtensionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1895 ExtensionSection section
= new ExtensionSection(this, conversation
, parentElement
, style
);
1896 addAndAdaptSection(parentElement
, section
);
1900 public MarkerSection
createMarkerSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1901 MarkerSection section
= new MarkerSection(this, conversation
, parentElement
, style
);
1902 addAndAdaptSection(parentElement
, section
);
1906 public MediaSection
createMediaSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1907 MediaSection section
= new MediaSection(this, conversation
, parentElement
, style
);
1908 addAndAdaptSection(parentElement
, section
);
1912 public DescriptionElementMediaSection
createDescriptionElementMediaSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1913 DescriptionElementMediaSection section
= new DescriptionElementMediaSection(this, conversation
, parentElement
, style
);
1914 addAndAdaptSection(parentElement
, section
);
1918 public MediaRepresentationSection
createMediaRepresentationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1919 MediaRepresentationSection section
= new MediaRepresentationSection(this, conversation
, parentElement
, style
);
1920 addAndAdaptSection(parentElement
, section
);
1924 public MediaRepresentationPartSection
createMediaRepresentationPartSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1925 MediaRepresentationPartSection section
= new MediaRepresentationPartSection(this, conversation
, parentElement
, style
);
1926 addAndAdaptSection(parentElement
, section
);
1930 public ModifierSection
createModifierSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1931 ModifierSection section
= new ModifierSection(this, conversation
, parentElement
, style
);
1932 addAndAdaptSection(parentElement
, section
);
1936 public NomenclaturalStatusSection
createNomenclaturalStatusSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1937 NomenclaturalStatusSection section
= new NomenclaturalStatusSection(this, conversation
, parentElement
, style
);
1938 addAndAdaptSection(parentElement
, section
);
1942 public NameRelationshipDetailSection
createNameRelationshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1943 NameRelationshipDetailSection section
= new NameRelationshipDetailSection(this, conversation
, parentElement
, style
);
1944 addAndAdaptSection(parentElement
, section
);
1948 public ProtologueSection
createProtologueSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1949 ProtologueSection section
= new ProtologueSection(this, conversation
, parentElement
, style
);
1950 addAndAdaptSection(parentElement
, section
);
1954 public RightsSection
createRightsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1955 RightsSection section
= new RightsSection(this, conversation
, parentElement
, style
);
1956 addAndAdaptSection(parentElement
, section
);
1960 public SourceSection
createSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1961 SourceSection section
= new SourceSection(this, conversation
, parentElement
, style
);
1962 addAndAdaptSection(parentElement
, section
);
1966 public ScopeSection
createScopeSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1967 ScopeSection section
= new ScopeSection(this, conversation
, parentElement
, style
);
1968 addAndAdaptSection(parentElement
, section
);
1972 public DescriptionSourceSection
createDescriptionSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1973 DescriptionSourceSection section
= new DescriptionSourceSection(this, conversation
, parentElement
, style
);
1974 addAndAdaptSection(parentElement
, section
);
1978 public TypeDesignationSection
createTypeDesignationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1979 TypeDesignationSection section
= new TypeDesignationSection(this, conversation
, parentElement
, style
);
1980 addAndAdaptSection(parentElement
, section
);
1984 public StateDataSection
createStateDataSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1985 StateDataSection section
= new StateDataSection(this, conversation
, parentElement
, style
);
1986 addAndAdaptSection(parentElement
, section
);
1990 public StatisticalMeasurementValueSection
createStatisticalMeasurementValueSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1991 StatisticalMeasurementValueSection section
= new StatisticalMeasurementValueSection(this, conversation
, parentElement
, style
);
1992 addAndAdaptSection(parentElement
, section
);
1996 public DescribedSpecimenSection
createDescribedSpecimenSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1997 DescribedSpecimenSection section
= new DescribedSpecimenSection(this, conversation
, parentElement
, style
);
1998 addAndAdaptSection(parentElement
, section
);
2002 public CollectingAreasDetailSection
createCollectingAreasDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2003 CollectingAreasDetailSection section
= new CollectingAreasDetailSection(this, conversation
, parentElement
, style
);
2004 addAndAdaptSection(parentElement
, section
);
2008 public CurrentDeterminationDetailSection
createCurrentDeterminationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2009 CurrentDeterminationDetailSection section
= new CurrentDeterminationDetailSection(this, conversation
, parentElement
, style
);
2010 addAndAdaptSection(parentElement
, section
);
2014 public DeterminationHistoryDetailSection
createDeterminationHistoryDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2015 DeterminationHistoryDetailSection section
= new DeterminationHistoryDetailSection(this, conversation
, parentElement
, style
);
2016 addAndAdaptSection(parentElement
, section
);
2020 public SpecimenCollectionDetailSection
createSpecimenCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2021 SpecimenCollectionDetailSection section
= new SpecimenCollectionDetailSection(this, conversation
, parentElement
, style
);
2022 addAndAdaptSection(parentElement
, section
);
2026 public SourceCollectionDetailSection
createSourceCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2027 SourceCollectionDetailSection section
= new SourceCollectionDetailSection(this, conversation
, parentElement
, style
);
2028 addAndAdaptSection(parentElement
, section
);
2032 public GeographicalScopeDetailSection
createGeographicalScopeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2033 GeographicalScopeDetailSection section
= new GeographicalScopeDetailSection(this, conversation
, parentElement
, style
);
2034 addAndAdaptSection(parentElement
, section
);
2038 public ScopeRestrictionSection
createScopeRestrictionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2039 ScopeRestrictionSection section
= new ScopeRestrictionSection(this, conversation
, parentElement
, style
);
2040 addAndAdaptSection(parentElement
, section
);
2044 public MemberDetailSection
createMemberDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2045 MemberDetailSection section
= new MemberDetailSection(this, conversation
, parentElement
, style
);
2046 addAndAdaptSection(parentElement
, section
);
2050 public GrantedAuthorityDetailSection
createGrantedAuthorityDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2051 GrantedAuthorityDetailSection section
= new GrantedAuthorityDetailSection(this, conversation
, parentElement
, style
);
2052 addAndAdaptSection(parentElement
, section
);
2056 public GroupsByUserDetailSection
createGroupsByUserDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2057 GroupsByUserDetailSection section
= new GroupsByUserDetailSection(this, conversation
, parentElement
, style
);
2058 addAndAdaptSection(parentElement
, section
);
2062 public TaxonomicScopeSection
createTaxonomicScopeSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2063 TaxonomicScopeSection section
= new TaxonomicScopeSection(this, conversation
, parentElement
, style
);
2064 addAndAdaptSection(parentElement
, section
);
2070 * createEntityCollectionElement
2073 * @param removeListener
2074 * a {@link org.eclipse.swt.events.SelectionListener} object.
2077 * @param parentElement
2079 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
2081 * @param versionableEntity
2082 * a {@link eu.etaxonomy.cdm.model.common.IVersionableEntity}
2084 * @param backgroundColor
2085 * a {@link org.eclipse.swt.graphics.Color} object.
2087 * {@link eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement}
2090 public AbstractEntityCollectionElement
createEntityCollectionElement(AbstractFormSection parentElement
,
2091 Object versionableEntity
, SelectionListener removeListener
, Color backgroundColor
, int style
) {
2092 AbstractEntityCollectionElement element
= null;
2094 Object entity
= HibernateProxyHelper
.deproxy(versionableEntity
);
2096 if (entity
instanceof Annotation
) {
2097 element
= new AnnotationElement(this, parentElement
, (Annotation
) entity
, removeListener
, style
);
2098 } else if (entity
instanceof Person
) {
2099 element
= new TeamMemberElement(this, parentElement
, (Person
) entity
, removeListener
, style
);
2100 } else if (entity
instanceof Credit
) {
2101 element
= new CreditElement(this, parentElement
, (Credit
) entity
, removeListener
, style
);
2102 } else if (entity
instanceof Extension
) {
2103 element
= new ExtensionElement(this, parentElement
, (Extension
) entity
, removeListener
, style
);
2104 } else if (entity
instanceof Marker
) {
2105 element
= new MarkerElement(this, parentElement
, (Marker
) entity
, removeListener
, style
);
2106 } else if (entity
instanceof Media
) {
2107 element
= new MediaElement(this, parentElement
, (Media
) entity
, removeListener
, style
);
2108 } else if (entity
instanceof MediaRepresentation
) {
2109 element
= new MediaRepresentationElement(this, parentElement
, (MediaRepresentation
) entity
, removeListener
,
2111 } else if (entity
instanceof ImageFile
) {
2112 element
= new ImageFileElement(this, parentElement
, (ImageFile
) entity
, removeListener
, style
);
2113 } else if (entity
instanceof MediaRepresentationPart
) {
2114 element
= new MediaRepresentationPartElement(this, parentElement
, (MediaRepresentationPart
) entity
,
2115 removeListener
, style
);
2116 } else if (entity
instanceof NomenclaturalStatus
) {
2117 element
= new NomenclaturalStatusElement(this, parentElement
, (NomenclaturalStatus
) entity
, removeListener
,
2119 } else if (entity
instanceof Rights
) {
2120 element
= new RightsElement(this, parentElement
, (Rights
) entity
, removeListener
, style
);
2121 } else if (entity
instanceof DescriptionElementSource
) {
2122 element
= new DescriptionElementSourceElement(this, parentElement
, (DescriptionElementSource
) entity
,
2123 removeListener
, style
);
2124 } else if (entity
instanceof IdentifiableSource
) {
2125 element
= new IdentifiableSourceElement(this, parentElement
, (IdentifiableSource
) entity
, removeListener
,
2127 } else if (entity
instanceof DefinedTerm
) {
2128 switch(((DefinedTerm
)entity
).getTermType()) {
2130 element
= new ScopeElement(this,
2132 (DefinedTerm
) entity
,
2137 element
= new ModifierElement(this,
2139 (DefinedTerm
) entity
,
2144 //FIXME : Actually we should through an exception here
2149 } else if (entity
instanceof Reference
) {
2150 element
= new DescriptionSourceElement(this, parentElement
, (Reference
) entity
, removeListener
, style
);
2151 } else if (entity
instanceof NameTypeDesignation
) {
2152 element
= new NameTypeDesignationElement(this, parentElement
, (NameTypeDesignation
) entity
, removeListener
,
2154 } else if (entity
instanceof NameRelationship
) {
2155 element
= new NameRelationshipDetailElement(this, parentElement
, (NameRelationship
) entity
, removeListener
,
2157 } else if (entity
instanceof SpecimenTypeDesignation
) {
2158 element
= new SpecimenTypeDesignationElement(this, parentElement
, (SpecimenTypeDesignation
) entity
,
2159 removeListener
, style
);
2160 } else if (entity
instanceof StateData
) {
2161 element
= new StateDataElement(this, parentElement
, (StateData
) entity
, removeListener
, style
);
2162 } else if (entity
instanceof StatisticalMeasurementValue
) {
2163 element
= new StatisticalMeasurementValueElement(this, parentElement
, (StatisticalMeasurementValue
) entity
,
2164 removeListener
, style
);
2165 } else if (entity
instanceof DerivedUnit
) {
2166 switch(((DerivedUnit
)entity
).getRecordBasis()) {
2167 case LivingSpecimen
:
2168 case PreservedSpecimen
:
2170 element
= new SpecimenCollectionDetailElement(this,
2172 (DerivedUnit
) entity
,
2177 element
= new DerivedUnitElement(this,
2179 (DerivedUnit
) entity
,
2184 } else if (entity
instanceof NamedArea
) {
2185 element
= new NamedAreaDetailElement(this, parentElement
, (NamedArea
) entity
, removeListener
, style
);
2186 } else if (entity
instanceof DeterminationEvent
) {
2187 element
= new DeterminationEventDetailElement(this, parentElement
, (DeterminationEvent
) entity
, removeListener
, style
);
2188 } else if (entity
instanceof User
) {
2189 element
= new MemberDetailElement(this, parentElement
, (User
) entity
, removeListener
, style
);
2190 } else if (entity
instanceof GrantedAuthority
) {
2191 element
= new GrantedAuthorityCollectionElement(this, parentElement
, (GrantedAuthorityImpl
) entity
,
2192 removeListener
, style
);
2193 } else if (entity
instanceof Group
) {
2194 element
= new GroupsByUserDetailElement(this, parentElement
, (Group
) entity
, removeListener
, style
);
2195 } else if (entity
instanceof Taxon
) {
2196 element
= new TaxonDetailElement(this, parentElement
, (Taxon
) entity
, removeListener
, style
);
2197 } else if (entity
instanceof DescriptionElementBase
) {
2198 // this is the special case for protologs, maybe we can do this
2199 // differently when API improves
2200 DescriptionElementBase descriptionElement
= (DescriptionElementBase
) entity
;
2201 if (descriptionElement
.getFeature().equals(Feature
.PROTOLOGUE())) {
2202 element
= new ProtologueElement(this, parentElement
, descriptionElement
, removeListener
, style
);
2206 if (element
== null) {
2207 AbstractUtility
.errorDialog("No element for entity", this,
2208 "Could not generate element for entity. Looks like the case is not handled already. Check implementation. Entity: "
2212 else if (backgroundColor
!= null && !backgroundColor
.isDisposed()) {
2213 element
.setPersistentBackground(backgroundColor
);
2215 parentElement
.addElement(element
);
2221 public void createNamedAreaFieldController(AbstractFormSection parentElement
, NamedArea namedArea
, SelectionListener removeListener
){
2222 // Object entity = HibernateProxyHelper.deproxy(versionableEntity); TODO deproxy necessary??
2223 NamedAreaFieldController element
= new NamedAreaFieldController(this, parentElement
, namedArea
, removeListener
, SWT
.NONE
);
2225 parentElement
.addElement(element
);
2230 * Creates a selection element for the given type T.
2233 * <strong>Selection elements not handled by this method:</strong>
2235 * <li>{@link TaxonNodeSelectionElement} see
2236 * {@link #createTaxonNodeSelectionElement(ConversationHolder, ICdmFormElement, String, TaxonNode, int, int)}
2238 * <li>{@link NomenclaturalAuthorTeamSelectionElement} see
2239 * {@link #createNomenclaturalAuthorTeamSelectionElement(ConversationHolder, ICdmFormElement, String, Team, int, int)}
2245 * a {@link Class} object of the type that you want the selection
2247 * @param parentElement
2248 * a {@link ICdmFormElement} object.
2249 * @param labelString
2250 * a {@link String} object.
2251 * @param selectionType
2253 * a {@link ICdmBase} object.
2256 * @param conversation
2257 * a {@link ConversationHolder} object.
2258 * @return a {@link EntitySelectionElement} object.
2260 public <T
extends ICdmBase
> EntitySelectionElement
<T
> createSelectionElement(Class
<T
> clazz
,
2261 ConversationHolder conversation
, ICdmFormElement parentElement
, String labelString
, T selection
, int mode
,
2263 EntitySelectionElement
<T
> element
= new EntitySelectionElement
<T
>(this, conversation
, parentElement
, clazz
,
2264 labelString
, selection
, mode
, style
);
2266 parentElement
.addElement(element
);
2270 public TaxonNodeSelectionElement
createTaxonNodeSelectionElement(ConversationHolder conversation
,
2271 ICdmFormElement parentElement
, String labelString
, TaxonNode selection
, int mode
, int style
) {
2272 TaxonNodeSelectionElement element
= new TaxonNodeSelectionElement(this, conversation
, parentElement
,
2273 labelString
, selection
, mode
, style
);
2275 parentElement
.addElement(element
);
2279 public NomenclaturalAuthorTeamSelectionElement
createNomenclaturalAuthorTeamSelectionElement(
2280 ConversationHolder conversation
, ICdmFormElement parentElement
, String labelString
, Team selection
,
2281 int mode
, int style
) {
2282 NomenclaturalAuthorTeamSelectionElement element
= new NomenclaturalAuthorTeamSelectionElement(this,
2283 conversation
, parentElement
, labelString
, selection
, mode
, style
);
2285 parentElement
.addElement(element
);
2289 /** {@inheritDoc} */
2290 public LabelElement
createLabel(ICdmFormElement parentElement
, String text
) {
2291 LabelElement labelElement
= new LabelElement(this, parentElement
, text
);
2292 adapt(labelElement
);
2293 parentElement
.addElement(labelElement
);
2294 return labelElement
;
2299 * Getter for the field <code>selectionProvider</code>.
2302 * @return a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
2304 public ISelectionProvider
getSelectionProvider() {
2305 return selectionProvider
;
2310 * createDetailedDescriptionDetailElement
2313 * @param parentElement
2314 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
2318 * {@link eu.etaxonomy.cdm.model.description.DescriptionElementBase}
2323 * {@link eu.etaxonomy.taxeditor.ui.section.description.detail.AbstractDetailedDescriptionDetailElement}
2326 public AbstractDetailedDescriptionDetailElement
createDetailedDescriptionDetailElement(
2327 ICdmFormElement parentElement
, DescriptionElementBase entity
, int style
) {
2328 AbstractDetailedDescriptionDetailElement detailedDescriptionElement
= null;
2330 if (entity
instanceof CategoricalData
) {
2331 detailedDescriptionElement
= new CategoricalDataDetailElement(this, parentElement
,
2332 (CategoricalData
) entity
, style
);
2333 } else if (entity
instanceof CommonTaxonName
) {
2334 detailedDescriptionElement
= new CommonNameDetailElement(this, parentElement
, (CommonTaxonName
) entity
,
2336 } else if (entity
instanceof Distribution
) {
2337 detailedDescriptionElement
= new DistributionDetailElement(this, parentElement
, (Distribution
) entity
,
2339 } else if (entity
instanceof IndividualsAssociation
) {
2340 detailedDescriptionElement
= new IndividualsAssociationDetailElement(this, parentElement
,
2341 (IndividualsAssociation
) entity
, style
);
2342 } else if (entity
instanceof QuantitativeData
) {
2343 detailedDescriptionElement
= new QuantitativeDataDetailElement(this, parentElement
,
2344 (QuantitativeData
) entity
, style
);
2345 } else if (entity
instanceof TaxonInteraction
) {
2346 detailedDescriptionElement
= new TaxonInteractionDetailElement(this, parentElement
,
2347 (TaxonInteraction
) entity
, style
);
2348 } else if (entity
instanceof TextData
) {
2349 detailedDescriptionElement
= new TextDataDetailElement(this, parentElement
, (TextData
) entity
, style
);
2351 throw new IllegalStateException("There is no interface for the given description element");
2353 adapt(detailedDescriptionElement
);
2354 parentElement
.addElement(detailedDescriptionElement
);
2355 return detailedDescriptionElement
;
2360 * Creates a styled text as a part of the form.
2365 * the text initial value
2368 * @return the text widget
2370 public StyledText
createStyledText(Composite parent
, String value
, int style
) {
2371 StyledText text
= new StyledText(parent
, getBorderStyle() | style
| getOrientation());
2372 if (value
!= null) {
2373 text
.setText(value
);
2375 text
.setForeground(getColors().getForeground());
2376 text
.setBackground(getColors().getBackground());
2377 // text.addFocusListener(visibilityHandler);
2384 * @param conversationHolder
2386 * @param detailsViewer
2390 public FieldObservationGeneralSection
createFieldObservationGeneralSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
2391 FieldObservationGeneralSection section
= new FieldObservationGeneralSection(this, conversation
, parentElement
, selectionProvider
, style
);
2392 addAndAdaptSection(parentElement
, section
);
2396 * @param conversationHolder
2398 * @param detailsViewer
2402 public GatheringEventSection
createGatheringEventSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
2403 GatheringEventSection section
= new GatheringEventSection(this, conversation
, parentElement
, selectionProvider
, style
);
2404 addAndAdaptSection(parentElement
, section
);
2408 * @param conversationHolder
2410 * @param detailsViewer
2414 public FieldObservationDetailsSection
createFieldObservationDetailsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
2415 FieldObservationDetailsSection section
= new FieldObservationDetailsSection(this, conversation
, parentElement
, selectionProvider
, style
);
2416 addAndAdaptSection(parentElement
, section
);
2421 * @param conversationHolder
2423 * @param detailsViewer
2427 public SpecimenSection
createSpecimenSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
2428 SpecimenSection section
= new SpecimenSection(this, conversation
, parentElement
, selectionProvider
, style
);
2429 addAndAdaptSection(parentElement
, section
);
2433 public SpecimenGeneralElementController
createSpecimenGeneralElementController(ICdmFormElement parentElement
){
2434 SpecimenGeneralElement specimenGeneralElement
= new SpecimenGeneralElement(parentElement
.getLayoutComposite(), SWT
.NONE
);
2435 specimenGeneralElement
.setLayoutData(LayoutConstants
.FILL_HORIZONTALLY(2,1));
2436 SpecimenGeneralElementController element
= new SpecimenGeneralElementController(specimenGeneralElement
, this, parentElement
);
2437 addAndAdaptElement(parentElement
, element
);
2441 public FieldObservationGeneralElementController
createFieldObservationGeneralElementController(ICdmFormElement parentElement
){
2442 FieldObservationGeneralElement fieldObservationGeneralElement
= new FieldObservationGeneralElement(parentElement
.getLayoutComposite(), SWT
.NONE
);
2443 fieldObservationGeneralElement
.setLayoutData(LayoutConstants
.FILL_HORIZONTALLY(2,1));
2444 FieldObservationGeneralElementController element
= new FieldObservationGeneralElementController(fieldObservationGeneralElement
, this, parentElement
);
2445 addAndAdaptElement(parentElement
, element
);
2449 public GatheringEventDetailsElementController
createGatheringEventDetailsElementController(ICdmFormElement parentElement
) {
2450 GatheringEventDetailsElement gatheringEventDetailsElement
= new GatheringEventDetailsElement(parentElement
.getLayoutComposite(), SWT
.NONE
);
2451 gatheringEventDetailsElement
.setLayoutData(LayoutConstants
.FILL_HORIZONTALLY(2,1));
2452 GatheringEventDetailsElementController element
= new GatheringEventDetailsElementController(gatheringEventDetailsElement
, this, parentElement
);
2454 parentElement
.addElement(element
);
2458 public FieldObservationDetailsElementController
createFieldObservationDetailsElementController(ICdmFormElement parentElement
) {
2459 FieldObservationDetailsElement fieldObservationDetailsElement
= new FieldObservationDetailsElement(parentElement
.getLayoutComposite(), SWT
.NONE
);
2460 fieldObservationDetailsElement
.setLayoutData(LayoutConstants
.FILL_HORIZONTALLY(2,1));
2461 FieldObservationDetailsElementController element
= new FieldObservationDetailsElementController(fieldObservationDetailsElement
, this, parentElement
);
2462 addAndAdaptElement(parentElement
, element
);