4 package eu
.etaxonomy
.taxeditor
.ui
.element
;
7 import java
.util
.ArrayList
;
8 import java
.util
.HashSet
;
13 import org
.eclipse
.jface
.util
.IPropertyChangeListener
;
14 import org
.eclipse
.jface
.viewers
.ISelection
;
15 import org
.eclipse
.jface
.viewers
.ISelectionProvider
;
16 import org
.eclipse
.jface
.window
.Window
;
17 import org
.eclipse
.swt
.SWT
;
18 import org
.eclipse
.swt
.custom
.StyledText
;
19 import org
.eclipse
.swt
.events
.FocusAdapter
;
20 import org
.eclipse
.swt
.events
.FocusEvent
;
21 import org
.eclipse
.swt
.events
.FocusListener
;
22 import org
.eclipse
.swt
.events
.MouseAdapter
;
23 import org
.eclipse
.swt
.events
.MouseEvent
;
24 import org
.eclipse
.swt
.events
.MouseListener
;
25 import org
.eclipse
.swt
.events
.SelectionEvent
;
26 import org
.eclipse
.swt
.events
.SelectionListener
;
27 import org
.eclipse
.swt
.events
.TypedEvent
;
28 import org
.eclipse
.swt
.graphics
.Color
;
29 import org
.eclipse
.swt
.graphics
.Font
;
30 import org
.eclipse
.swt
.widgets
.Composite
;
31 import org
.eclipse
.swt
.widgets
.Control
;
32 import org
.eclipse
.swt
.widgets
.Display
;
33 import org
.eclipse
.swt
.widgets
.Event
;
34 import org
.eclipse
.swt
.widgets
.Label
;
35 import org
.eclipse
.ui
.forms
.IFormColors
;
36 import org
.eclipse
.ui
.forms
.widgets
.ExpandableComposite
;
37 import org
.eclipse
.ui
.forms
.widgets
.FormToolkit
;
38 import org
.eclipse
.ui
.forms
.widgets
.Section
;
39 import org
.eclipse
.ui
.internal
.forms
.widgets
.FormFonts
;
40 import org
.joda
.time
.Partial
;
41 import org
.springframework
.security
.core
.GrantedAuthority
;
43 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
44 import eu
.etaxonomy
.cdm
.api
.facade
.DerivedUnitFacade
;
45 import eu
.etaxonomy
.cdm
.hibernate
.HibernateProxyHelper
;
46 import eu
.etaxonomy
.cdm
.model
.agent
.Person
;
47 import eu
.etaxonomy
.cdm
.model
.agent
.Team
;
48 import eu
.etaxonomy
.cdm
.model
.common
.Annotation
;
49 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
50 import eu
.etaxonomy
.cdm
.model
.common
.Credit
;
51 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTerm
;
52 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTermBase
;
53 import eu
.etaxonomy
.cdm
.model
.common
.Extension
;
54 import eu
.etaxonomy
.cdm
.model
.common
.GrantedAuthorityImpl
;
55 import eu
.etaxonomy
.cdm
.model
.common
.Group
;
56 import eu
.etaxonomy
.cdm
.model
.common
.ICdmBase
;
57 import eu
.etaxonomy
.cdm
.model
.common
.IEnumTerm
;
58 import eu
.etaxonomy
.cdm
.model
.common
.IdentifiableSource
;
59 import eu
.etaxonomy
.cdm
.model
.common
.Language
;
60 import eu
.etaxonomy
.cdm
.model
.common
.LanguageString
;
61 import eu
.etaxonomy
.cdm
.model
.common
.Marker
;
62 import eu
.etaxonomy
.cdm
.model
.common
.TermType
;
63 import eu
.etaxonomy
.cdm
.model
.common
.TimePeriod
;
64 import eu
.etaxonomy
.cdm
.model
.common
.User
;
65 import eu
.etaxonomy
.cdm
.model
.common
.VersionableEntity
;
66 import eu
.etaxonomy
.cdm
.model
.description
.CategoricalData
;
67 import eu
.etaxonomy
.cdm
.model
.description
.CommonTaxonName
;
68 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionElementBase
;
69 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionElementSource
;
70 import eu
.etaxonomy
.cdm
.model
.description
.Distribution
;
71 import eu
.etaxonomy
.cdm
.model
.description
.Feature
;
72 import eu
.etaxonomy
.cdm
.model
.description
.IndividualsAssociation
;
73 import eu
.etaxonomy
.cdm
.model
.description
.KeyStatement
;
74 import eu
.etaxonomy
.cdm
.model
.description
.QuantitativeData
;
75 import eu
.etaxonomy
.cdm
.model
.description
.StateData
;
76 import eu
.etaxonomy
.cdm
.model
.description
.StatisticalMeasurementValue
;
77 import eu
.etaxonomy
.cdm
.model
.description
.TaxonInteraction
;
78 import eu
.etaxonomy
.cdm
.model
.description
.TextData
;
79 import eu
.etaxonomy
.cdm
.model
.location
.NamedArea
;
80 import eu
.etaxonomy
.cdm
.model
.location
.NamedAreaLevel
;
81 import eu
.etaxonomy
.cdm
.model
.location
.Point
;
82 import eu
.etaxonomy
.cdm
.model
.media
.ImageFile
;
83 import eu
.etaxonomy
.cdm
.model
.media
.Media
;
84 import eu
.etaxonomy
.cdm
.model
.media
.MediaRepresentation
;
85 import eu
.etaxonomy
.cdm
.model
.media
.MediaRepresentationPart
;
86 import eu
.etaxonomy
.cdm
.model
.media
.Rights
;
87 import eu
.etaxonomy
.cdm
.model
.name
.NameRelationship
;
88 import eu
.etaxonomy
.cdm
.model
.name
.NameTypeDesignation
;
89 import eu
.etaxonomy
.cdm
.model
.name
.NomenclaturalStatus
;
90 import eu
.etaxonomy
.cdm
.model
.name
.SpecimenTypeDesignation
;
91 import eu
.etaxonomy
.cdm
.model
.occurrence
.DerivedUnit
;
92 import eu
.etaxonomy
.cdm
.model
.occurrence
.DeterminationEvent
;
93 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
94 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
95 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonNode
;
96 import eu
.etaxonomy
.cdm
.strategy
.parser
.ParserProblem
;
97 import eu
.etaxonomy
.taxeditor
.model
.AbstractUtility
;
98 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.basicFields
.NamedAreaFieldController
;
99 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.compatibility
.ICdmFormElement
;
100 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.fieldObservation
.FieldObservationDetailsElement
;
101 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.fieldObservation
.FieldObservationDetailsElementController
;
102 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.fieldObservation
.FieldObservationDetailsSection
;
103 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.fieldObservation
.FieldObservationGeneralElement
;
104 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.fieldObservation
.FieldObservationGeneralElementController
;
105 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.fieldObservation
.FieldObservationGeneralSection
;
106 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.fieldObservation
.GatheringEventDetailsElement
;
107 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.fieldObservation
.GatheringEventDetailsElementController
;
108 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.fieldObservation
.GatheringEventSection
;
109 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.specimen
.DerivedUnitDetailsElement
;
110 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.specimen
.DerivedUnitDetailsElementController
;
111 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.specimen
.DerivedUnitDetailsSection
;
112 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.specimen
.SpecimenDetailsElement
;
113 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.specimen
.SpecimenDetailsElementController
;
114 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.specimen
.SpecimenDetailsSection
;
115 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.specimen
.SpecimenGeneralSection
;
116 import eu
.etaxonomy
.taxeditor
.ui
.combo
.EnumComboElement
;
117 import eu
.etaxonomy
.taxeditor
.ui
.combo
.TermComboElement
;
118 import eu
.etaxonomy
.taxeditor
.ui
.element
.MinMaxTextSection
.UnitType
;
119 import eu
.etaxonomy
.taxeditor
.ui
.openurl
.IOpenUrlEnabled
;
120 import eu
.etaxonomy
.taxeditor
.ui
.openurl
.OpenUrlSelectorElement
;
121 import eu
.etaxonomy
.taxeditor
.ui
.password
.EditPasswordElement
;
122 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailElement
;
123 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailSection
;
124 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionElement
;
125 import eu
.etaxonomy
.taxeditor
.ui
.section
.EmptyElement
;
126 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.InstitutionDetailElement
;
127 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.InstitutionDetailSection
;
128 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailElement
;
129 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailSection
;
130 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailElement
;
131 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailSection
;
132 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamMemberElement
;
133 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamMemberSection
;
134 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamOrPersonBaseDetailSection
;
135 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.ClassificationDetailElement
;
136 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.ClassificationDetailSection
;
137 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.TaxonNodeDetailElement
;
138 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.TaxonNodeDetailSection
;
139 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferenceEntityDetailElement
;
140 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferencedEntityDetailSection
;
141 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DerivedUnitElement
;
142 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescribedSpecimenSection
;
143 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailElement
;
144 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailSection
;
145 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailElement
;
146 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailSection
;
147 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementMediaSection
;
148 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceElement
;
149 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceSection
;
150 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceElement
;
151 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceSection
;
152 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.MediaDetailsSection
;
153 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ModifierElement
;
154 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ModifierSection
;
155 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageDetailElement
;
156 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageSection
;
157 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeElement
;
158 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeSection
;
159 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StateDataElement
;
160 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StateDataSection
;
161 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StatisticalMeasurementValueElement
;
162 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StatisticalMeasurementValueSection
;
163 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.AbstractDetailedDescriptionDetailElement
;
164 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.CategoricalDataDetailElement
;
165 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.CommonNameDetailElement
;
166 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.DistributionDetailElement
;
167 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.IndividualsAssociationDetailElement
;
168 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.QuantitativeDataDetailElement
;
169 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.TaxonInteractionDetailElement
;
170 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.TextDataDetailElement
;
171 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailElement
;
172 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailSection
;
173 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityCollectionElement
;
174 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailElement
;
175 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailSection
;
176 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailElement
;
177 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailSection
;
178 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailElement
;
179 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailSection
;
180 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.GeographicalScopeDetailSection
;
181 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailElement
;
182 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailSection
;
183 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailElement
;
184 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailSection
;
185 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.ScopeRestrictionSection
;
186 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.TaxonomicScopeSection
;
187 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.ImageFileElement
;
188 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaElement
;
189 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationElement
;
190 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationPartElement
;
191 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationPartSection
;
192 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationSection
;
193 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaSection
;
194 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.AuthorshipDetailElement
;
195 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.AuthorshipDetailSection
;
196 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.HybridDetailElement
;
197 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.HybridDetailSection
;
198 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameDetailElement
;
199 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameDetailSection
;
200 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailElement
;
201 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailSection
;
202 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameTypeDesignationElement
;
203 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusElement
;
204 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusSection
;
205 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailElement
;
206 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailSection
;
207 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.ProtologueElement
;
208 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.ProtologueSection
;
209 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.SpecimenTypeDesignationElement
;
210 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.TypeDesignationSection
;
211 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CollectingAreasDetailSection
;
212 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CollectionDetailElement
;
213 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CurrentDeterminationDetailSection
;
214 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitBaseDetailElement
;
215 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitBaseDetailSection
;
216 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitFacadeDetailElement
;
217 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitFacadeDetailSection
;
218 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailElement
;
219 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailSection
;
220 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationEventDetailElement
;
221 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationHistoryDetailSection
;
222 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldObservationDetailElement
;
223 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldObservationDetailSection
;
224 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailElement
;
225 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailSection
;
226 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GeneralDetailElement
;
227 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GeneralDetailSection
;
228 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.NamedAreaDetailElement
;
229 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SourceCollectionDetailSection
;
230 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SpecimenCollectionDetailElement
;
231 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SpecimenCollectionDetailSection
;
232 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailElement
;
233 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailSection
;
234 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailElement
;
235 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailSection
;
236 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.AnnotationElement
;
237 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.AnnotationSection
;
238 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CdmBaseElement
;
239 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CdmBaseSection
;
240 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CreditElement
;
241 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CreditSection
;
242 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.ExtensionElement
;
243 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.ExtensionSection
;
244 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.HeadlineSection
;
245 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.IdentifiableSourceElement
;
246 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.MarkerElement
;
247 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.MarkerSection
;
248 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.RightsElement
;
249 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.RightsSection
;
250 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.SourceSection
;
251 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.VersionElement
;
252 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.VersionSection
;
253 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessageElement
;
254 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessagesSection
;
255 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailElement
;
256 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailSection
;
257 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonDetailElement
;
258 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailElement
;
259 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailSection
;
260 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailElement
;
261 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailSection
;
262 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailElement
;
263 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailSection
;
264 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailElement
;
265 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailSection
;
266 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.DefinedTermDetailElement
;
267 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.DefinedTermDetailSection
;
268 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailSection
;
269 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailElement
;
270 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailSection
;
271 import eu
.etaxonomy
.taxeditor
.ui
.selection
.EntitySelectionElement
;
272 import eu
.etaxonomy
.taxeditor
.ui
.selection
.NomenclaturalAuthorTeamSelectionElement
;
273 import eu
.etaxonomy
.taxeditor
.ui
.selection
.TaxonNodeSelectionElement
;
277 * CdmFormFactory class.
281 * @created Feb 24, 2010
284 public class CdmFormFactory
extends FormToolkit
{
286 private BoldFontHolder2 boldFontHolder2
;
287 private MouseListener selectionMouseHandler
;
288 private FocusListener selectionFocusHandler
;
290 private final Set
<SelectionListener
> selectionListenerList
= new HashSet
<SelectionListener
>();
292 private final List
<IPropertyChangeListener
> propertyChangeListeners
= new ArrayList
<IPropertyChangeListener
>();
294 private final int orientation
= Window
.getDefaultOrientation();
295 private ISelectionProvider selectionProvider
;
297 /** Constant <code>EMPTY_SELECTION</code> */
298 public static ISelection EMPTY_SELECTION
= new ISelection() {
300 public boolean isEmpty() {
311 private class SelectionMouseHandler
extends MouseAdapter
{
313 public void mouseDown(MouseEvent e
) {
314 notifySelectionListeners(e
);
324 private class SelectionFocusHandler
extends FocusAdapter
{
326 public void focusGained(FocusEvent e
) {
327 notifySelectionListeners(e
);
331 private void notifySelectionListeners(TypedEvent e
) {
332 Event event
= new Event();
333 event
.widget
= e
.widget
;
334 SelectionEvent selectionEvent
= new SelectionEvent(event
);
336 for (SelectionListener listener
: selectionListenerList
) {
337 listener
.widgetSelected(selectionEvent
);
343 * Constructor for CdmFormFactory.
347 * a {@link org.eclipse.swt.widgets.Display} object.
348 * @param selectionProvider
349 * a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
351 public CdmFormFactory(Display display
, ISelectionProvider selectionProvider
) {
353 this.selectionProvider
= selectionProvider
;
359 * Constructor for CdmFormFactory.
363 * a {@link org.eclipse.swt.widgets.Display} object.
365 public CdmFormFactory(Display display
) {
373 private void init() {
374 boldFontHolder2
= new BoldFontHolder2();
375 selectionMouseHandler
= new SelectionMouseHandler();
376 selectionFocusHandler
= new SelectionFocusHandler();
380 * Creates an instance initialized with the correct selectionProvider
382 * Make sure to remove the instance when the entityComposite disposes via
383 * destroySelectionArbitrator(..)
385 * @param entityElement
386 * a {@link eu.etaxonomy.taxeditor.ui.element.IEntityElement}
388 * @return a {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator}
391 public SelectionArbitrator
createSelectionArbitrator(IEntityElement entityElement
) {
392 SelectionArbitrator selectionArbitrator
= new SelectionArbitrator(entityElement
);
393 selectionArbitrator
.addSelectionProvider(selectionProvider
);
394 selectionProvider
.addSelectionChangedListener(selectionArbitrator
);
395 addSelectionListener(selectionArbitrator
);
396 return selectionArbitrator
;
401 * destroySelectionArbitrator
404 * @param selectionArbitrator
406 * {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator}
409 public void destroySelectionArbitrator(SelectionArbitrator selectionArbitrator
) {
410 removeSelectionListener(selectionArbitrator
);
411 if (selectionProvider
!= null) {
412 selectionProvider
.removeSelectionChangedListener(selectionArbitrator
);
414 AbstractUtility
.error(this.getClass(),
415 "Tried to destroy a selection listener from this factories listeners but was null", null);
421 * Adapts the {@link AbstractCdmFormElement}:<br>
422 * - sets the {@link IPropertyChangeListener}s handled by this class
427 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement}
430 public void adapt(AbstractCdmFormElement formElement
) {
431 formElement
.setPropertyChangeListeners(propertyChangeListeners
);
436 public void adapt(Control control
, boolean trackFocus
, boolean trackKeyboard
) {
438 control
.addFocusListener(selectionFocusHandler
);
440 super.adapt(control
, trackFocus
, trackKeyboard
);
445 public void adapt(Composite composite
) {
446 composite
.addMouseListener(selectionMouseHandler
);
447 super.adapt(composite
);
456 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
459 public void destroyElement(ICdmFormElement formElement
) {
460 // return if element was not initialized
461 if (formElement
== null) {
464 // destroy selection arbitrator, if any
465 if (formElement
instanceof ISelectableElement
) {
466 destroySelectionArbitrator(((ISelectableElement
) formElement
).getSelectionArbitrator());
468 // remove this element form its parents list of elements
469 // ICdmFormElement parentElement = formElement.getParentElement();
470 // if(parentElement != null){
471 // parentElement.removeElement(formElement);
473 // call destroy on child elements recursively
474 for (ICdmFormElement childElement
: formElement
.getElements()) {
475 destroyElement(childElement
);
477 // dispose of the controls
478 for (Control control
: formElement
.getControls()) {
479 // we added the layoutComposite of the parental element as the
480 // layout composite to this formElement
481 // but we do not want to destroy it.
482 if (control
.equals(formElement
.getLayoutComposite())) {
497 * a {@link org.eclipse.swt.widgets.Composite} object.
498 * @return a {@link org.eclipse.swt.widgets.Label} object.
500 public Label
createEmptyCell(Composite parent
) {
501 return this.createLabel(parent
, null);
506 * createMultilineTextWithLabel
510 * a {@link java.lang.String} object.
515 * @param parentElement
516 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
518 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
521 public TextWithLabelElement
createMultilineTextWithLabel(ICdmFormElement parentElement
, String labelString
,
522 int textHeight
, int style
) {
523 TextWithLabelElement element
= new TextWithLabelElement(this, parentElement
, labelString
, "", textHeight
, style
);
525 parentElement
.addElement(element
);
531 * createMultiLanguageTextElement
534 * @param parentElement
535 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
538 * a {@link java.lang.String} object.
539 * @param multilanguageText
540 * a {@link java.util.Map} object.
546 * {@link eu.etaxonomy.taxeditor.ui.element.MultilanguageTextElement}
549 public MultilanguageTextElement
createMultiLanguageTextElement(ICdmFormElement parentElement
, String labelString
,
550 Map
<Language
, LanguageString
> multilanguageText
, int textHeight
, int style
) {
551 MultilanguageTextElement element
= new MultilanguageTextElement(this, parentElement
, labelString
,
552 multilanguageText
, textHeight
, style
);
554 parentElement
.addElement(element
);
558 public KeyStatementElement
createKeyStatementElement(ICdmFormElement parentElement
, String labelString
,
559 KeyStatement keyStatement
, int textHeight
, int style
) {
560 KeyStatementElement element
= new KeyStatementElement(this, parentElement
, labelString
, keyStatement
,
563 parentElement
.addElement(element
);
569 * createTextWithLabelElement
573 * a {@link java.lang.String} object.
575 * a {@link java.lang.String} object.
578 * @param parentElement
579 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
581 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
584 public TextWithLabelElement
createTextWithLabelElement(ICdmFormElement parentElement
, String labelString
,
585 String initialText
, int style
) {
586 TextWithLabelElement element
= new TextWithLabelElement(this, parentElement
, labelString
, initialText
, null,
589 parentElement
.addElement(element
);
593 public UriWithLabelElement
createUriWithLabelElement(ICdmFormElement parentElement
, String labelString
,
594 URI initialUri
, int style
) {
595 UriWithLabelElement element
= new UriWithLabelElement(this, parentElement
, labelString
, initialUri
, null, style
);
597 parentElement
.addElement(element
);
608 public OpenUrlSelectorElement
createOpenUrlSelectorElement(ICdmFormElement parentElement
, String labelString
,
609 IOpenUrlEnabled openUrlEnabled
, int style
) {
610 OpenUrlSelectorElement element
= new OpenUrlSelectorElement(this, parentElement
, labelString
, openUrlEnabled
,
613 parentElement
.addElement(element
);
619 * @param parentElement
621 * @param conversationEnabled
626 public EditPasswordElement
createEditPasswordElement(ICdmFormElement parentElement
, String labelString
,
627 ConversationHolder conversation
, User user
, int style
) {
628 EditPasswordElement element
= new EditPasswordElement(this, parentElement
, labelString
, user
, conversation
);
630 parentElement
.addElement(element
);
636 * createIntegerTextWithLabelElement
639 * @param parentElement
640 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
643 * a {@link java.lang.String} object.
644 * @param initialInteger
645 * a {@link java.lang.Integer} object.
649 * {@link eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement}
652 public NumberWithLabelElement
createNumberTextWithLabelElement(
653 ICdmFormElement parentElement
, String labelString
,
654 Number initialNumber
, int style
) {
655 NumberWithLabelElement element
= new NumberWithLabelElement(this,
656 parentElement
, labelString
, initialNumber
, style
);
658 parentElement
.addElement(element
);
664 * createLanguageStringWithLabelElement
667 * @param parentElement
668 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
671 * a {@link java.lang.String} object.
672 * @param languageString
673 * a {@link eu.etaxonomy.cdm.model.common.LanguageString} object.
677 * {@link eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement}
680 public LanguageStringWithLabelElement
createLanguageStringWithLabelElement(ICdmFormElement parentElement
,
681 String labelString
, LanguageString languageString
, int style
) {
682 LanguageStringWithLabelElement element
= new LanguageStringWithLabelElement(this, parentElement
, labelString
,
683 languageString
, style
);
685 parentElement
.addElement(element
);
691 * createLanguageStringWithLabelElement
694 * @param parentElement
695 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
698 * a {@link java.lang.String} object.
699 * @param languageString
700 * a {@link eu.etaxonomy.cdm.model.common.LanguageString} object.
706 * {@link eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement}
709 public LanguageStringWithLabelElement
createLanguageStringWithLabelElement(ICdmFormElement parentElement
,
710 String labelString
, LanguageString languageString
, int height
, int style
) {
711 LanguageStringWithLabelElement element
= new LanguageStringWithLabelElement(this, parentElement
, labelString
,
712 languageString
, height
, style
);
714 parentElement
.addElement(element
);
723 * @param parentElement
724 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
727 * a {@link java.lang.String} object.
730 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
733 public TextWithLabelElement
createTextElement(ICdmFormElement parentElement
, String initialText
, int style
) {
734 TextWithLabelElement element
= new TextWithLabelElement(this, parentElement
, null, initialText
, null, style
);
736 parentElement
.addElement(element
);
742 * createKeyValueViewerElement
745 * @param parentElement
746 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
749 * a {@link java.lang.String} object.
750 * @param valueHeading
751 * a {@link java.lang.String} object.
753 * a {@link java.util.Map} object.
754 * @return a {@link eu.etaxonomy.taxeditor.ui.element.KeyValueViewerElement}
757 public KeyValueViewerElement
createKeyValueViewerElement(ICdmFormElement parentElement
, String keyHeading
,
758 String valueHeading
, Map
<Object
, Object
> map
) {
759 KeyValueViewerElement element
= new KeyValueViewerElement(this, parentElement
, keyHeading
, valueHeading
, map
);
761 parentElement
.addElement(element
);
767 * createTermComboElement
770 * @param termComboType
772 * {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.TermComboType}
774 * @param parentElement
775 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
778 * a {@link java.lang.String} object.
780 * a {@link eu.etaxonomy.cdm.model.common.DefinedTermBase}
784 * @return a {@link eu.etaxonomy.taxeditor.ui.combo.TermComboElement}
788 public <T
extends DefinedTermBase
> TermComboElement
<T
> createTermComboElement(Class
<T
> termComboType
,
789 ICdmFormElement parentElement
, String labelString
, T selection
, int style
) {
790 TermComboElement
<T
> element
= new TermComboElement
<T
>(this, parentElement
, termComboType
, labelString
,
793 parentElement
.addElement(element
);
799 * createTermComboElement
802 * @param termComboType
804 * {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.TermComboType}
806 * @param parentElement
807 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
810 * a {@link java.lang.String} object.
812 * a {@link eu.etaxonomy.cdm.model.common.DefinedTermBase}
816 * @return a {@link eu.etaxonomy.taxeditor.ui.combo.TermComboElement}
820 public <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
822 ICdmFormElement parentElement
,
826 TermComboElement
<T
> element
= new TermComboElement
<T
>(this, parentElement
, termType
, labelString
, selection
, style
);
828 parentElement
.addElement(element
);
834 * createEnumComboElement
837 * @param enumComboType
839 * {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EnumComboType}
841 * @param parentElement
842 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
846 * @return a {@link eu.etaxonomy.taxeditor.ui.term.AbstractEnumComboElement}
849 public <T
extends IEnumTerm
> EnumComboElement
<T
> createEnumComboElement(
850 Class
<T
> enumComboType
, ICdmFormElement parentElement
,
852 EnumComboElement
<T
> element
= new EnumComboElement
<T
>(this, parentElement
, enumComboType
, style
);
854 parentElement
.addElement(element
);
860 * createBrowserElement
864 * a {@link java.net.URI} object.
867 * @param parentElement
868 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
870 * @return a {@link eu.etaxonomy.taxeditor.ui.element.BrowserElement}
873 public BrowserElement
createBrowserElement(ICdmFormElement parentElement
, URI imageUri
, int style
) {
874 BrowserElement element
= new BrowserElement(this, parentElement
, imageUri
, style
);
876 parentElement
.addElement(element
);
885 * @param parentElement
886 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
889 * a {@link java.net.URI} object.
892 * @return a {@link eu.etaxonomy.taxeditor.ui.element.ImageElement} object.
894 public ImageElement
createImageElement(ICdmFormElement parentElement
, URI imageUri
, int style
) {
895 ImageElement element
= new ImageElement(this, parentElement
, imageUri
, style
);
897 parentElement
.addElement(element
);
903 * createTextActionElement
907 * a {@link java.lang.String} object.
909 * a {@link java.lang.String} object.
912 * @param parentElement
913 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
916 * a {@link java.lang.String} object.
917 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextActionElement}
920 public TextActionElement
createTextActionElement(ICdmFormElement parentElement
, String labelString
,
921 String buttonLabel
, String initialText
, int style
) {
922 TextActionElement element
= new TextActionElement(this, parentElement
, labelString
, buttonLabel
, initialText
,
925 parentElement
.addElement(element
);
934 * @param parentElement
935 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
938 * a {@link java.lang.String} object.
939 * @param initialState
943 * @return a {@link eu.etaxonomy.taxeditor.ui.element.CheckboxElement}
946 public CheckboxElement
createCheckbox(ICdmFormElement parentElement
, String label
, boolean initialState
, int style
) {
947 CheckboxElement element
= new CheckboxElement(this, parentElement
, label
, initialState
, style
| orientation
);
949 parentElement
.addElement(element
);
954 * Creates a section as a part of the form.
956 * @return the section widget
959 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
962 public Section
adapt(AbstractFormSection section
) {
963 section
.setMenu(section
.getLayoutComposite().getMenu());
964 adapt(section
, true, true);
966 // handle focus and property change events for cdm use
967 section
.addFocusListener(selectionFocusHandler
);
968 section
.setPropertyChangeListeners(propertyChangeListeners
);
970 if (section
.getToggle() != null) {
971 section
.getToggle().setHoverDecorationColor(getColors().getColor(IFormColors
.TB_TOGGLE_HOVER
));
972 section
.getToggle().setDecorationColor(getColors().getColor(IFormColors
.TB_TOGGLE
));
975 section
.setFont(boldFontHolder2
.getBoldFont(section
.getLayoutComposite().getFont()));
977 if ((section
.getStyle() & ExpandableComposite
.TITLE_BAR
) != 0
978 || (section
.getStyle() & ExpandableComposite
.SHORT_TITLE_BAR
) != 0) {
979 getColors().initializeSectionToolBarColors();
980 section
.setTitleBarBackground(getColors().getColor(IFormColors
.TB_BG
));
981 section
.setTitleBarBorderColor(getColors().getColor(IFormColors
.TB_BORDER
));
983 // call setTitleBarForeground regardless as it also sets the label color
984 section
.setTitleBarForeground(getColors().getColor(IFormColors
.TB_TOGGLE
));
988 private class BoldFontHolder2
{
989 private Font normalFont
;
991 private Font boldFont
;
993 public BoldFontHolder2() {
996 public Font
getBoldFont(Font font
) {
997 createBoldFont(font
);
1001 private void createBoldFont(Font font
) {
1002 if (normalFont
== null || !normalFont
.equals(font
)) {
1006 if (boldFont
== null) {
1007 boldFont
= FormFonts
.getInstance().getBoldFont(getColors().getDisplay(), normalFont
);
1011 public void dispose() {
1012 if (boldFont
!= null) {
1013 FormFonts
.getInstance().markFinished(boldFont
, getColors().getDisplay());
1021 * createToggleableTextField
1024 * @param parentElement
1025 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1027 * @param labelString
1028 * a {@link java.lang.String} object.
1029 * @param initialText
1030 * a {@link java.lang.String} object.
1031 * @param initialState
1035 * @return a {@link eu.etaxonomy.taxeditor.ui.element.ToggleableTextElement}
1038 public ToggleableTextElement
createToggleableTextField(ICdmFormElement parentElement
, String labelString
,
1039 String initialText
, boolean initialState
, int style
) {
1040 ToggleableTextElement element
= new ToggleableTextElement(this, parentElement
, labelString
, initialText
,
1041 initialState
, style
| orientation
);
1043 parentElement
.addElement(element
);
1049 * createTimePeriodElement
1052 * @param parentElement
1053 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1055 * @param labelString
1056 * a {@link java.lang.String} object.
1058 * a {@link eu.etaxonomy.cdm.model.common.TimePeriod} object.
1061 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TimePeriodElement}
1064 public TimePeriodElement
createTimePeriodElement(ICdmFormElement parentElement
, String labelString
,
1065 TimePeriod timePeriod
, int style
) {
1066 TimePeriodElement element
= new TimePeriodElement(this, parentElement
, labelString
, timePeriod
, style
);
1068 parentElement
.addElement(element
);
1074 * createGatheringEventUnitElement
1077 * @param parentElement
1078 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1080 * @param labelString
1081 * a {@link java.lang.String} object.
1083 * a {@link eu.etaxonomy.cdm.model.common.GatheringEvent} object.
1086 * @return a {@link eu.etaxonomy.taxeditor.ui.element.GatheringEventUnitElement}
1089 public GatheringEventUnitElement
createGatheringEventUnitElement(
1090 ICdmFormElement parentElement
,
1092 DerivedUnitFacade gatheringEvent
,
1093 MinMaxTextSection
.UnitType unitType
,
1095 GatheringEventUnitElement element
= new GatheringEventUnitElement(this,
1102 parentElement
.addElement(element
);
1108 * createPointElement
1113 * @param parentElement
1114 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1117 * a {@link eu.etaxonomy.cdm.model.location.Point} object.
1118 * @return a {@link eu.etaxonomy.taxeditor.ui.element.PointElement} object.
1120 public PointElement
createPointElement(ICdmFormElement parentElement
, Point point
, int style
) {
1121 PointElement element
= new PointElement(this, parentElement
, point
, style
);
1123 parentElement
.addElement(element
);
1129 * createDateDetailSection
1132 * @param parentElement
1133 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1137 * @return a {@link eu.etaxonomy.taxeditor.ui.element.DateDetailSection}
1140 public DateDetailSection
createDateDetailSection(ICdmFormElement parentElement
, int style
) {
1141 DateDetailSection section
= new DateDetailSection(this, parentElement
, style
);
1142 parentElement
.addElement(section
);
1149 * createDateDetailSection
1152 * @param parentElement
1153 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1157 * @return a {@link eu.etaxonomy.taxeditor.ui.element.MinMaxTextSection}
1160 public MinMaxTextSection
createMinMaxTextSection(ICdmFormElement parentElement
, UnitType unitType
, int style
) {
1161 MinMaxTextSection section
= new MinMaxTextSection(this, parentElement
, unitType
, style
);
1162 parentElement
.addElement(section
);
1169 * createPartialElement
1172 * @param parentElement
1173 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1175 * @param labelString
1176 * a {@link java.lang.String} object.
1178 * a {@link org.joda.time.Partial} object.
1181 * @return a {@link eu.etaxonomy.taxeditor.ui.element.PartialElement}
1184 public PartialElement
createPartialElement(ICdmFormElement parentElement
, String labelString
, Partial partial
,
1186 PartialElement element
= new PartialElement(this, parentElement
, labelString
, style
);
1188 parentElement
.addElement(element
);
1194 * addSelectionListener
1198 * a {@link org.eclipse.swt.events.SelectionListener} object.
1200 public void addSelectionListener(SelectionListener listener
) {
1201 selectionListenerList
.add(listener
);
1206 * removeSelectionListener
1210 * a {@link org.eclipse.swt.events.SelectionListener} object.
1212 public void removeSelectionListener(SelectionListener listener
) {
1213 if (listener
== null) {
1214 AbstractUtility
.error(this.getClass(),
1215 "Tried to remove a selection listener from this factories listeners but was null", null);
1217 selectionListenerList
.remove(listener
);
1223 * addPropertyChangeListener
1227 * a {@link org.eclipse.jface.util.IPropertyChangeListener}
1230 public void addPropertyChangeListener(IPropertyChangeListener listener
) {
1231 if (propertyChangeListeners
.contains(listener
)) {
1234 propertyChangeListeners
.add(0, listener
);
1239 * removePropertyChangeListener
1243 * a {@link org.eclipse.jface.util.IPropertyChangeListener}
1246 public void removePropertyChangeListener(IPropertyChangeListener listener
) {
1247 propertyChangeListeners
.remove(listener
);
1251 * @return the propertyChangeListeners
1253 public List
<IPropertyChangeListener
> getPropertyChangeListeners() {
1254 return propertyChangeListeners
;
1259 * createHorizontalSeparator
1262 * @param parentElement
1263 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1267 * @return a {@link org.eclipse.swt.widgets.Label} object.
1269 public Label
createHorizontalSeparator(ICdmFormElement parentElement
, int style
) {
1270 Label separator
= this.createSeparator(parentElement
.getLayoutComposite(), SWT
.HORIZONTAL
| style
);
1271 separator
.setLayoutData(LayoutConstants
.FILL_HORIZONTALLY());
1277 * createVersionElement
1280 * @param parentElement
1281 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1284 * a {@link eu.etaxonomy.cdm.model.common.VersionableEntity}
1289 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.VersionElement}
1292 public VersionElement
createVersionElement(ICdmFormElement parentElement
, VersionableEntity entity
, int style
) {
1293 VersionElement element
= new VersionElement(this, parentElement
, entity
, style
);
1295 parentElement
.addElement(element
);
1300 * @param cdmBaseSection
1305 public CdmBaseElement
createCdmBaseElement(ICdmFormElement parentElement
, CdmBase entity
, int style
) {
1306 CdmBaseElement element
= new CdmBaseElement(this, parentElement
, entity
, style
);
1308 parentElement
.addElement(element
);
1314 * createVersionSection
1317 * @param parentElement
1318 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1323 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.VersionSection}
1326 public VersionSection
createVersionSection(ICdmFormElement parentElement
, int style
) {
1327 VersionSection section
= new VersionSection(this, parentElement
, style
);
1328 parentElement
.addElement(section
);
1338 public CdmBaseSection
createCdmBaseSection(ICdmFormElement parentElement
, int style
) {
1339 CdmBaseSection section
= new CdmBaseSection(this, parentElement
, style
);
1340 parentElement
.addElement(section
);
1347 * createEmptyElement
1350 * @param parentElement
1351 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1353 * @return a {@link eu.etaxonomy.taxeditor.ui.section.EmptyElement} object.
1355 public EmptyElement
createEmptyElement(ICdmFormElement parentElement
) {
1356 EmptyElement element
= new EmptyElement(this, parentElement
, null, SWT
.NULL
);
1358 parentElement
.addElement(element
);
1364 * createHeadlineSection
1367 * @param parentElement
1368 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1371 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.HeadlineSection}
1374 public HeadlineSection
createHeadlineSection(ICdmFormElement parentElement
) {
1375 HeadlineSection section
= new HeadlineSection(this, parentElement
, SWT
.NULL
);
1376 parentElement
.addElement(section
);
1383 * createParsingMessageElement
1386 * @param parentElement
1387 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1389 * @param parserProblem
1390 * a {@link eu.etaxonomy.cdm.strategy.parser.ParserProblem}
1395 * {@link eu.etaxonomy.taxeditor.ui.section.taxon.ParsingMessageElement}
1398 public ParsingMessageElement
createParsingMessageElement(ICdmFormElement parentElement
,
1399 ParserProblem parserProblem
, int style
) {
1400 ParsingMessageElement element
= new ParsingMessageElement(this, parentElement
, parserProblem
, style
);
1402 parentElement
.addElement(element
);
1406 public AbstractFormSection
createDefinedTermDetailSection(Class definedTermClass
, ConversationHolder conversation
,
1407 ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
1409 AbstractFormSection section
= new DefinedTermDetailSection(this, definedTermClass
, conversation
, parentElement
,
1410 selectionProvider
, style
);
1412 parentElement
.addElement(section
);
1419 * @param definedTermClass
1420 * @param formElement
1424 public AbstractCdmDetailElement
createDefinedTermDetailElement(Class definedTermClass
, AbstractCdmDetailSection parentElement
, int style
) {
1425 AbstractCdmDetailElement element
= null;
1427 if (NamedArea
.class.isAssignableFrom(definedTermClass
)) {
1428 element
= new eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement(this, parentElement
);
1430 element
= new DefinedTermDetailElement(this, parentElement
);
1434 parentElement
.addElement(element
);
1439 //--------DetailSections---------
1440 public NameDetailSection
createNameDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1441 NameDetailSection section
= new NameDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1442 addAndAdaptSection(parentElement
, section
);
1446 public ReferenceDetailSection
createReferenceDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1447 ReferenceDetailSection section
= new ReferenceDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1448 addAndAdaptSection(parentElement
, section
);
1452 public NomenclaturalReferenceDetailSection
createNomenclaturalReferenceDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1453 NomenclaturalReferenceDetailSection section
= new NomenclaturalReferenceDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1454 addAndAdaptSection(parentElement
, section
);
1458 public TaxonBaseDetailSection
createTaxonBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1459 TaxonBaseDetailSection section
= new TaxonBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1460 addAndAdaptSection(parentElement
, section
);
1464 public AuthorshipDetailSection
createAuthorshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1465 AuthorshipDetailSection section
= new AuthorshipDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1466 addAndAdaptSection(parentElement
, section
);
1470 public TeamOrPersonBaseDetailSection
createTeamOrPersonBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1471 TeamOrPersonBaseDetailSection section
= new TeamOrPersonBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1472 addAndAdaptSection(parentElement
, section
);
1476 public TeamDetailSection
createTeamDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1477 TeamDetailSection section
= new TeamDetailSection(this, conversation
, parentElement
, null, style
);
1478 addAndAdaptSection(parentElement
, section
);
1482 public PersonDetailSection
createPersonDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1483 PersonDetailSection section
= new PersonDetailSection(this, conversation
, parentElement
, null, style
);
1484 addAndAdaptSection(parentElement
, section
);
1488 public DescriptionDetailSection
createDescriptionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1489 DescriptionDetailSection section
= new DescriptionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1490 addAndAdaptSection(parentElement
, section
);
1494 public DescriptionElementDetailSection
createDescriptionElementDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1495 DescriptionElementDetailSection section
= new DescriptionElementDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1496 addAndAdaptSection(parentElement
, section
);
1500 public ParsingMessagesSection
createParsingMessagesSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1501 ParsingMessagesSection section
= new ParsingMessagesSection(this, conversation
, parentElement
, selectionProvider
, style
);
1502 addAndAdaptSection(parentElement
, section
);
1506 public NonViralNameDetailSection
createNonViralNameDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1507 NonViralNameDetailSection section
= new NonViralNameDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1508 addAndAdaptSection(parentElement
, section
);
1512 public MediaDetailsSection
createMediaDetailsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1513 MediaDetailsSection section
= new MediaDetailsSection(this, conversation
, parentElement
, selectionProvider
, style
);
1514 addAndAdaptSection(parentElement
, section
);
1518 public DerivedUnitFacadeDetailSection
createDerivedUnitFacadeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1519 DerivedUnitFacadeDetailSection section
= new DerivedUnitFacadeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1520 addAndAdaptSection(parentElement
, section
);
1524 public FieldObservationDetailSection
createFieldObservationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1525 FieldObservationDetailSection section
= new FieldObservationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1526 addAndAdaptSection(parentElement
, section
);
1530 public GatheringEventDetailSection
createGatheringEventDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1531 GatheringEventDetailSection section
= new GatheringEventDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1532 addAndAdaptSection(parentElement
, section
);
1536 public DerivedUnitBaseDetailSection
createDerivedUnitBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1537 DerivedUnitBaseDetailSection section
= new DerivedUnitBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1538 addAndAdaptSection(parentElement
, section
);
1542 public NaturalLanguageSection
createNaturalLanguageSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1543 NaturalLanguageSection section
= new NaturalLanguageSection(this, conversation
, parentElement
, selectionProvider
, style
);
1544 addAndAdaptSection(parentElement
, section
);
1548 public FeatureDistributionDetailSection
createFeatureDistributionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1549 FeatureDistributionDetailSection section
= new FeatureDistributionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1550 addAndAdaptSection(parentElement
, section
);
1554 public ClassificationDetailSection
createClassificationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1555 ClassificationDetailSection section
= new ClassificationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1556 addAndAdaptSection(parentElement
, section
);
1560 public TaxonNodeDetailSection
createTaxonNodeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1561 TaxonNodeDetailSection section
= new TaxonNodeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1562 addAndAdaptSection(parentElement
, section
);
1566 public PolytomousKeyDetailSection
createPolytomousKeyDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1567 PolytomousKeyDetailSection section
= new PolytomousKeyDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1568 addAndAdaptSection(parentElement
, section
);
1572 public PolytomousKeyNodeDetailSection
createPolytomousKeyNodeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1573 PolytomousKeyNodeDetailSection section
= new PolytomousKeyNodeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1574 addAndAdaptSection(parentElement
, section
);
1578 public InstitutionDetailSection
createInstitutionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1579 InstitutionDetailSection section
= new InstitutionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1580 addAndAdaptSection(parentElement
, section
);
1584 public GeneralDetailSection
createGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1585 GeneralDetailSection section
= new GeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1586 addAndAdaptSection(parentElement
, section
);
1590 public HybridDetailSection
createHybridDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1591 HybridDetailSection section
= new HybridDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1592 addAndAdaptSection(parentElement
, section
);
1596 public UserDetailSection
createUserDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1597 UserDetailSection section
= new UserDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1598 addAndAdaptSection(parentElement
, section
);
1602 public GroupDetailSection
createGroupDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1603 GroupDetailSection section
= new GroupDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1604 addAndAdaptSection(parentElement
, section
);
1608 public DeterminationDetailSection
createDeterminationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1609 DeterminationDetailSection section
= new DeterminationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1610 addAndAdaptSection(parentElement
, section
);
1614 public TaxonRelationshipDetailSection
createTaxonRelationshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1615 TaxonRelationshipDetailSection section
= new TaxonRelationshipDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1616 addAndAdaptSection(parentElement
, section
);
1620 public ReferencedEntityDetailSection
createReferencedEntityDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1621 ReferencedEntityDetailSection section
= new ReferencedEntityDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1622 addAndAdaptSection(parentElement
, section
);
1626 public TermVocabularyDetailSection
createTermVocabularyDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1627 TermVocabularyDetailSection section
= new TermVocabularyDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1628 addAndAdaptSection(parentElement
, section
);
1632 public GatheringEventDetailSection
createGatheringSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1633 GatheringEventDetailSection section
= new GatheringEventDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1634 addAndAdaptSection(parentElement
, section
);
1638 public NamedAreaDetailSection
createNamedAreaDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1639 NamedAreaDetailSection section
= new NamedAreaDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1640 addAndAdaptSection(parentElement
, section
);
1644 public UseRecordDetailSection
createUseRecordDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1645 UseRecordDetailSection section
= new UseRecordDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1646 addAndAdaptSection(parentElement
, section
);
1650 private void addAndAdaptSection(ICdmFormElement parentElement
, AbstractFormSection
<?
> section
) {
1651 parentElement
.addElement(section
);
1655 //--------DetailElements------------
1657 public UseRecordDetailElement
createUseRecordDetailElement(ICdmFormElement parentElement
){
1658 UseRecordDetailElement element
= new UseRecordDetailElement(this, parentElement
);
1659 addAndAdaptElement(parentElement
, element
);
1663 public DefinedTermDetailElement
<NamedAreaLevel
> createNamedAreaLevelElement(ICdmFormElement parentElement
){
1664 DefinedTermDetailElement
<NamedAreaLevel
> element
= new DefinedTermDetailElement
<NamedAreaLevel
>(this, parentElement
);
1665 addAndAdaptElement(parentElement
, element
);
1669 public eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement
createNamedAreaDetailElement(ICdmFormElement parentElement
){
1670 eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement element
= new eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement(this, parentElement
);
1671 addAndAdaptElement(parentElement
, element
);
1675 public TermVocabularyDetailElement
createTermVocabularyDetailElement(ICdmFormElement parentElement
){
1676 TermVocabularyDetailElement element
= new TermVocabularyDetailElement(this, parentElement
);
1677 addAndAdaptElement(parentElement
, element
);
1681 public ReferenceEntityDetailElement
createReferenceEntityDetailElement(ICdmFormElement parentElement
){
1682 ReferenceEntityDetailElement element
= new ReferenceEntityDetailElement(this, parentElement
);
1683 addAndAdaptElement(parentElement
, element
);
1687 public TaxonRelationshipDetailElement
createTaxonRelationshipDetailElement(ICdmFormElement parentElement
){
1688 TaxonRelationshipDetailElement element
= new TaxonRelationshipDetailElement(this, parentElement
);
1689 addAndAdaptElement(parentElement
, element
);
1693 public GrantedAuthorityDetailElement
createGrantedAuthorityDetailElement(ICdmFormElement parentElement
){
1694 GrantedAuthorityDetailElement element
= new GrantedAuthorityDetailElement(this, parentElement
);
1695 addAndAdaptElement(parentElement
, element
);
1699 public GroupDetailElement
createGroupDetailElement(ICdmFormElement parentElement
){
1700 GroupDetailElement element
= new GroupDetailElement(this, parentElement
);
1701 addAndAdaptElement(parentElement
, element
);
1705 public UserDetailElement
createUserDetailElement(ICdmFormElement parentElement
){
1706 UserDetailElement element
= new UserDetailElement(this, parentElement
);
1707 addAndAdaptElement(parentElement
, element
);
1711 public HybridDetailElement
createHybridDetailElement(ICdmFormElement parentElement
){
1712 HybridDetailElement element
= new HybridDetailElement(this, parentElement
);
1713 addAndAdaptElement(parentElement
, element
);
1717 public InstitutionDetailElement
createInstitutionDetailElement(ICdmFormElement parentElement
){
1718 InstitutionDetailElement element
= new InstitutionDetailElement(this, parentElement
);
1719 addAndAdaptElement(parentElement
, element
);
1723 public PolytomousKeyNodeDetailElement
createPolytomousKeyNodeDetailElement(ICdmFormElement parentElement
){
1724 PolytomousKeyNodeDetailElement element
= new PolytomousKeyNodeDetailElement(this, parentElement
);
1725 addAndAdaptElement(parentElement
, element
);
1729 public PolytomousKeyDetailElement
createPolytomousKeyDetailElement(ICdmFormElement parentElement
){
1730 PolytomousKeyDetailElement element
= new PolytomousKeyDetailElement(this, parentElement
);
1731 addAndAdaptElement(parentElement
, element
);
1735 public CollectionDetailElement
createCollectionDetailElement(ICdmFormElement parentElement
){
1736 CollectionDetailElement element
= new CollectionDetailElement(this, parentElement
);
1737 addAndAdaptElement(parentElement
, element
);
1741 public TaxonNodeDetailElement
createTaxonNodeDetailElement(ICdmFormElement parentElement
){
1742 TaxonNodeDetailElement element
= new TaxonNodeDetailElement(this, parentElement
);
1743 addAndAdaptElement(parentElement
, element
);
1747 public ClassificationDetailElement
createClassificationDetailElement(ICdmFormElement parentElement
){
1748 ClassificationDetailElement element
= new ClassificationDetailElement(this, parentElement
);
1749 addAndAdaptElement(parentElement
, element
);
1753 public FeatureDistributionDetailElement
createFeatureDistributionDetailElement(ICdmFormElement parentElement
){
1754 FeatureDistributionDetailElement element
= new FeatureDistributionDetailElement(this, parentElement
);
1755 addAndAdaptElement(parentElement
, element
);
1759 public NaturalLanguageDetailElement
createNaturalLanguageDetailElement(ICdmFormElement parentElement
){
1760 NaturalLanguageDetailElement element
= new NaturalLanguageDetailElement(this, parentElement
);
1761 addAndAdaptElement(parentElement
, element
);
1765 public DerivedUnitFacadeDetailElement
createDerivedUnitFacadeDetailElement(ICdmFormElement parentElement
){
1766 DerivedUnitFacadeDetailElement element
= new DerivedUnitFacadeDetailElement(this, parentElement
);
1767 addAndAdaptElement(parentElement
, element
);
1771 public NonViralNameDetailElement
createNonViralNameDetailElement(ICdmFormElement parentElement
){
1772 NonViralNameDetailElement element
= new NonViralNameDetailElement(this, parentElement
);
1773 addAndAdaptElement(parentElement
, element
);
1777 public DescriptionElementDetailElement
createDescriptionElementDetailElement(ICdmFormElement parentElement
, int style
){
1778 DescriptionElementDetailElement element
= new DescriptionElementDetailElement(this, parentElement
, style
);
1779 addAndAdaptElement(parentElement
, element
);
1783 public DescriptionDetailElement
createDescriptionDetailElement(ICdmFormElement parentElement
, int style
){
1784 DescriptionDetailElement element
= new DescriptionDetailElement(this, parentElement
, style
);
1785 addAndAdaptElement(parentElement
, element
);
1789 public PersonDetailElement
createPersonDetailElement(ICdmFormElement parentElement
, int style
){
1790 PersonDetailElement element
= new PersonDetailElement(this, parentElement
, style
);
1791 addAndAdaptElement(parentElement
, element
);
1795 public TeamDetailElement
createTeamDetailElement(ICdmFormElement parentElement
, int style
){
1796 TeamDetailElement element
= new TeamDetailElement(this, parentElement
, style
);
1797 addAndAdaptElement(parentElement
, element
);
1801 public AuthorshipDetailElement
createAuthorshipDetailElement(ICdmFormElement parentElement
, int style
){
1802 AuthorshipDetailElement element
= new AuthorshipDetailElement(this, parentElement
, style
);
1803 addAndAdaptElement(parentElement
, element
);
1807 public TaxonBaseDetailElement
createTaxonBaseDetailElement(ICdmFormElement parentElement
, int style
){
1808 TaxonBaseDetailElement element
= new TaxonBaseDetailElement(this, parentElement
, style
);
1809 addAndAdaptElement(parentElement
, element
);
1813 public NameDetailElement
createNameDetailElement(ICdmFormElement parentElement
, int style
){
1814 NameDetailElement element
= new NameDetailElement(this, parentElement
, style
);
1815 addAndAdaptElement(parentElement
, element
);
1819 public ReferenceDetailElement
createReferenceDetailElement(ICdmFormElement parentElement
, int style
){
1820 ReferenceDetailElement element
= new ReferenceDetailElement(this, parentElement
, style
);
1821 addAndAdaptElement(parentElement
, element
);
1825 public NomenclaturalReferenceDetailElement
createNomenclaturalReferenceDetailElement(ICdmFormElement parentElement
, int style
){
1826 NomenclaturalReferenceDetailElement element
= new NomenclaturalReferenceDetailElement(this, parentElement
, style
);
1827 addAndAdaptElement(parentElement
, element
);
1832 public GeneralDetailElement
createGeneralDetailElement(ICdmFormElement parentElement
){
1833 GeneralDetailElement element
= new GeneralDetailElement(this, parentElement
);
1834 addAndAdaptElement(parentElement
, element
);
1839 public GatheringEventDetailElement
createGatheringEventDetailElement(ICdmFormElement parentElement
) {
1840 GatheringEventDetailElement element
= new GatheringEventDetailElement(this, parentElement
);
1841 addAndAdaptElement(parentElement
, element
);
1845 public FieldObservationDetailElement
createFieldObservationDetailElement(ICdmFormElement parentElement
) {
1846 FieldObservationDetailElement element
= new FieldObservationDetailElement(this, parentElement
);
1847 addAndAdaptElement(parentElement
, element
);
1852 public DerivedUnitBaseDetailElement
createDerivedUnitBaseDetailElement(ICdmFormElement parentElement
) {
1853 DerivedUnitBaseDetailElement element
= new DerivedUnitBaseDetailElement(this, parentElement
);
1854 addAndAdaptElement(parentElement
, element
);
1858 public DeterminationDetailElement
createDeterminationDetailElement(ICdmFormElement parentElement
) {
1859 DeterminationDetailElement element
= new DeterminationDetailElement(this, parentElement
);
1860 addAndAdaptElement(parentElement
, element
);
1865 * @param parentElement
1868 private void addAndAdaptElement(ICdmFormElement parentElement
, AbstractCdmDetailElement
<?
> element
) {
1870 parentElement
.addElement(element
);
1873 //--------EntityCollectionSection----------
1874 public TeamMemberSection
createTeamMemberSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1875 TeamMemberSection section
= new TeamMemberSection(this, conversation
, parentElement
, style
);
1876 addAndAdaptSection(parentElement
, section
);
1880 public AnnotationSection
createAnnotationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1881 AnnotationSection section
= new AnnotationSection(this, conversation
, parentElement
, style
);
1882 addAndAdaptSection(parentElement
, section
);
1886 public CreditSection
createCreditSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1887 CreditSection section
= new CreditSection(this, conversation
, parentElement
, style
);
1888 addAndAdaptSection(parentElement
, section
);
1892 public DescriptionElementSourceSection
createDescriptionElementSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1893 DescriptionElementSourceSection section
= new DescriptionElementSourceSection(this, conversation
, parentElement
, style
);
1894 addAndAdaptSection(parentElement
, section
);
1898 public ExtensionSection
createExtensionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1899 ExtensionSection section
= new ExtensionSection(this, conversation
, parentElement
, style
);
1900 addAndAdaptSection(parentElement
, section
);
1904 public MarkerSection
createMarkerSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1905 MarkerSection section
= new MarkerSection(this, conversation
, parentElement
, style
);
1906 addAndAdaptSection(parentElement
, section
);
1910 public MediaSection
createMediaSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1911 MediaSection section
= new MediaSection(this, conversation
, parentElement
, style
);
1912 addAndAdaptSection(parentElement
, section
);
1916 public DescriptionElementMediaSection
createDescriptionElementMediaSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1917 DescriptionElementMediaSection section
= new DescriptionElementMediaSection(this, conversation
, parentElement
, style
);
1918 addAndAdaptSection(parentElement
, section
);
1922 public MediaRepresentationSection
createMediaRepresentationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1923 MediaRepresentationSection section
= new MediaRepresentationSection(this, conversation
, parentElement
, style
);
1924 addAndAdaptSection(parentElement
, section
);
1928 public MediaRepresentationPartSection
createMediaRepresentationPartSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1929 MediaRepresentationPartSection section
= new MediaRepresentationPartSection(this, conversation
, parentElement
, style
);
1930 addAndAdaptSection(parentElement
, section
);
1934 public ModifierSection
createModifierSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1935 ModifierSection section
= new ModifierSection(this, conversation
, parentElement
, style
);
1936 addAndAdaptSection(parentElement
, section
);
1940 public NomenclaturalStatusSection
createNomenclaturalStatusSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1941 NomenclaturalStatusSection section
= new NomenclaturalStatusSection(this, conversation
, parentElement
, style
);
1942 addAndAdaptSection(parentElement
, section
);
1946 public NameRelationshipDetailSection
createNameRelationshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1947 NameRelationshipDetailSection section
= new NameRelationshipDetailSection(this, conversation
, parentElement
, style
);
1948 addAndAdaptSection(parentElement
, section
);
1952 public ProtologueSection
createProtologueSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1953 ProtologueSection section
= new ProtologueSection(this, conversation
, parentElement
, style
);
1954 addAndAdaptSection(parentElement
, section
);
1958 public RightsSection
createRightsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1959 RightsSection section
= new RightsSection(this, conversation
, parentElement
, style
);
1960 addAndAdaptSection(parentElement
, section
);
1964 public SourceSection
createSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1965 SourceSection section
= new SourceSection(this, conversation
, parentElement
, style
);
1966 addAndAdaptSection(parentElement
, section
);
1970 public ScopeSection
createScopeSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1971 ScopeSection section
= new ScopeSection(this, conversation
, parentElement
, style
);
1972 addAndAdaptSection(parentElement
, section
);
1976 public DescriptionSourceSection
createDescriptionSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1977 DescriptionSourceSection section
= new DescriptionSourceSection(this, conversation
, parentElement
, style
);
1978 addAndAdaptSection(parentElement
, section
);
1982 public TypeDesignationSection
createTypeDesignationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1983 TypeDesignationSection section
= new TypeDesignationSection(this, conversation
, parentElement
, style
);
1984 addAndAdaptSection(parentElement
, section
);
1988 public StateDataSection
createStateDataSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1989 StateDataSection section
= new StateDataSection(this, conversation
, parentElement
, style
);
1990 addAndAdaptSection(parentElement
, section
);
1994 public StatisticalMeasurementValueSection
createStatisticalMeasurementValueSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1995 StatisticalMeasurementValueSection section
= new StatisticalMeasurementValueSection(this, conversation
, parentElement
, style
);
1996 addAndAdaptSection(parentElement
, section
);
2000 public DescribedSpecimenSection
createDescribedSpecimenSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2001 DescribedSpecimenSection section
= new DescribedSpecimenSection(this, conversation
, parentElement
, style
);
2002 addAndAdaptSection(parentElement
, section
);
2006 public CollectingAreasDetailSection
createCollectingAreasDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2007 CollectingAreasDetailSection section
= new CollectingAreasDetailSection(this, conversation
, parentElement
, style
);
2008 addAndAdaptSection(parentElement
, section
);
2012 public CurrentDeterminationDetailSection
createCurrentDeterminationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2013 CurrentDeterminationDetailSection section
= new CurrentDeterminationDetailSection(this, conversation
, parentElement
, style
);
2014 addAndAdaptSection(parentElement
, section
);
2018 public DeterminationHistoryDetailSection
createDeterminationHistoryDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2019 DeterminationHistoryDetailSection section
= new DeterminationHistoryDetailSection(this, conversation
, parentElement
, style
);
2020 addAndAdaptSection(parentElement
, section
);
2024 public SpecimenCollectionDetailSection
createSpecimenCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2025 SpecimenCollectionDetailSection section
= new SpecimenCollectionDetailSection(this, conversation
, parentElement
, style
);
2026 addAndAdaptSection(parentElement
, section
);
2030 public SourceCollectionDetailSection
createSourceCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2031 SourceCollectionDetailSection section
= new SourceCollectionDetailSection(this, conversation
, parentElement
, style
);
2032 addAndAdaptSection(parentElement
, section
);
2036 public GeographicalScopeDetailSection
createGeographicalScopeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2037 GeographicalScopeDetailSection section
= new GeographicalScopeDetailSection(this, conversation
, parentElement
, style
);
2038 addAndAdaptSection(parentElement
, section
);
2042 public ScopeRestrictionSection
createScopeRestrictionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2043 ScopeRestrictionSection section
= new ScopeRestrictionSection(this, conversation
, parentElement
, style
);
2044 addAndAdaptSection(parentElement
, section
);
2048 public MemberDetailSection
createMemberDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2049 MemberDetailSection section
= new MemberDetailSection(this, conversation
, parentElement
, style
);
2050 addAndAdaptSection(parentElement
, section
);
2054 public GrantedAuthorityDetailSection
createGrantedAuthorityDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2055 GrantedAuthorityDetailSection section
= new GrantedAuthorityDetailSection(this, conversation
, parentElement
, style
);
2056 addAndAdaptSection(parentElement
, section
);
2060 public GroupsByUserDetailSection
createGroupsByUserDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2061 GroupsByUserDetailSection section
= new GroupsByUserDetailSection(this, conversation
, parentElement
, style
);
2062 addAndAdaptSection(parentElement
, section
);
2066 public TaxonomicScopeSection
createTaxonomicScopeSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2067 TaxonomicScopeSection section
= new TaxonomicScopeSection(this, conversation
, parentElement
, style
);
2068 addAndAdaptSection(parentElement
, section
);
2074 * createEntityCollectionElement
2077 * @param removeListener
2078 * a {@link org.eclipse.swt.events.SelectionListener} object.
2081 * @param parentElement
2083 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
2085 * @param versionableEntity
2086 * a {@link eu.etaxonomy.cdm.model.common.IVersionableEntity}
2088 * @param backgroundColor
2089 * a {@link org.eclipse.swt.graphics.Color} object.
2091 * {@link eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement}
2094 public AbstractEntityCollectionElement
createEntityCollectionElement(AbstractFormSection parentElement
,
2095 Object versionableEntity
, SelectionListener removeListener
, Color backgroundColor
, int style
) {
2096 AbstractEntityCollectionElement element
= null;
2098 Object entity
= HibernateProxyHelper
.deproxy(versionableEntity
);
2100 if (entity
instanceof Annotation
) {
2101 element
= new AnnotationElement(this, parentElement
, (Annotation
) entity
, removeListener
, style
);
2102 } else if (entity
instanceof Person
) {
2103 element
= new TeamMemberElement(this, parentElement
, (Person
) entity
, removeListener
, style
);
2104 } else if (entity
instanceof Credit
) {
2105 element
= new CreditElement(this, parentElement
, (Credit
) entity
, removeListener
, style
);
2106 } else if (entity
instanceof Extension
) {
2107 element
= new ExtensionElement(this, parentElement
, (Extension
) entity
, removeListener
, style
);
2108 } else if (entity
instanceof Marker
) {
2109 element
= new MarkerElement(this, parentElement
, (Marker
) entity
, removeListener
, style
);
2110 } else if (entity
instanceof Media
) {
2111 element
= new MediaElement(this, parentElement
, (Media
) entity
, removeListener
, style
);
2112 } else if (entity
instanceof MediaRepresentation
) {
2113 element
= new MediaRepresentationElement(this, parentElement
, (MediaRepresentation
) entity
, removeListener
,
2115 } else if (entity
instanceof ImageFile
) {
2116 element
= new ImageFileElement(this, parentElement
, (ImageFile
) entity
, removeListener
, style
);
2117 } else if (entity
instanceof MediaRepresentationPart
) {
2118 element
= new MediaRepresentationPartElement(this, parentElement
, (MediaRepresentationPart
) entity
,
2119 removeListener
, style
);
2120 } else if (entity
instanceof NomenclaturalStatus
) {
2121 element
= new NomenclaturalStatusElement(this, parentElement
, (NomenclaturalStatus
) entity
, removeListener
,
2123 } else if (entity
instanceof Rights
) {
2124 element
= new RightsElement(this, parentElement
, (Rights
) entity
, removeListener
, style
);
2125 } else if (entity
instanceof DescriptionElementSource
) {
2126 element
= new DescriptionElementSourceElement(this, parentElement
, (DescriptionElementSource
) entity
,
2127 removeListener
, style
);
2128 } else if (entity
instanceof IdentifiableSource
) {
2129 element
= new IdentifiableSourceElement(this, parentElement
, (IdentifiableSource
) entity
, removeListener
,
2131 } else if (entity
instanceof DefinedTerm
) {
2132 switch(((DefinedTerm
)entity
).getTermType()) {
2134 element
= new ScopeElement(this,
2136 (DefinedTerm
) entity
,
2141 element
= new ModifierElement(this,
2143 (DefinedTerm
) entity
,
2148 //FIXME : Actually we should through an exception here
2153 } else if (entity
instanceof Reference
) {
2154 element
= new DescriptionSourceElement(this, parentElement
, (Reference
) entity
, removeListener
, style
);
2155 } else if (entity
instanceof NameTypeDesignation
) {
2156 element
= new NameTypeDesignationElement(this, parentElement
, (NameTypeDesignation
) entity
, removeListener
,
2158 } else if (entity
instanceof NameRelationship
) {
2159 element
= new NameRelationshipDetailElement(this, parentElement
, (NameRelationship
) entity
, removeListener
,
2161 } else if (entity
instanceof SpecimenTypeDesignation
) {
2162 element
= new SpecimenTypeDesignationElement(this, parentElement
, (SpecimenTypeDesignation
) entity
,
2163 removeListener
, style
);
2164 } else if (entity
instanceof StateData
) {
2165 element
= new StateDataElement(this, parentElement
, (StateData
) entity
, removeListener
, style
);
2166 } else if (entity
instanceof StatisticalMeasurementValue
) {
2167 element
= new StatisticalMeasurementValueElement(this, parentElement
, (StatisticalMeasurementValue
) entity
,
2168 removeListener
, style
);
2169 } else if (entity
instanceof DerivedUnit
) {
2170 switch(((DerivedUnit
)entity
).getRecordBasis()) {
2171 case LivingSpecimen
:
2172 case PreservedSpecimen
:
2174 element
= new SpecimenCollectionDetailElement(this,
2176 (DerivedUnit
) entity
,
2181 element
= new DerivedUnitElement(this,
2183 (DerivedUnit
) entity
,
2188 } else if (entity
instanceof NamedArea
) {
2189 element
= new NamedAreaDetailElement(this, parentElement
, (NamedArea
) entity
, removeListener
, style
);
2190 } else if (entity
instanceof DeterminationEvent
) {
2191 element
= new DeterminationEventDetailElement(this, parentElement
, (DeterminationEvent
) entity
, removeListener
, style
);
2192 } else if (entity
instanceof User
) {
2193 element
= new MemberDetailElement(this, parentElement
, (User
) entity
, removeListener
, style
);
2194 } else if (entity
instanceof GrantedAuthority
) {
2195 element
= new GrantedAuthorityCollectionElement(this, parentElement
, (GrantedAuthorityImpl
) entity
,
2196 removeListener
, style
);
2197 } else if (entity
instanceof Group
) {
2198 element
= new GroupsByUserDetailElement(this, parentElement
, (Group
) entity
, removeListener
, style
);
2199 } else if (entity
instanceof Taxon
) {
2200 element
= new TaxonDetailElement(this, parentElement
, (Taxon
) entity
, removeListener
, style
);
2201 } else if (entity
instanceof DescriptionElementBase
) {
2202 // this is the special case for protologs, maybe we can do this
2203 // differently when API improves
2204 DescriptionElementBase descriptionElement
= (DescriptionElementBase
) entity
;
2205 if (descriptionElement
.getFeature().equals(Feature
.PROTOLOGUE())) {
2206 element
= new ProtologueElement(this, parentElement
, descriptionElement
, removeListener
, style
);
2210 if (element
== null) {
2211 AbstractUtility
.errorDialog("No element for entity", this,
2212 "Could not generate element for entity. Looks like the case is not handled already. Check implementation. Entity: "
2216 else if (backgroundColor
!= null && !backgroundColor
.isDisposed()) {
2217 element
.setPersistentBackground(backgroundColor
);
2219 parentElement
.addElement(element
);
2225 public void createNamedAreaFieldController(AbstractFormSection parentElement
, NamedArea namedArea
, SelectionListener removeListener
){
2226 // Object entity = HibernateProxyHelper.deproxy(versionableEntity); TODO deproxy necessary??
2227 NamedAreaFieldController element
= new NamedAreaFieldController(this, parentElement
, namedArea
, removeListener
, SWT
.NONE
);
2229 parentElement
.addElement(element
);
2234 * Creates a selection element for the given type T.
2237 * <strong>Selection elements not handled by this method:</strong>
2239 * <li>{@link TaxonNodeSelectionElement} see
2240 * {@link #createTaxonNodeSelectionElement(ConversationHolder, ICdmFormElement, String, TaxonNode, int, int)}
2242 * <li>{@link NomenclaturalAuthorTeamSelectionElement} see
2243 * {@link #createNomenclaturalAuthorTeamSelectionElement(ConversationHolder, ICdmFormElement, String, Team, int, int)}
2249 * a {@link Class} object of the type that you want the selection
2251 * @param parentElement
2252 * a {@link ICdmFormElement} object.
2253 * @param labelString
2254 * a {@link String} object.
2255 * @param selectionType
2257 * a {@link ICdmBase} object.
2260 * @param conversation
2261 * a {@link ConversationHolder} object.
2262 * @return a {@link EntitySelectionElement} object.
2264 public <T
extends ICdmBase
> EntitySelectionElement
<T
> createSelectionElement(Class
<T
> clazz
,
2265 ConversationHolder conversation
, ICdmFormElement parentElement
, String labelString
, T selection
, int mode
,
2267 EntitySelectionElement
<T
> element
= new EntitySelectionElement
<T
>(this, conversation
, parentElement
, clazz
,
2268 labelString
, selection
, mode
, style
);
2270 parentElement
.addElement(element
);
2274 public TaxonNodeSelectionElement
createTaxonNodeSelectionElement(ConversationHolder conversation
,
2275 ICdmFormElement parentElement
, String labelString
, TaxonNode selection
, int mode
, int style
) {
2276 TaxonNodeSelectionElement element
= new TaxonNodeSelectionElement(this, conversation
, parentElement
,
2277 labelString
, selection
, mode
, style
);
2279 parentElement
.addElement(element
);
2283 public NomenclaturalAuthorTeamSelectionElement
createNomenclaturalAuthorTeamSelectionElement(
2284 ConversationHolder conversation
, ICdmFormElement parentElement
, String labelString
, Team selection
,
2285 int mode
, int style
) {
2286 NomenclaturalAuthorTeamSelectionElement element
= new NomenclaturalAuthorTeamSelectionElement(this,
2287 conversation
, parentElement
, labelString
, selection
, mode
, style
);
2289 parentElement
.addElement(element
);
2293 /** {@inheritDoc} */
2294 public LabelElement
createLabel(ICdmFormElement parentElement
, String text
) {
2295 LabelElement labelElement
= new LabelElement(this, parentElement
, text
);
2296 adapt(labelElement
);
2297 parentElement
.addElement(labelElement
);
2298 return labelElement
;
2303 * Getter for the field <code>selectionProvider</code>.
2306 * @return a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
2308 public ISelectionProvider
getSelectionProvider() {
2309 return selectionProvider
;
2314 * createDetailedDescriptionDetailElement
2317 * @param parentElement
2318 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
2322 * {@link eu.etaxonomy.cdm.model.description.DescriptionElementBase}
2327 * {@link eu.etaxonomy.taxeditor.ui.section.description.detail.AbstractDetailedDescriptionDetailElement}
2330 public AbstractDetailedDescriptionDetailElement
createDetailedDescriptionDetailElement(
2331 ICdmFormElement parentElement
, DescriptionElementBase entity
, int style
) {
2332 AbstractDetailedDescriptionDetailElement detailedDescriptionElement
= null;
2334 if (entity
instanceof CategoricalData
) {
2335 detailedDescriptionElement
= new CategoricalDataDetailElement(this, parentElement
,
2336 (CategoricalData
) entity
, style
);
2337 } else if (entity
instanceof CommonTaxonName
) {
2338 detailedDescriptionElement
= new CommonNameDetailElement(this, parentElement
, (CommonTaxonName
) entity
,
2340 } else if (entity
instanceof Distribution
) {
2341 detailedDescriptionElement
= new DistributionDetailElement(this, parentElement
, (Distribution
) entity
,
2343 } else if (entity
instanceof IndividualsAssociation
) {
2344 detailedDescriptionElement
= new IndividualsAssociationDetailElement(this, parentElement
,
2345 (IndividualsAssociation
) entity
, style
);
2346 } else if (entity
instanceof QuantitativeData
) {
2347 detailedDescriptionElement
= new QuantitativeDataDetailElement(this, parentElement
,
2348 (QuantitativeData
) entity
, style
);
2349 } else if (entity
instanceof TaxonInteraction
) {
2350 detailedDescriptionElement
= new TaxonInteractionDetailElement(this, parentElement
,
2351 (TaxonInteraction
) entity
, style
);
2352 } else if (entity
instanceof TextData
) {
2353 detailedDescriptionElement
= new TextDataDetailElement(this, parentElement
, (TextData
) entity
, style
);
2355 throw new IllegalStateException("There is no interface for the given description element");
2357 adapt(detailedDescriptionElement
);
2358 parentElement
.addElement(detailedDescriptionElement
);
2359 return detailedDescriptionElement
;
2364 * Creates a styled text as a part of the form.
2369 * the text initial value
2372 * @return the text widget
2374 public StyledText
createStyledText(Composite parent
, String value
, int style
) {
2375 StyledText text
= new StyledText(parent
, getBorderStyle() | style
| getOrientation());
2376 if (value
!= null) {
2377 text
.setText(value
);
2379 text
.setForeground(getColors().getForeground());
2380 text
.setBackground(getColors().getBackground());
2381 // text.addFocusListener(visibilityHandler);
2388 * @param conversationHolder
2390 * @param detailsViewer
2394 public FieldObservationGeneralSection
createFieldObservationGeneralSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
2395 FieldObservationGeneralSection section
= new FieldObservationGeneralSection(this, conversation
, parentElement
, selectionProvider
, style
);
2396 addAndAdaptSection(parentElement
, section
);
2400 * @param conversationHolder
2402 * @param detailsViewer
2406 public GatheringEventSection
createGatheringEventSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
2407 GatheringEventSection section
= new GatheringEventSection(this, conversation
, parentElement
, selectionProvider
, style
);
2408 addAndAdaptSection(parentElement
, section
);
2412 * @param conversationHolder
2414 * @param detailsViewer
2418 public FieldObservationDetailsSection
createFieldObservationDetailsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
2419 FieldObservationDetailsSection section
= new FieldObservationDetailsSection(this, conversation
, parentElement
, selectionProvider
, style
);
2420 addAndAdaptSection(parentElement
, section
);
2424 public SpecimenGeneralSection
createSpecimenSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
2425 SpecimenGeneralSection section
= new SpecimenGeneralSection(this, conversation
, parentElement
, selectionProvider
, style
);
2426 addAndAdaptSection(parentElement
, section
);
2430 public SpecimenDetailsSection
createSpecimenDetailsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
2431 SpecimenDetailsSection section
= new SpecimenDetailsSection(this, conversation
, parentElement
, selectionProvider
, style
);
2432 addAndAdaptSection(parentElement
, section
);
2436 public DerivedUnitDetailsSection
createDerivedUnitDetailsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
2437 DerivedUnitDetailsSection section
= new DerivedUnitDetailsSection(this, conversation
, parentElement
, selectionProvider
, style
);
2438 addAndAdaptSection(parentElement
, section
);
2442 public FieldObservationGeneralElementController
createSpecimenGeneralElementController(ICdmFormElement parentElement
){
2443 return createFieldObservationGeneralElementController_internal(parentElement
, true, false);
2446 public SpecimenDetailsElementController
createSpecimenDetailsElementController(ICdmFormElement parentElement
){
2447 SpecimenDetailsElement element
= new SpecimenDetailsElement(parentElement
.getLayoutComposite(), SWT
.NONE
);
2448 element
.setLayoutData(LayoutConstants
.FILL_HORIZONTALLY(2,1));
2449 SpecimenDetailsElementController controller
= new SpecimenDetailsElementController(element
, this, parentElement
);
2450 addAndAdaptElement(parentElement
, controller
);
2454 public DerivedUnitDetailsElementController
createDerivedUnitDetailsElementController(ICdmFormElement parentElement
){
2455 DerivedUnitDetailsElement element
= new DerivedUnitDetailsElement(parentElement
.getLayoutComposite(), SWT
.NONE
);
2456 element
.setLayoutData(LayoutConstants
.FILL_HORIZONTALLY(2,1));
2457 DerivedUnitDetailsElementController controller
= new DerivedUnitDetailsElementController(element
, this, parentElement
);
2458 addAndAdaptElement(parentElement
, controller
);
2462 public FieldObservationGeneralElementController
createSpecimenGeneralElementControllerWizard(ICdmFormElement parentElement
){
2463 return createFieldObservationGeneralElementController_internal(parentElement
, true, true);
2466 public FieldObservationGeneralElementController
createFieldObservationGeneralElementControllerWizard(ICdmFormElement parentElement
){
2467 return createFieldObservationGeneralElementController_internal(parentElement
, false, true);
2470 public FieldObservationGeneralElementController
createFieldObservationGeneralElementController(ICdmFormElement parentElement
){
2471 return createFieldObservationGeneralElementController_internal(parentElement
, false, false);
2474 private FieldObservationGeneralElementController
createFieldObservationGeneralElementController_internal(ICdmFormElement parentElement
, boolean isSpecimen
, boolean isWizard
){
2475 FieldObservationGeneralElement element
= new FieldObservationGeneralElement(parentElement
.getLayoutComposite(), SWT
.NONE
);
2476 element
.setLayoutData(LayoutConstants
.FILL_HORIZONTALLY(2,1));
2477 FieldObservationGeneralElementController controller
= new FieldObservationGeneralElementController(element
, this, parentElement
, isSpecimen
, isWizard
);
2478 addAndAdaptElement(parentElement
, controller
);
2482 public GatheringEventDetailsElementController
createGatheringEventDetailsElementController(ICdmFormElement parentElement
) {
2483 GatheringEventDetailsElement element
= new GatheringEventDetailsElement(parentElement
.getLayoutComposite(), SWT
.NONE
);
2484 element
.setLayoutData(LayoutConstants
.FILL_HORIZONTALLY(2,1));
2485 GatheringEventDetailsElementController controller
= new GatheringEventDetailsElementController(element
, this, parentElement
);
2487 parentElement
.addElement(controller
);
2491 public FieldObservationDetailsElementController
createFieldObservationDetailsElementController(ICdmFormElement parentElement
) {
2492 FieldObservationDetailsElement element
= new FieldObservationDetailsElement(parentElement
.getLayoutComposite(), SWT
.NONE
);
2493 element
.setLayoutData(LayoutConstants
.FILL_HORIZONTALLY(2,1));
2494 FieldObservationDetailsElementController controller
= new FieldObservationDetailsElementController(element
, this, parentElement
);
2495 addAndAdaptElement(parentElement
, controller
);