4 package eu
.etaxonomy
.taxeditor
.ui
.element
;
7 import java
.util
.ArrayList
;
8 import java
.util
.Comparator
;
9 import java
.util
.HashSet
;
10 import java
.util
.List
;
14 import javax
.inject
.Inject
;
16 import org
.eclipse
.e4
.core
.contexts
.IEclipseContext
;
17 import org
.eclipse
.jface
.util
.IPropertyChangeListener
;
18 import org
.eclipse
.jface
.viewers
.ISelection
;
19 import org
.eclipse
.jface
.viewers
.ISelectionProvider
;
20 import org
.eclipse
.jface
.window
.Window
;
21 //import org.eclipse.nebula.widgets.richtext.RichTextEditor;
22 import org
.eclipse
.swt
.SWT
;
23 import org
.eclipse
.swt
.custom
.StyledText
;
24 import org
.eclipse
.swt
.events
.FocusAdapter
;
25 import org
.eclipse
.swt
.events
.FocusEvent
;
26 import org
.eclipse
.swt
.events
.FocusListener
;
27 import org
.eclipse
.swt
.events
.MouseAdapter
;
28 import org
.eclipse
.swt
.events
.MouseEvent
;
29 import org
.eclipse
.swt
.events
.MouseListener
;
30 import org
.eclipse
.swt
.events
.SelectionEvent
;
31 import org
.eclipse
.swt
.events
.SelectionListener
;
32 import org
.eclipse
.swt
.events
.TypedEvent
;
33 import org
.eclipse
.swt
.graphics
.Color
;
34 import org
.eclipse
.swt
.graphics
.Font
;
35 import org
.eclipse
.swt
.widgets
.Composite
;
36 import org
.eclipse
.swt
.widgets
.Control
;
37 import org
.eclipse
.swt
.widgets
.Display
;
38 import org
.eclipse
.swt
.widgets
.Event
;
39 import org
.eclipse
.swt
.widgets
.Label
;
40 import org
.eclipse
.ui
.forms
.IFormColors
;
41 import org
.eclipse
.ui
.forms
.events
.ExpansionAdapter
;
42 import org
.eclipse
.ui
.forms
.events
.ExpansionEvent
;
43 import org
.eclipse
.ui
.forms
.widgets
.ExpandableComposite
;
44 import org
.eclipse
.ui
.forms
.widgets
.FormToolkit
;
45 import org
.eclipse
.ui
.forms
.widgets
.Section
;
46 import org
.eclipse
.ui
.forms
.widgets
.TableWrapData
;
47 import org
.eclipse
.ui
.internal
.forms
.widgets
.FormFonts
;
48 import org
.joda
.time
.DateTime
;
49 import org
.joda
.time
.Partial
;
50 import org
.springframework
.security
.core
.GrantedAuthority
;
52 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
53 import eu
.etaxonomy
.cdm
.api
.facade
.DerivedUnitFacade
;
54 import eu
.etaxonomy
.cdm
.common
.DOI
;
55 import eu
.etaxonomy
.cdm
.hibernate
.HibernateProxyHelper
;
56 import eu
.etaxonomy
.cdm
.model
.agent
.Person
;
57 import eu
.etaxonomy
.cdm
.model
.agent
.Team
;
58 import eu
.etaxonomy
.cdm
.model
.common
.Annotation
;
59 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
60 import eu
.etaxonomy
.cdm
.model
.common
.Credit
;
61 import eu
.etaxonomy
.cdm
.model
.common
.Extension
;
62 import eu
.etaxonomy
.cdm
.model
.common
.ICdmBase
;
63 import eu
.etaxonomy
.cdm
.model
.common
.IdentifiableSource
;
64 import eu
.etaxonomy
.cdm
.model
.common
.Identifier
;
65 import eu
.etaxonomy
.cdm
.model
.common
.LSID
;
66 import eu
.etaxonomy
.cdm
.model
.common
.Language
;
67 import eu
.etaxonomy
.cdm
.model
.common
.LanguageString
;
68 import eu
.etaxonomy
.cdm
.model
.common
.Marker
;
69 import eu
.etaxonomy
.cdm
.model
.common
.TimePeriod
;
70 import eu
.etaxonomy
.cdm
.model
.common
.VerbatimTimePeriod
;
71 import eu
.etaxonomy
.cdm
.model
.common
.VersionableEntity
;
72 import eu
.etaxonomy
.cdm
.model
.description
.CategoricalData
;
73 import eu
.etaxonomy
.cdm
.model
.description
.CommonTaxonName
;
74 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionElementBase
;
75 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionElementSource
;
76 import eu
.etaxonomy
.cdm
.model
.description
.Distribution
;
77 import eu
.etaxonomy
.cdm
.model
.description
.Feature
;
78 import eu
.etaxonomy
.cdm
.model
.description
.FeatureState
;
79 import eu
.etaxonomy
.cdm
.model
.description
.IndividualsAssociation
;
80 import eu
.etaxonomy
.cdm
.model
.description
.KeyStatement
;
81 import eu
.etaxonomy
.cdm
.model
.description
.MeasurementUnit
;
82 import eu
.etaxonomy
.cdm
.model
.description
.PresenceAbsenceTerm
;
83 import eu
.etaxonomy
.cdm
.model
.description
.QuantitativeData
;
84 import eu
.etaxonomy
.cdm
.model
.description
.State
;
85 import eu
.etaxonomy
.cdm
.model
.description
.StateData
;
86 import eu
.etaxonomy
.cdm
.model
.description
.StatisticalMeasure
;
87 import eu
.etaxonomy
.cdm
.model
.description
.StatisticalMeasurementValue
;
88 import eu
.etaxonomy
.cdm
.model
.description
.TaxonInteraction
;
89 import eu
.etaxonomy
.cdm
.model
.description
.TextData
;
90 import eu
.etaxonomy
.cdm
.model
.location
.NamedArea
;
91 import eu
.etaxonomy
.cdm
.model
.location
.NamedAreaLevel
;
92 import eu
.etaxonomy
.cdm
.model
.location
.Point
;
93 import eu
.etaxonomy
.cdm
.model
.media
.ExternalLink
;
94 import eu
.etaxonomy
.cdm
.model
.media
.ImageFile
;
95 import eu
.etaxonomy
.cdm
.model
.media
.Media
;
96 import eu
.etaxonomy
.cdm
.model
.media
.MediaRepresentation
;
97 import eu
.etaxonomy
.cdm
.model
.media
.MediaRepresentationPart
;
98 import eu
.etaxonomy
.cdm
.model
.media
.Rights
;
99 import eu
.etaxonomy
.cdm
.model
.molecular
.DnaSample
;
100 import eu
.etaxonomy
.cdm
.model
.name
.NameRelationship
;
101 import eu
.etaxonomy
.cdm
.model
.name
.NameRelationshipType
;
102 import eu
.etaxonomy
.cdm
.model
.name
.NameTypeDesignation
;
103 import eu
.etaxonomy
.cdm
.model
.name
.NomenclaturalStatus
;
104 import eu
.etaxonomy
.cdm
.model
.name
.SpecimenTypeDesignation
;
105 import eu
.etaxonomy
.cdm
.model
.name
.TextualTypeDesignation
;
106 import eu
.etaxonomy
.cdm
.model
.occurrence
.DerivedUnit
;
107 import eu
.etaxonomy
.cdm
.model
.occurrence
.DeterminationEvent
;
108 import eu
.etaxonomy
.cdm
.model
.permission
.GrantedAuthorityImpl
;
109 import eu
.etaxonomy
.cdm
.model
.permission
.Group
;
110 import eu
.etaxonomy
.cdm
.model
.permission
.User
;
111 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
112 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
113 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonNode
;
114 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonNodeAgentRelation
;
115 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonRelationshipType
;
116 import eu
.etaxonomy
.cdm
.model
.term
.DefinedTerm
;
117 import eu
.etaxonomy
.cdm
.model
.term
.DefinedTermBase
;
118 import eu
.etaxonomy
.cdm
.model
.term
.IEnumTerm
;
119 import eu
.etaxonomy
.cdm
.model
.term
.Representation
;
120 import eu
.etaxonomy
.cdm
.model
.term
.TermBase
;
121 import eu
.etaxonomy
.cdm
.model
.term
.TermType
;
122 import eu
.etaxonomy
.cdm
.model
.term
.TermVocabulary
;
123 import eu
.etaxonomy
.cdm
.strategy
.parser
.ParserProblem
;
124 import eu
.etaxonomy
.taxeditor
.model
.MessagingUtils
;
125 import eu
.etaxonomy
.taxeditor
.preference
.PreferencesUtil
;
126 import eu
.etaxonomy
.taxeditor
.store
.StoreUtil
;
127 import eu
.etaxonomy
.taxeditor
.ui
.combo
.EnumComboElement
;
128 import eu
.etaxonomy
.taxeditor
.ui
.combo
.InverseTermWrapper
;
129 import eu
.etaxonomy
.taxeditor
.ui
.combo
.MisappliedRelationshipComboElement
;
130 import eu
.etaxonomy
.taxeditor
.ui
.combo
.NameRelationshipTypeCombo
;
131 import eu
.etaxonomy
.taxeditor
.ui
.combo
.VocabularyComboElement
;
132 import eu
.etaxonomy
.taxeditor
.ui
.combo
.term
.TermComboElement
;
133 import eu
.etaxonomy
.taxeditor
.ui
.dialog
.CloneClassificationDetailElement
;
134 import eu
.etaxonomy
.taxeditor
.ui
.element
.MinMaxTextSection
.UnitType
;
135 import eu
.etaxonomy
.taxeditor
.ui
.mvc
.element
.DateElement
;
136 import eu
.etaxonomy
.taxeditor
.ui
.openurl
.IOpenUrlEnabled
;
137 import eu
.etaxonomy
.taxeditor
.ui
.openurl
.OpenUrlSelectorElement
;
138 import eu
.etaxonomy
.taxeditor
.ui
.password
.EditPasswordElement
;
139 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailElement
;
140 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailSection
;
141 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionElement
;
142 import eu
.etaxonomy
.taxeditor
.ui
.section
.EmptyElement
;
143 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.InstitutionDetailElement
;
144 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.InstitutionDetailSection
;
145 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailElement
;
146 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailSection
;
147 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailElement
;
148 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailSection
;
149 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamMemberElement
;
150 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamMemberSection
;
151 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamOrPersonBaseDetailSection
;
152 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.ClassificationDetailElement
;
153 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.ClassificationDetailSection
;
154 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.TaxonNodeAgentRelationCollectionElement
;
155 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.TaxonNodeAgentRelationCollectionSection
;
156 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.TaxonNodeDetailElement
;
157 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.TaxonNodeDetailSection
;
158 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ExternalLinksElement
;
159 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ExternalLinksSection
;
160 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferenceEntityDetailElement
;
161 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferencedEntityDetailSection
;
162 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.CommonNameSourceElement
;
163 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DerivedUnitElement
;
164 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescribedSpecimenSection
;
165 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailElement
;
166 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailSection
;
167 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailElement
;
168 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailSection
;
169 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementMediaSection
;
170 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceElement
;
171 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceSection
;
172 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceElement
;
173 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceSection
;
174 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.MediaDetailsSection
;
175 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ModifierElement
;
176 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ModifierSection
;
177 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageDetailElement
;
178 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageSection
;
179 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeElement
;
180 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeSection
;
181 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StateDataElement
;
182 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StateDataSection
;
183 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StatisticalMeasurementValueElement
;
184 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StatisticalMeasurementValueSection
;
185 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.AbstractDetailedDescriptionDetailElement
;
186 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.CategoricalDataDetailElement
;
187 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.CommonNameDetailElement
;
188 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.DistributionDetailElement
;
189 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.IndividualsAssociationDetailElement
;
190 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.QuantitativeDataDetailElement
;
191 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.TaxonInteractionDetailElement
;
192 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.TextDataDetailElement
;
193 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.CharacterDetailElement
;
194 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.CharacterDetailSection
;
195 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.CharacterNodeDetailElement
;
196 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.CharacterNodeDetailSection
;
197 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailElement
;
198 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailSection
;
199 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureNodeDetailElement
;
200 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureNodeDetailSection
;
201 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureTreeDetailElement
;
202 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureTreeDetailSection
;
203 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.InapplicableIfCollectionElement
;
204 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.InapplicableIfEntityCollectionSection
;
205 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.OnlyApplicableIfCollectionElement
;
206 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.OnlyApplicableIfEntityCollectionSection
;
207 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityCollectionElement
;
208 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailElement
;
209 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailSection
;
210 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailElement
;
211 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailSection
;
212 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailElement
;
213 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailSection
;
214 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailElement
;
215 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailSection
;
216 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailElement
;
217 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailSection
;
218 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.ScopeRestrictionSection
;
219 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.TaxonomicScopeSection
;
220 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.ImageFileElement
;
221 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaDetailElement
;
222 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaMetaElement
;
223 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationElement
;
224 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationPartElement
;
225 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationPartSection
;
226 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationSection
;
227 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaSection
;
228 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.AuthorshipDetailElement
;
229 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.AuthorshipDetailSection
;
230 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.HybridDetailElement
;
231 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.HybridDetailSection
;
232 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameDetailElement
;
233 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameDetailSection
;
234 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailElement
;
235 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailSection
;
236 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameTypeDesignationElement
;
237 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusElement
;
238 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusSection
;
239 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailElement
;
240 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailSection
;
241 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.ProtologueElement
;
242 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.ProtologueSection
;
243 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.SpecimenTypeDesignationElement
;
244 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.TextTypeDesignationElement
;
245 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.TypeDesignationSection
;
246 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CollectingAreaDetailElement
;
247 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CollectingAreasDetailSection
;
248 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CollectionDetailElement
;
249 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CurrentDeterminationDetailSection
;
250 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitBaseDetailElement
;
251 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitBaseDetailSection
;
252 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitGeneralDetailElement
;
253 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitGeneralDetailSection
;
254 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailElement
;
255 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailSection
;
256 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationEventDetailElement
;
257 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationHistoryDetailSection
;
258 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.EmptySection
;
259 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitDetailElement
;
260 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitDetailSection
;
261 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitGeneralDetailElement
;
262 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitGeneralDetailSection
;
263 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailElement
;
264 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailSection
;
265 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GeoScopeDetailSection
;
266 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GeoScopePolyKeyDetailSection
;
267 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.OriginalLabelDataSection
;
268 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SourceCollectionDetailSection
;
269 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SpecimenCollectionDetailElement
;
270 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SpecimenCollectionDetailSection
;
271 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.association
.DerivedUnitTypeDesignationElement
;
272 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.association
.DerivedUnitTypeDesignationSection
;
273 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.association
.TaxonAssociationDetailElement
;
274 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.association
.TaxonAssociationDetailSection
;
275 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenCurrentDeterminationDetailSection
;
276 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenDetailElement
;
277 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenDetailSection
;
278 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenGeneralDetailElement
;
279 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenGeneralDetailSection
;
280 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.derivedUnit
.PreservedSpecimenSourceCollectionDetailSection
;
281 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AbstractSampleDesignationDetailSection
;
282 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationCloningDetailElement
;
283 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationCloningDetailSection
;
284 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationGelPhotoCollectionDetailSection
;
285 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationGelPhotoDetailElement
;
286 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationGeneralDetailElement
;
287 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationGeneralDetailSection
;
288 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationPrimerDetailElement
;
289 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AmplificationPrimerDetailSection
;
290 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.CurrentSampleDesignationDetailSection
;
291 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaQualityDetailElement
;
292 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaQualityDetailSection
;
293 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaSampleGeneralDetailElement
;
294 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaSampleGeneralDetailSection
;
295 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaSamplePreparationPreservationDetailElement
;
296 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaSamplePreparationPreservationSection
;
297 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.PrimerGeneralDetailElement
;
298 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SampleDesignationDetailElement
;
299 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SampleDesignationDetailSection
;
300 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SampleDesignationHistoryDetailSection
;
301 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SampleDesignationTextDetailElement
;
302 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceContigFileCollectionDetailSection
;
303 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceGeneralDetailElement
;
304 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceGeneralDetailSection
;
305 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceReferenceCollectionDetailElement
;
306 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceReferenceCollectionDetailSection
;
307 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SingleReadGeneralDetailElement
;
308 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SingleReadGeneralDetailSection
;
309 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SingleReadPherogramCollectionDetailSection
;
310 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.TissueSampleGeneralDetailElement
;
311 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.TissueSampleGeneralDetailSection
;
312 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.media
.MediaSpecimenGeneralDetailElement
;
313 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.media
.MediaSpecimenGeneralDetailSection
;
314 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailElement
;
315 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailSection
;
316 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailElement
;
317 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailSection
;
318 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.AnnotationElement
;
319 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.AnnotationSection
;
320 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CdmBaseElement
;
321 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CdmBaseSection
;
322 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CreditElement
;
323 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CreditSection
;
324 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.ExtensionElement
;
325 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.ExtensionSection
;
326 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.HeadlineSection
;
327 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.IdentifiableSourceElement
;
328 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.MarkerElement
;
329 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.MarkerSection
;
330 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.RightsElement
;
331 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.RightsSection
;
332 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.SourceSection
;
333 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.VersionElement
;
334 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.VersionSection
;
335 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.identifier
.DerivedUnitFacadeIdentifierSection
;
336 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.identifier
.IdentifierElement
;
337 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.identifier
.IdentifierSection
;
338 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessageElement
;
339 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessagesSection
;
340 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailElement
;
341 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailSection
;
342 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonDetailElement
;
343 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonDetailSection
;
344 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonOfRelationshipElement
;
345 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailElement
;
346 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailSection
;
347 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailElement
;
348 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailSection
;
349 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailElement
;
350 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailSection
;
351 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailElement
;
352 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailSection
;
353 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.DefinedTermDetailElement
;
354 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.DefinedTermDetailSection
;
355 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.FeatureDetailElement
;
356 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.MeasurementUnitCollectionElement
;
357 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.MeasurementUnitCollectionSection
;
358 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailSection
;
359 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.PresenceAbsenceTermDetailElement
;
360 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.RecommendedModifierVocabulariesCollectionSection
;
361 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.RecommendedModifierVocabulariesElement
;
362 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.StateVocabularyCollectionElement
;
363 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.StateVocabularyCollectionSection
;
364 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.StatisticalMeasureCollectionElement
;
365 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.StatisticalMeasureCollectionSection
;
366 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermMediaSection
;
367 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailElement
;
368 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailSection
;
369 import eu
.etaxonomy
.taxeditor
.ui
.selection
.CommonNameReferenceSelectionElement
;
370 import eu
.etaxonomy
.taxeditor
.ui
.selection
.EntitySelectionElement
;
371 import eu
.etaxonomy
.taxeditor
.ui
.selection
.EntitySelectionElementWithAbbreviatedTitle
;
372 import eu
.etaxonomy
.taxeditor
.ui
.selection
.NomenclaturalAuthorTeamSelectionElement
;
373 import eu
.etaxonomy
.taxeditor
.ui
.selection
.TaxonNodeSelectionElement
;
374 import eu
.etaxonomy
.taxeditor
.view
.detail
.CdmSectionPart
;
378 * CdmFormFactory class.
382 * @created Feb 24, 2010
384 public class CdmFormFactory
extends FormToolkit
{
386 private BoldFontHolder2 boldFontHolder2
;
387 private MouseListener selectionMouseHandler
;
388 private FocusListener selectionFocusHandler
;
391 private IEclipseContext context
;
393 private final Set
<SelectionListener
> selectionListenerList
= new HashSet
<SelectionListener
>();
395 private final List
<IPropertyChangeListener
> propertyChangeListeners
= new ArrayList
<IPropertyChangeListener
>();
397 private final int orientation
= Window
.getDefaultOrientation();
398 private ISelectionProvider selectionProvider
;
400 /** Constant <code>EMPTY_SELECTION</code> */
401 public static ISelection EMPTY_SELECTION
= new ISelection() {
403 public boolean isEmpty() {
414 private class SelectionMouseHandler
extends MouseAdapter
{
416 public void mouseDown(MouseEvent e
) {
417 notifySelectionListeners(e
);
427 private class SelectionFocusHandler
extends FocusAdapter
{
429 public void focusGained(FocusEvent e
) {
430 notifySelectionListeners(e
);
434 private void notifySelectionListeners(TypedEvent e
) {
435 Event event
= new Event();
436 event
.widget
= e
.widget
;
437 SelectionEvent selectionEvent
= new SelectionEvent(event
);
439 for (SelectionListener listener
: selectionListenerList
) {
440 listener
.widgetSelected(selectionEvent
);
444 public CdmFormFactory(Display display
) {
448 public CdmFormFactory(Display display
, ISelectionProvider selectionProvider
) {
450 this.selectionProvider
= selectionProvider
;
454 private void init() {
455 boldFontHolder2
= new BoldFontHolder2();
456 selectionMouseHandler
= new SelectionMouseHandler();
457 selectionFocusHandler
= new SelectionFocusHandler();
460 public IEclipseContext
getContext() {
465 * Creates an instance initialized with the correct selectionProvider
467 * Make sure to remove the instance when the entityComposite disposes via
468 * destroySelectionArbitrator(..)
470 * @param entityElement
471 * a {@link eu.etaxonomy.taxeditor.ui.element.IEntityElement}
473 * @return a {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator}
476 public SelectionArbitrator
createSelectionArbitrator(IEntityElement entityElement
) {
477 SelectionArbitrator selectionArbitrator
= new SelectionArbitrator(entityElement
);
478 selectionArbitrator
.addSelectionProvider(selectionProvider
);
479 selectionProvider
.addSelectionChangedListener(selectionArbitrator
);
480 addSelectionListener(selectionArbitrator
);
481 return selectionArbitrator
;
486 * destroySelectionArbitrator
489 * @param selectionArbitrator
491 * {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator}
494 public void destroySelectionArbitrator(SelectionArbitrator selectionArbitrator
) {
495 if(selectionArbitrator
==null){
498 removeSelectionListener(selectionArbitrator
);
499 if (selectionProvider
!= null) {
500 selectionProvider
.removeSelectionChangedListener(selectionArbitrator
);
502 MessagingUtils
.error(this.getClass(),
503 "Tried to destroy a selection listener from this factories listeners but was null", null);
509 * Adapts the {@link AbstractCdmFormElement}:<br>
510 * - sets the {@link IPropertyChangeListener}s handled by this class
515 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement}
518 public void adapt(ICdmFormElement formElement
) {
519 formElement
.setPropertyChangeListeners(propertyChangeListeners
);
524 public void adapt(Control control
, boolean trackFocus
, boolean trackKeyboard
) {
526 control
.addFocusListener(selectionFocusHandler
);
528 super.adapt(control
, trackFocus
, trackKeyboard
);
533 public void adapt(Composite composite
) {
534 composite
.addMouseListener(selectionMouseHandler
);
536 super.adapt(composite
);
545 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
548 public void destroyElement(ICdmFormElement formElement
) {
549 // return if element was not initialized
550 if (formElement
== null) {
553 // destroy selection arbitrator, if any
554 if (formElement
instanceof ISelectableElement
) {
555 destroySelectionArbitrator(((ISelectableElement
) formElement
).getSelectionArbitrator());
557 // remove this element form its parents list of elements
558 // ICdmFormElement parentElement = formElement.getParentElement();
559 // if(parentElement != null){
560 // parentElement.removeElement(formElement);
562 // call destroy on child elements recursively
563 for (ICdmFormElement childElement
: formElement
.getElements()) {
564 destroyElement(childElement
);
566 // dispose of the controls
567 for (Control control
: formElement
.getControls()) {
568 // we added the layoutComposite of the parental element as the
569 // layout composite to this formElement
570 // but we do not want to destroy it.
571 if (control
.equals(formElement
.getLayoutComposite())) {
574 if (control
!= null && !control
.isDisposed()){
588 * a {@link org.eclipse.swt.widgets.Composite} object.
589 * @return a {@link org.eclipse.swt.widgets.Label} object.
591 public Label
createEmptyCell(Composite parent
) {
592 return this.createLabel(parent
, null);
597 * createMultiLanguageTextElement
600 * @param parentElement
601 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
604 * a {@link java.lang.String} object.
605 * @param multilanguageText
606 * a {@link java.util.Map} object.
612 * {@link eu.etaxonomy.taxeditor.ui.element.MultilanguageTextElement}
615 public MultilanguageTextElement
createMultiLanguageTextElement(ICdmFormElement parentElement
, String labelString
,
616 Map
<Language
, LanguageString
> multilanguageText
, int textHeight
, int style
) {
617 MultilanguageTextElement element
= new MultilanguageTextElement(this, parentElement
, labelString
,
618 multilanguageText
, textHeight
, style
);
620 parentElement
.addElement(element
);
626 * createMultiLanguageTextElement
629 * @param parentElement
630 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
633 * @param Representation
634 * a {@link eu.etaxonomy.cdm.model.term.Representation} object.
640 * {@link eu.etaxonomy.taxeditor.ui.element.RepresentationElement}
643 public RepresentationElement
createRepresentationElement(ICdmFormElement parentElement
, Representation representation
, TermBase term
,int textHeight
, int style
, boolean fillDetails
) {
644 RepresentationElement element
= new RepresentationElement(this, parentElement
, representation
, term
, textHeight
, style
, fillDetails
);
646 parentElement
.addElement(element
);
652 * createMultiLanguageTextElement
655 * @param parentElement
656 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
659 * @param Representation
660 * a {@link eu.etaxonomy.cdm.model.term.Representation} object.
666 * {@link eu.etaxonomy.taxeditor.ui.element.RepresentationElement}
669 public TranslatableRepresentationElement
createTranslatableRepresentationElement(ICdmFormElement parentElement
, Representation representation
, TermBase term
,int textHeight
, int style
, boolean fillDetails
) {
670 TranslatableRepresentationElement element
= new TranslatableRepresentationElement(this, parentElement
, representation
, term
, textHeight
, style
, fillDetails
);
672 parentElement
.addElement(element
);
676 public KeyStatementElement
createKeyStatementElement(ICdmFormElement parentElement
, String labelString
,
677 KeyStatement keyStatement
, int textHeight
, int style
) {
678 KeyStatementElement element
= new KeyStatementElement(this, parentElement
, labelString
, keyStatement
,
681 parentElement
.addElement(element
);
686 * Creates a text field with a label. The initial content will be the return value of the initalObject's {@link #toString()}
688 * <b>Note</b>: if initialObject is <code>null</code> then an empty string is used.
689 * @param parentElement the parent container
690 * @param labelString the label name
691 * @param initialObject the object from which the <code>toString()</code> method is called
692 * @param style {@link SWT} style constant
693 * @return the created textfield with label
695 public TextWithLabelElement
createTextWithLabelElement(ICdmFormElement parentElement
, String labelString
,
696 Object initialObject
, int style
) {
697 return createTextWithLabelElement(parentElement
, labelString
, initialObject
==null?
"":initialObject
.toString(), style
);
702 * createTextWithLabelElement
705 * @param parentElement
706 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
709 * a {@link java.lang.String} object.
711 * a {@link java.lang.String} object.
714 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
717 public TextWithLabelElement
createTextWithLabelElement(ICdmFormElement parentElement
, String labelString
,
718 String initialText
, int style
) {
719 return createTextWithLabelElement(parentElement
, labelString
, initialText
, null, style
);
723 * createTextWithLabelElement
726 * @param parentElement
727 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
730 * a {@link java.lang.String} object.
732 * a {@link java.lang.String} object.
733 * @param textLimit maximal number of characters allowed
736 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
739 public TextWithLabelElement
createTextWithLabelElement(ICdmFormElement parentElement
, String labelString
,
740 String initialText
, Integer textLimit
, int style
) {
741 if(initialText
==null){
745 TextWithLabelElement element
= new TextWithLabelElement(this, parentElement
, labelString
, initialText
, null,
748 parentElement
.addElement(element
);
752 public TextWithLabelElement
createMultiLineTextWithLabel(ICdmFormElement parentElement
, String labelString
,
753 int textHeight
, int style
) {
754 TextWithLabelElement element
= new TextWithLabelElement(this, parentElement
, labelString
, "", textHeight
, true, style
);
756 parentElement
.addElement(element
);
760 public LsidWithExceptionLabelElement
createLsidWithExceptionLabelElement(ICdmFormElement parentElement
, String labelString
,
761 LSID initialLsid
, int style
) {
762 LsidWithExceptionLabelElement element
= new LsidWithExceptionLabelElement(this, parentElement
, labelString
, initialLsid
, null, style
);
764 parentElement
.addElement(element
);
768 public UriWithLabelElement
createUriWithLabelElement(ICdmFormElement parentElement
, String labelString
,
769 URI initialUri
, int style
) {
770 UriWithLabelElement element
= new UriWithLabelElement(this, parentElement
, labelString
, initialUri
, null, style
);
772 parentElement
.addElement(element
);
775 public UriWithLabelElement
createUriWithLabelElement(ICdmFormElement parentElement
, String labelString
,
776 URI initialUri
,Integer textHeight
, int style
) {
777 UriWithLabelElement element
= new UriWithLabelElement(this, parentElement
, labelString
, initialUri
, textHeight
, style
);
779 parentElement
.addElement(element
);
784 public DoiWithLabelElement
createDoiWithLabelElement(ICdmFormElement parentElement
, String labelString
,
785 DOI initialDoi
, int style
) {
786 DoiWithLabelElement element
= new DoiWithLabelElement(this, parentElement
, labelString
, initialDoi
, null, style
);
788 parentElement
.addElement(element
);
791 public DoiWithLabelElement
createDoiWithLabelElement(ICdmFormElement parentElement
, String labelString
,
792 DOI initialDoi
,Integer textHeight
, int style
) {
793 DoiWithLabelElement element
= new DoiWithLabelElement(this, parentElement
, labelString
, initialDoi
, textHeight
, style
);
795 parentElement
.addElement(element
);
806 public OpenUrlSelectorElement
createOpenUrlSelectorElement(ICdmFormElement parentElement
, String labelString
,
807 IOpenUrlEnabled openUrlEnabled
, int style
) {
808 OpenUrlSelectorElement element
= new OpenUrlSelectorElement(this, parentElement
, labelString
, openUrlEnabled
,
811 parentElement
.addElement(element
);
817 * @param parentElement
819 * @param conversationEnabled
824 public EditPasswordElement
createEditPasswordElement(ICdmFormElement parentElement
, String labelString
,
825 ConversationHolder conversation
, User user
, int style
) {
826 EditPasswordElement element
= new EditPasswordElement(this, parentElement
, labelString
, user
, conversation
);
828 parentElement
.addElement(element
);
834 * createIntegerTextWithLabelElement
837 * @param parentElement
838 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
841 * a {@link java.lang.String} object.
842 * @param initialInteger
843 * a {@link java.lang.Integer} object.
847 * {@link eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement}
850 public NumberWithLabelElement
createNumberTextWithLabelElement(
851 ICdmFormElement parentElement
, String labelString
,
852 Number initialNumber
, int style
) {
853 NumberWithLabelElement element
= new NumberWithLabelElement(this,
854 parentElement
, labelString
, initialNumber
, style
);
856 parentElement
.addElement(element
);
860 public LanguageStringWithLabelElement
createLanguageStringWithLabelElement(ICdmFormElement parentElement
,
861 String labelString
, LanguageString languageString
, int style
) {
862 return createLanguageStringWithLabelElement(parentElement
, labelString
, languageString
, null, false, style
);
865 public LanguageStringWithLabelElement
createLanguageStringWithLabelElement(ICdmFormElement parentElement
,
866 String labelString
, LanguageString languageString
, Integer height
, boolean isMultiLine
, int style
) {
867 LanguageStringWithLabelElement element
= new LanguageStringWithLabelElement(this, parentElement
, labelString
,
868 languageString
, height
, isMultiLine
, style
);
870 parentElement
.addElement(element
);
876 * createKeyValueViewerElement
879 * @param parentElement
880 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
883 * a {@link java.lang.String} object.
884 * @param valueHeading
885 * a {@link java.lang.String} object.
887 * a {@link java.util.Map} object.
888 * @return a {@link eu.etaxonomy.taxeditor.ui.element.KeyValueViewerElement}
891 public KeyValueViewerElement
createKeyValueViewerElement(ICdmFormElement parentElement
, String keyHeading
,
892 String valueHeading
, Map
<Object
, Object
> map
) {
893 KeyValueViewerElement element
= new KeyValueViewerElement(this, parentElement
, keyHeading
, valueHeading
, map
);
895 parentElement
.addElement(element
);
899 * @deprecated Use {@link #createDefinedTermComboElement(TermType, ICdmFormElement, String, DefinedTermBase, int)} instead
902 public <T
extends DefinedTermBase
> TermComboElement
<T
> createTermComboElement(Class
<T
> termComboType
,
903 ICdmFormElement parentElement
, String labelString
, T selection
, int style
) {
904 TermComboElement
<T
> element
= new TermComboElement
<T
>(this, parentElement
, termComboType
, labelString
, selection
, true, style
);
906 parentElement
.addElement(element
);
910 public <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
912 ICdmFormElement parentElement
,
916 Comparator
<T
> comparator
) {
917 return this.createDefinedTermComboElement(termType
, null, null, parentElement
, labelString
, selection
, true, style
, false, comparator
);
920 public <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
922 ICdmFormElement parentElement
,
925 boolean addEmptyElement
,
927 return this.createDefinedTermComboElement(termType
, null, null, parentElement
, labelString
, selection
, addEmptyElement
, style
, false, null);
930 public <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
932 ICdmFormElement parentElement
,
936 return this.createDefinedTermComboElement(termType
, null, null, parentElement
, labelString
, selection
, true, style
, false, null);
939 public <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
941 ICdmFormElement parentElement
,
945 return this.createDefinedTermComboElement(null, null, terms
, parentElement
, labelString
, selection
, true, style
, false, null);
947 public <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
949 ICdmFormElement parentElement
,
952 boolean addEmptyElement
,
954 return this.createDefinedTermComboElement(null, null, terms
, parentElement
, labelString
, selection
, addEmptyElement
, style
, false, null);
956 public <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
958 ICdmFormElement parentElement
,
961 boolean addEmptyElement
,
963 boolean useAbbrevLabel
) {
964 return createDefinedTermComboElement(termType
, null, null, parentElement
, labelString
, selection
, addEmptyElement
, style
, useAbbrevLabel
, null);
968 public <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
969 TermVocabulary
<?
> termVocabulary
,
970 ICdmFormElement parentElement
,
974 return this.createDefinedTermComboElement(null, termVocabulary
, null, parentElement
, labelString
, selection
, true, style
, false, null);
977 public <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
978 TermVocabulary
<?
> termVocabulary
,
979 ICdmFormElement parentElement
,
982 boolean addEmptyElement
,
984 boolean useAbbrevLabel
) {
985 return createDefinedTermComboElement(null, termVocabulary
, null, parentElement
, labelString
, selection
, addEmptyElement
, style
, useAbbrevLabel
, null);
988 private <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
990 TermVocabulary
<?
> termVocabulary
,
992 ICdmFormElement parentElement
,
995 boolean addEmptyElement
,
997 boolean useAbbrevLabel
,
998 Comparator
<T
> comparator
) {
1000 TermComboElement
<T
> element
= new TermComboElement
<T
>(this, parentElement
, termType
, labelString
, selection
, addEmptyElement
, style
, useAbbrevLabel
, comparator
);
1002 parentElement
.addElement(element
);
1005 else if(termVocabulary
!=null){
1006 TermComboElement
<T
> element
= new TermComboElement
<T
>(this, parentElement
, termVocabulary
, labelString
, selection
, addEmptyElement
, style
, useAbbrevLabel
, comparator
);
1007 if (comparator
!= null){
1008 element
.setTermComparator(comparator
);
1011 parentElement
.addElement(element
);
1013 }else if (terms
!= null){
1015 TermComboElement
<T
> element
= new TermComboElement
<T
>(this, parentElement
, terms
, labelString
, selection
, addEmptyElement
, style
, useAbbrevLabel
);
1016 if (comparator
!= null){
1017 element
.setTermComparator(comparator
);
1020 parentElement
.addElement(element
);
1024 //this should never happen
1029 public NameRelationshipTypeCombo
createNameRelationshipTypeCombo(ICdmFormElement parentElement
,
1032 boolean useAbbrevLabel
,
1033 Comparator
<NameRelationshipType
> comparator
) {
1035 NameRelationshipTypeCombo
<InverseTermWrapper
> element
= new NameRelationshipTypeCombo(this, parentElement
, labelString
, true, style
, useAbbrevLabel
, comparator
);
1037 parentElement
.addElement(element
);
1041 public MisappliedRelationshipComboElement
createMisappliedRelationshipComboElement(
1042 ICdmFormElement parentElement
,
1044 TaxonRelationshipType selection
,
1046 MisappliedRelationshipComboElement combo
= new MisappliedRelationshipComboElement(this, parentElement
, labelString
, selection
, false, style
, false);
1048 parentElement
.addElement(combo
);
1052 public <T
extends IEnumTerm
<T
>> EnumComboElement
<T
> createEnumComboElement(
1053 Class
<T
> enumComboType
, ICdmFormElement parentElement
,
1055 return createEnumComboElement(enumComboType
, parentElement
, null, style
);
1058 public <T
extends IEnumTerm
<T
>> EnumComboElement
<T
> createEnumComboElement(
1059 Class
<T
> enumComboType
, ICdmFormElement parentElement
, Comparator
<T
> comparator
,
1061 EnumComboElement
<T
> element
= new EnumComboElement
<T
>(this, parentElement
, enumComboType
, comparator
, style
);
1063 parentElement
.addElement(element
);
1067 public <TERM
extends DefinedTermBase
<TERM
>, VOC
extends TermVocabulary
<TERM
>> VocabularyComboElement
<TERM
, VOC
> createVocabularyComboElement(
1068 TermType termType
, String label
, VOC selection
, ICdmFormElement parentElement
, int style
) {
1069 VocabularyComboElement
<TERM
, VOC
> element
= new VocabularyComboElement
<TERM
, VOC
>(this, parentElement
, termType
, label
, selection
, style
);
1071 parentElement
.addElement(element
);
1077 * createBrowserElement
1081 * a {@link java.net.URI} object.
1084 * @param parentElement
1085 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1087 * @return a {@link eu.etaxonomy.taxeditor.ui.element.BrowserElement}
1090 public BrowserElement
createBrowserElement(ICdmFormElement parentElement
, URI imageUri
, int style
) {
1091 BrowserElement element
= new BrowserElement(this, parentElement
, imageUri
, style
);
1093 parentElement
.addElement(element
);
1099 * createImageElement
1102 * @param parentElement
1103 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1106 * a {@link java.net.URI} object.
1109 * @return a {@link eu.etaxonomy.taxeditor.ui.element.ImageElement} object.
1111 public ImageElement
createImageElement(ICdmFormElement parentElement
, URI imageUri
, int style
) {
1112 ImageElement element
= new ImageElement(this, parentElement
, imageUri
, style
);
1114 parentElement
.addElement(element
);
1120 * createTextActionElement
1123 * @param labelString
1124 * a {@link java.lang.String} object.
1125 * @param initialText
1126 * a {@link java.lang.String} object.
1129 * @param parentElement
1130 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1132 * @param buttonLabel
1133 * a {@link java.lang.String} object.
1134 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextActionElement}
1137 public TextActionElement
createTextActionElement(ICdmFormElement parentElement
, String labelString
,
1138 String buttonLabel
, String initialText
, int style
) {
1139 TextActionElement element
= new TextActionElement(this, parentElement
, labelString
, buttonLabel
, initialText
,
1142 parentElement
.addElement(element
);
1151 * @param parentElement
1152 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1155 * a {@link java.lang.String} object.
1156 * @param initialState
1160 * @return a {@link eu.etaxonomy.taxeditor.ui.element.CheckboxElement}
1163 public CheckboxElement
createCheckbox(ICdmFormElement parentElement
, String label
, Boolean initialState
, int style
) {
1164 if(initialState
==null){
1165 initialState
= Boolean
.FALSE
;
1167 CheckboxElement element
= new CheckboxElement(this, parentElement
, label
, initialState
, style
| orientation
);
1169 parentElement
.addElement(element
);
1174 * Creates a section as a part of the form.
1176 * @return the section widget
1179 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
1182 public Section
adapt(AbstractFormSection section
) {
1183 section
.setMenu(section
.getLayoutComposite().getMenu());
1184 adapt(section
, true, true);
1186 // handle focus and property change events for cdm use
1187 section
.addFocusListener(selectionFocusHandler
);
1188 section
.setPropertyChangeListeners(propertyChangeListeners
);
1190 section
.addExpansionListener(new ExpansionAdapter(){
1192 public void expansionStateChanged(ExpansionEvent e
) {
1193 super.expansionStateChanged(e
);
1194 if(section
.getEntity()!=null){
1195 PreferencesUtil
.setStringValue(StoreUtil
.getPrefKey(section
.getClass(), section
.getEntity().getClass().getCanonicalName()), e
.getState()?CdmSectionPart
.EXPANDED
:CdmSectionPart
.COLLAPSED
);
1200 if (section
.getToggle() != null) {
1201 section
.getToggle().setHoverDecorationColor(getColors().getColor(IFormColors
.TB_TOGGLE_HOVER
));
1202 section
.getToggle().setDecorationColor(getColors().getColor(IFormColors
.TB_TOGGLE
));
1205 section
.setFont(boldFontHolder2
.getBoldFont(section
.getLayoutComposite().getFont()));
1207 if ((section
.getStyle() & ExpandableComposite
.TITLE_BAR
) != 0
1208 || (section
.getStyle() & ExpandableComposite
.SHORT_TITLE_BAR
) != 0) {
1209 getColors().initializeSectionToolBarColors();
1210 section
.setTitleBarBackground(getColors().getColor(IFormColors
.TB_BG
));
1211 section
.setTitleBarBorderColor(getColors().getColor(IFormColors
.TB_BORDER
));
1213 // call setTitleBarForeground regardless as it also sets the label color
1214 section
.setTitleBarForeground(getColors().getColor(IFormColors
.TB_TOGGLE
));
1218 private class BoldFontHolder2
{
1219 private Font normalFont
;
1221 private Font boldFont
;
1223 public BoldFontHolder2() {
1226 public Font
getBoldFont(Font font
) {
1227 createBoldFont(font
);
1231 private void createBoldFont(Font font
) {
1232 if (normalFont
== null || !normalFont
.equals(font
)) {
1236 if (boldFont
== null) {
1237 boldFont
= FormFonts
.getInstance().getBoldFont(getColors().getDisplay(), normalFont
);
1241 public void dispose() {
1242 if (boldFont
!= null) {
1243 FormFonts
.getInstance().markFinished(boldFont
, getColors().getDisplay());
1251 * createToggleableTextField
1254 * @param parentElement
1255 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1257 * @param labelString
1258 * a {@link java.lang.String} object.
1259 * @param initialText
1260 * a {@link java.lang.String} object.
1261 * @param initialState
1265 * @return a {@link eu.etaxonomy.taxeditor.ui.element.ToggleableTextElement}
1268 public ToggleableTextElement
createToggleableTextField(ICdmFormElement parentElement
, String labelString
,
1269 String initialText
, boolean initialState
, int style
) {
1270 ToggleableTextElement element
= new ToggleableTextElement(this, parentElement
, labelString
, initialText
,
1271 initialState
, style
| orientation
);
1274 parentElement
.addElement(element
);
1280 * createTimePeriodElement
1283 * @param parentElement
1284 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1286 * @param labelString
1287 * a {@link java.lang.String} object.
1289 * a {@link eu.etaxonomy.cdm.model.common.TimePeriod} object.
1292 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TimePeriodElement}
1295 public TimePeriodElement
createTimePeriodElement(ICdmFormElement parentElement
, String labelString
,
1296 TimePeriod timePeriod
, int style
) {
1297 TimePeriodElement element
= new TimePeriodElement(this, parentElement
, labelString
, timePeriod
, style
);
1299 parentElement
.addElement(element
);
1305 * createVerbatimTimePeriodElement
1308 * @param parentElement
1309 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1311 * @param labelString
1312 * a {@link java.lang.String} object.
1314 * a {@link eu.etaxonomy.cdm.model.common.VerbatimTimePeriod} object.
1317 * @return a {@link eu.etaxonomy.taxeditor.ui.element.VerbatimTimePeriodElement}
1320 public VerbatimTimePeriodElement
createVerbatimTimePeriodElement(ICdmFormElement parentElement
, String labelString
,
1321 VerbatimTimePeriod timePeriod
, int style
) {
1322 VerbatimTimePeriodElement element
= new VerbatimTimePeriodElement(this, parentElement
, labelString
, timePeriod
, style
);
1324 parentElement
.addElement(element
);
1332 * createGatheringEventUnitElement
1335 * @param parentElement
1336 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1338 * @param labelString
1339 * a {@link java.lang.String} object.
1341 * a {@link eu.etaxonomy.cdm.model.common.GatheringEvent} object.
1344 * @return a {@link eu.etaxonomy.taxeditor.ui.element.GatheringEventUnitElement}
1347 public GatheringEventUnitElement
createGatheringEventUnitElement(
1348 ICdmFormElement parentElement
,
1350 DerivedUnitFacade gatheringEvent
,
1351 MinMaxTextSection
.UnitType unitType
,
1353 GatheringEventUnitElement element
= new GatheringEventUnitElement(this,
1360 parentElement
.addElement(element
);
1366 * createPointElement
1371 * @param parentElement
1372 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1375 * a {@link eu.etaxonomy.cdm.model.location.Point} object.
1376 * @return a {@link eu.etaxonomy.taxeditor.ui.element.PointElement} object.
1378 public PointElement
createPointElement(ICdmFormElement parentElement
, Point point
, int style
) {
1379 PointElement element
= new PointElement(this, parentElement
, point
, style
);
1381 parentElement
.addElement(element
);
1386 * Creates an empty section with the given message.<br>
1387 * If message is <code>null</code> a default message will be displayed.
1389 public EmptySection
createEmptySection(String message
, CdmFormFactory formFactory
, ICdmFormElement parentElement
, int style
) {
1390 EmptySection section
= new EmptySection(message
, formFactory
, parentElement
, style
);
1391 parentElement
.addElement(section
);
1398 * createDateDetailSection
1401 * @param parentElement
1402 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1406 * @return a {@link eu.etaxonomy.taxeditor.ui.element.DateDetailSection}
1409 public DateDetailSection
<TimePeriod
> createDateDetailSection(ICdmFormElement parentElement
, int style
) {
1410 DateDetailSection
<TimePeriod
> section
= new DateDetailSection
<TimePeriod
>(this, parentElement
, false, style
);
1411 parentElement
.addElement(section
);
1418 * createVerbatimDateDetailSection
1421 * @param parentElement
1422 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1426 * @return a {@link eu.etaxonomy.taxeditor.ui.element.VerbatimDateDetailSection}
1429 public DateDetailSection
<VerbatimTimePeriod
> createVerbatimDateDetailSection(ICdmFormElement parentElement
, int style
) {
1430 DateDetailSection
<VerbatimTimePeriod
> section
1431 = new DateDetailSection
<VerbatimTimePeriod
>(this, parentElement
, true, style
);
1432 parentElement
.addElement(section
);
1439 * createDateDetailSection
1442 * @param parentElement
1443 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1447 * @return a {@link eu.etaxonomy.taxeditor.ui.element.MinMaxTextSection}
1450 public MinMaxTextSection
createMinMaxTextSection(ICdmFormElement parentElement
, UnitType unitType
, int style
) {
1451 MinMaxTextSection section
= new MinMaxTextSection(this, parentElement
, unitType
, style
);
1452 parentElement
.addElement(section
);
1459 * createPartialElement
1462 * @param parentElement
1463 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1465 * @param labelString
1466 * a {@link java.lang.String} object.
1468 * a {@link org.joda.time.Partial} object.
1471 * @return a {@link eu.etaxonomy.taxeditor.ui.element.PartialElement}
1474 public PartialElement
createPartialElement(ICdmFormElement parentElement
, String labelString
, Partial partial
,
1476 PartialElement element
= new PartialElement(this, parentElement
, labelString
, style
);
1478 parentElement
.addElement(element
);
1484 * addSelectionListener
1488 * a {@link org.eclipse.swt.events.SelectionListener} object.
1490 public void addSelectionListener(SelectionListener listener
) {
1491 selectionListenerList
.add(listener
);
1496 * removeSelectionListener
1500 * a {@link org.eclipse.swt.events.SelectionListener} object.
1502 public void removeSelectionListener(SelectionListener listener
) {
1503 if (listener
== null) {
1504 MessagingUtils
.error(this.getClass(),
1505 "Tried to remove a selection listener from this factories listeners but was null", null);
1507 selectionListenerList
.remove(listener
);
1513 * addPropertyChangeListener
1517 * a {@link org.eclipse.jface.util.IPropertyChangeListener}
1520 public void addPropertyChangeListener(IPropertyChangeListener listener
) {
1521 if (propertyChangeListeners
.contains(listener
)) {
1524 propertyChangeListeners
.add(0, listener
);
1529 * removePropertyChangeListener
1533 * a {@link org.eclipse.jface.util.IPropertyChangeListener}
1536 public void removePropertyChangeListener(IPropertyChangeListener listener
) {
1537 propertyChangeListeners
.remove(listener
);
1541 * @return the propertyChangeListeners
1543 public List
<IPropertyChangeListener
> getPropertyChangeListeners() {
1544 return propertyChangeListeners
;
1549 * createHorizontalSeparator
1552 * @param parentElement
1553 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1557 * @return a {@link org.eclipse.swt.widgets.Label} object.
1559 public Label
createHorizontalSeparator(ICdmFormElement parentElement
, int style
) {
1560 Label separator
= this.createSeparator(parentElement
.getLayoutComposite(), SWT
.HORIZONTAL
| style
);
1561 separator
.setLayoutData(LayoutConstants
.FILL_HORIZONTALLY());
1567 * createVersionElement
1570 * @param parentElement
1571 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1574 * a {@link eu.etaxonomy.cdm.model.common.VersionableEntity}
1579 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.VersionElement}
1582 public VersionElement
createVersionElement(ICdmFormElement parentElement
, VersionableEntity entity
, int style
) {
1583 VersionElement element
= new VersionElement(this, parentElement
, entity
, style
);
1585 parentElement
.addElement(element
);
1590 * @param cdmBaseSection
1595 public CdmBaseElement
createCdmBaseElement(ICdmFormElement parentElement
, CdmBase entity
, int style
) {
1596 CdmBaseElement element
= new CdmBaseElement(this, parentElement
, entity
, style
);
1598 parentElement
.addElement(element
);
1604 * createVersionSection
1607 * @param parentElement
1608 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1613 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.VersionSection}
1616 public VersionSection
createVersionSection(ICdmFormElement parentElement
, int style
) {
1617 VersionSection section
= new VersionSection(this, parentElement
, style
);
1618 parentElement
.addElement(section
);
1628 public CdmBaseSection
createCdmBaseSection(ICdmFormElement parentElement
, int style
) {
1629 CdmBaseSection section
= new CdmBaseSection(this, parentElement
, style
);
1630 parentElement
.addElement(section
);
1637 * createEmptyElement
1640 * @param parentElement
1641 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1643 * @return a {@link eu.etaxonomy.taxeditor.ui.section.EmptyElement} object.
1645 public EmptyElement
createEmptyElement(ICdmFormElement parentElement
, String emptyText
) {
1646 EmptyElement element
= new EmptyElement(this, parentElement
, emptyText
, SWT
.NULL
);
1648 parentElement
.addElement(element
);
1654 * createHeadlineSection
1657 * @param parentElement
1658 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1661 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.HeadlineSection}
1664 public HeadlineSection
createHeadlineSection(ICdmFormElement parentElement
) {
1665 HeadlineSection section
= new HeadlineSection(this, parentElement
, SWT
.NULL
);
1666 parentElement
.addElement(section
);
1673 * createParsingMessageElement
1676 * @param parentElement
1677 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1679 * @param parserProblem
1680 * a {@link eu.etaxonomy.cdm.strategy.parser.ParserProblem}
1685 * {@link eu.etaxonomy.taxeditor.ui.section.taxon.ParsingMessageElement}
1688 public ParsingMessageElement
createParsingMessageElement(ICdmFormElement parentElement
,
1689 ParserProblem parserProblem
, int style
) {
1690 ParsingMessageElement element
= new ParsingMessageElement(this, parentElement
, parserProblem
, style
);
1692 parentElement
.addElement(element
);
1696 public DefinedTermDetailSection
createDefinedTermDetailSection(Class definedTermClass
, ConversationHolder conversation
,
1697 ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
1699 DefinedTermDetailSection section
= new DefinedTermDetailSection(this, definedTermClass
, conversation
, parentElement
,
1700 selectionProvider
, style
);
1702 parentElement
.addElement(section
);
1708 public TermMediaSection
createTermMediaSection(ConversationHolder conversation
,
1709 ICdmFormElement parentElement
, int style
) {
1710 TermMediaSection section
= new TermMediaSection(this, conversation
, parentElement
, style
);
1711 parentElement
.addElement(section
);
1718 * @param definedTermClass
1719 * @param formElement
1723 public AbstractCdmDetailElement
createDefinedTermDetailElement(Class definedTermClass
,
1724 AbstractCdmDetailSection parentElement
, int style
) {
1725 AbstractCdmDetailElement element
= null;
1727 if (NamedArea
.class.isAssignableFrom(definedTermClass
)) {
1728 element
= new eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement(this, parentElement
);
1729 } else if (definedTermClass
.equals(Feature
.class)) {
1730 element
= new FeatureDetailElement(this, parentElement
);
1731 } else if(definedTermClass
.equals(PresenceAbsenceTerm
.class)){
1732 element
= new PresenceAbsenceTermDetailElement(this, parentElement
);
1734 element
= new DefinedTermDetailElement(this, parentElement
);
1739 parentElement
.addElement(element
);
1743 public CharacterNodeDetailSection
createCharacterNodeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1744 CharacterNodeDetailSection section
= new CharacterNodeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1745 addAndAdaptSection(parentElement
, section
);
1749 public CharacterDetailSection
createCharacterDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1750 CharacterDetailSection section
= new CharacterDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1751 addAndAdaptSection(parentElement
, section
);
1755 public CharacterNodeDetailElement
createCharacterNodeDetailElement(ICdmFormElement parentElement
, int style
){
1756 CharacterNodeDetailElement element
= new CharacterNodeDetailElement(this, parentElement
);
1757 addAndAdaptElement(parentElement
, element
);
1761 public CharacterDetailElement
createCharacterDetailElement(ICdmFormElement parentElement
, int style
){
1762 CharacterDetailElement element
= new CharacterDetailElement(this, parentElement
);
1763 addAndAdaptElement(parentElement
, element
);
1767 public FeatureTreeDetailElement
createFeatureTreeDetailElement(ICdmFormElement parentElement
, int style
){
1768 FeatureTreeDetailElement element
= new FeatureTreeDetailElement(this, parentElement
);
1769 addAndAdaptElement(parentElement
, element
);
1773 public FeatureNodeDetailElement
createFeatureNodeDetailElement(ICdmFormElement parentElement
, int style
){
1774 FeatureNodeDetailElement element
= new FeatureNodeDetailElement(this, parentElement
);
1775 addAndAdaptElement(parentElement
, element
);
1780 //--------DetailSections---------
1781 public NameDetailSection
createNameDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1782 NameDetailSection section
= new NameDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1783 addAndAdaptSection(parentElement
, section
);
1787 public FeatureNodeDetailSection
createFeatureNodeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1788 FeatureNodeDetailSection section
= new FeatureNodeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1789 addAndAdaptSection(parentElement
, section
);
1793 public FeatureTreeDetailSection
createFeatureTreeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1794 FeatureTreeDetailSection section
= new FeatureTreeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1795 addAndAdaptSection(parentElement
, section
);
1799 public ReferenceDetailSection
createReferenceDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1800 ReferenceDetailSection section
= new ReferenceDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1801 addAndAdaptSection(parentElement
, section
);
1805 public NomenclaturalReferenceDetailSection
createNomenclaturalReferenceDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1806 NomenclaturalReferenceDetailSection section
= new NomenclaturalReferenceDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1807 addAndAdaptSection(parentElement
, section
);
1811 public TaxonBaseDetailSection
createTaxonBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1812 TaxonBaseDetailSection section
= new TaxonBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1813 addAndAdaptSection(parentElement
, section
);
1817 public AuthorshipDetailSection
createAuthorshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1818 AuthorshipDetailSection section
= new AuthorshipDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1819 addAndAdaptSection(parentElement
, section
);
1823 public TeamOrPersonBaseDetailSection
createTeamOrPersonBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1824 TeamOrPersonBaseDetailSection section
= new TeamOrPersonBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1825 addAndAdaptSection(parentElement
, section
);
1829 public TeamDetailSection
createTeamDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1830 TeamDetailSection section
= new TeamDetailSection(this, conversation
, parentElement
, null, style
);
1831 addAndAdaptSection(parentElement
, section
);
1835 public PersonDetailSection
createPersonDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1836 PersonDetailSection section
= new PersonDetailSection(this, conversation
, parentElement
, null, style
);
1837 addAndAdaptSection(parentElement
, section
);
1841 public DescriptionDetailSection
createDescriptionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1842 DescriptionDetailSection section
= new DescriptionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1843 addAndAdaptSection(parentElement
, section
);
1847 public DescriptionElementDetailSection
createDescriptionElementDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1848 DescriptionElementDetailSection section
= new DescriptionElementDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1849 addAndAdaptSection(parentElement
, section
);
1853 public ParsingMessagesSection
createParsingMessagesSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1854 ParsingMessagesSection section
= new ParsingMessagesSection(this, conversation
, parentElement
, selectionProvider
, style
);
1855 addAndAdaptSection(parentElement
, section
);
1861 public NonViralNameDetailSection
createNonViralNameDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, boolean nameChoosable
, int style
){
1862 NonViralNameDetailSection section
= new NonViralNameDetailSection(this, conversation
, parentElement
, selectionProvider
, nameChoosable
, style
);
1863 addAndAdaptSection(parentElement
, section
);
1867 public MediaDetailsSection
createMediaDetailsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1868 MediaDetailsSection section
= new MediaDetailsSection(this, conversation
, parentElement
, selectionProvider
, style
);
1869 addAndAdaptSection(parentElement
, section
);
1873 public FieldUnitDetailSection
createFieldUnitDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1874 FieldUnitDetailSection section
= new FieldUnitDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1875 addAndAdaptSection(parentElement
, section
);
1879 public GatheringEventDetailSection
createGatheringEventDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1880 GatheringEventDetailSection section
= new GatheringEventDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1881 addAndAdaptSection(parentElement
, section
);
1885 public DerivedUnitBaseDetailSection
createDerivedUnitBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1886 DerivedUnitBaseDetailSection section
= new DerivedUnitBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1887 addAndAdaptSection(parentElement
, section
);
1891 public DerivedUnitTypeDesignationSection
createDerivedUnitTypeDesignationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1892 DerivedUnitTypeDesignationSection section
= new DerivedUnitTypeDesignationSection(this, conversation
, parentElement
, style
);
1893 addAndAdaptSection(parentElement
, section
);
1897 public TaxonAssociationDetailSection
createTaxonAssociationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1898 TaxonAssociationDetailSection section
= new TaxonAssociationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1899 addAndAdaptSection(parentElement
, section
);
1903 public OriginalLabelDataSection
createOriginalLabelDataSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1904 OriginalLabelDataSection section
= new OriginalLabelDataSection(this, conversation
, parentElement
, selectionProvider
, style
);
1905 addAndAdaptSection(parentElement
, section
);
1909 public NaturalLanguageSection
createNaturalLanguageSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1910 NaturalLanguageSection section
= new NaturalLanguageSection(this, conversation
, parentElement
, selectionProvider
, style
);
1911 addAndAdaptSection(parentElement
, section
);
1915 public FeatureDistributionDetailSection
createFeatureDistributionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1916 FeatureDistributionDetailSection section
= new FeatureDistributionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1917 addAndAdaptSection(parentElement
, section
);
1921 public ClassificationDetailSection
createClassificationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1922 ClassificationDetailSection section
= new ClassificationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1923 addAndAdaptSection(parentElement
, section
);
1927 public TaxonNodeDetailSection
createTaxonNodeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1928 TaxonNodeDetailSection section
= new TaxonNodeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1929 addAndAdaptSection(parentElement
, section
);
1933 public PolytomousKeyDetailSection
createPolytomousKeyDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1934 PolytomousKeyDetailSection section
= new PolytomousKeyDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1935 addAndAdaptSection(parentElement
, section
);
1939 public PolytomousKeyNodeDetailSection
createPolytomousKeyNodeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1940 PolytomousKeyNodeDetailSection section
= new PolytomousKeyNodeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1941 addAndAdaptSection(parentElement
, section
);
1945 public InstitutionDetailSection
createInstitutionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1946 InstitutionDetailSection section
= new InstitutionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1947 addAndAdaptSection(parentElement
, section
);
1951 public FieldUnitGeneralDetailSection
createFieldUnitGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1952 FieldUnitGeneralDetailSection section
= new FieldUnitGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1953 addAndAdaptSection(parentElement
, section
);
1957 public DerivedUnitGeneralDetailSection
createDerivedUnitGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1958 DerivedUnitGeneralDetailSection section
= new DerivedUnitGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1959 addAndAdaptSection(parentElement
, section
);
1963 public PreservedSpecimenGeneralDetailSection
createPreservedSpecimenGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1964 PreservedSpecimenGeneralDetailSection section
= new PreservedSpecimenGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1965 addAndAdaptSection(parentElement
, section
);
1969 public TissueSampleGeneralDetailSection
createTissueSampleGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1970 TissueSampleGeneralDetailSection section
= new TissueSampleGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1971 addAndAdaptSection(parentElement
, section
);
1975 public DnaSampleGeneralDetailSection
createDnaSampleGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1976 DnaSampleGeneralDetailSection section
= new DnaSampleGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1977 addAndAdaptSection(parentElement
, section
);
1981 public DnaSamplePreparationPreservationSection
createDnaSamplePreparationPreservationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1982 DnaSamplePreparationPreservationSection section
= new DnaSamplePreparationPreservationSection(this, conversation
, parentElement
, selectionProvider
, style
);
1983 addAndAdaptSection(parentElement
, section
);
1987 public DnaQualityDetailSection
createDnaQualityDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1988 DnaQualityDetailSection section
= new DnaQualityDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1989 addAndAdaptSection(parentElement
, section
);
1993 public SequenceGeneralDetailSection
createSequenceGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1994 SequenceGeneralDetailSection section
= new SequenceGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1995 addAndAdaptSection(parentElement
, section
);
1999 public SequenceContigFileCollectionDetailSection
createSequenceContigFileCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2000 SequenceContigFileCollectionDetailSection section
= new SequenceContigFileCollectionDetailSection(this, conversation
, parentElement
, style
);
2001 addAndAdaptSection(parentElement
, section
);
2005 public SingleReadPherogramCollectionDetailSection
createSingleReadPherogramCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2006 SingleReadPherogramCollectionDetailSection section
= new SingleReadPherogramCollectionDetailSection(this, conversation
, parentElement
, style
);
2007 addAndAdaptSection(parentElement
, section
);
2011 public SequenceReferenceCollectionDetailSection
createSequenceReferenceCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2012 SequenceReferenceCollectionDetailSection section
= new SequenceReferenceCollectionDetailSection(this, conversation
, parentElement
, style
);
2013 addAndAdaptSection(parentElement
, section
);
2017 public SingleReadGeneralDetailSection
createSingleReadGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
2018 SingleReadGeneralDetailSection section
= new SingleReadGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
2019 addAndAdaptSection(parentElement
, section
);
2023 public AmplificationGeneralDetailSection
createAmplificationGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
2024 AmplificationGeneralDetailSection section
= new AmplificationGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
2025 addAndAdaptSection(parentElement
, section
);
2029 public AmplificationPrimerDetailSection
createAmplificationPrimerDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
2030 AmplificationPrimerDetailSection section
= new AmplificationPrimerDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
2031 addAndAdaptSection(parentElement
, section
);
2035 public AmplificationCloningDetailSection
createAmplificationCloningDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
2036 AmplificationCloningDetailSection section
= new AmplificationCloningDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
2037 addAndAdaptSection(parentElement
, section
);
2041 public AmplificationGelPhotoCollectionDetailSection
createAmplificationGelPhotoCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2042 AmplificationGelPhotoCollectionDetailSection section
= new AmplificationGelPhotoCollectionDetailSection(this, conversation
, parentElement
, style
);
2043 addAndAdaptSection(parentElement
, section
);
2047 public MediaSpecimenGeneralDetailSection
createMediaSpecimenGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
2048 MediaSpecimenGeneralDetailSection section
= new MediaSpecimenGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
2049 addAndAdaptSection(parentElement
, section
);
2053 public HybridDetailSection
createHybridDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
2054 HybridDetailSection section
= new HybridDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
2055 addAndAdaptSection(parentElement
, section
);
2059 public UserDetailSection
createUserDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
2060 UserDetailSection section
= new UserDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
2061 addAndAdaptSection(parentElement
, section
);
2065 public GroupDetailSection
createGroupDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
2066 GroupDetailSection section
= new GroupDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
2067 addAndAdaptSection(parentElement
, section
);
2071 public DeterminationDetailSection
createDeterminationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
2072 DeterminationDetailSection section
= new DeterminationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
2073 addAndAdaptSection(parentElement
, section
);
2077 public SampleDesignationDetailSection
createSampleDesignationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
2078 SampleDesignationDetailSection section
= new SampleDesignationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
2079 addAndAdaptSection(parentElement
, section
);
2083 public TaxonRelationshipDetailSection
createTaxonRelationshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
2084 TaxonRelationshipDetailSection section
= new TaxonRelationshipDetailSection(this, conversation
, parentElement
, selectionProvider
, style
, true);
2085 addAndAdaptSection(parentElement
, section
);
2089 public ReferencedEntityDetailSection
createReferencedEntityDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
2090 ReferencedEntityDetailSection section
= new ReferencedEntityDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
2091 addAndAdaptSection(parentElement
, section
);
2095 public TermVocabularyDetailSection
createTermVocabularyDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
2096 TermVocabularyDetailSection section
= new TermVocabularyDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
2097 addAndAdaptSection(parentElement
, section
);
2101 public GatheringEventDetailSection
createGatheringSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
2102 GatheringEventDetailSection section
= new GatheringEventDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
2103 addAndAdaptSection(parentElement
, section
);
2107 public NamedAreaDetailSection
createNamedAreaDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
2108 NamedAreaDetailSection section
= new NamedAreaDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
2109 addAndAdaptSection(parentElement
, section
);
2113 public UseRecordDetailSection
createUseRecordDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
2114 UseRecordDetailSection section
= new UseRecordDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
2115 addAndAdaptSection(parentElement
, section
);
2119 private void addAndAdaptSection(ICdmFormElement parentElement
, AbstractFormSection
<?
> section
) {
2120 parentElement
.addElement(section
);
2124 //--------DetailElements------------
2126 public UseRecordDetailElement
createUseRecordDetailElement(ICdmFormElement parentElement
){
2127 UseRecordDetailElement element
= new UseRecordDetailElement(this, parentElement
);
2128 addAndAdaptElement(parentElement
, element
);
2132 public DefinedTermDetailElement
<NamedAreaLevel
> createNamedAreaLevelElement(ICdmFormElement parentElement
){
2133 DefinedTermDetailElement
<NamedAreaLevel
> element
= new DefinedTermDetailElement
<NamedAreaLevel
>(this, parentElement
);
2134 addAndAdaptElement(parentElement
, element
);
2138 public eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement
createNamedAreaDetailElement(ICdmFormElement parentElement
){
2139 eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement element
= new eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement(this, parentElement
);
2140 addAndAdaptElement(parentElement
, element
);
2144 public TermVocabularyDetailElement
createTermVocabularyDetailElement(ICdmFormElement parentElement
){
2145 TermVocabularyDetailElement element
= new TermVocabularyDetailElement(this, parentElement
);
2146 addAndAdaptElement(parentElement
, element
);
2150 public ReferenceEntityDetailElement
createReferenceEntityDetailElement(ICdmFormElement parentElement
){
2151 ReferenceEntityDetailElement element
= new ReferenceEntityDetailElement(this, parentElement
);
2152 addAndAdaptElement(parentElement
, element
);
2156 public TaxonRelationshipDetailElement
createTaxonRelationshipDetailElement(ICdmFormElement parentElement
){
2157 TaxonRelationshipDetailElement element
= new TaxonRelationshipDetailElement(this, parentElement
);
2158 addAndAdaptElement(parentElement
, element
);
2162 public GrantedAuthorityDetailElement
createGrantedAuthorityDetailElement(ICdmFormElement parentElement
){
2163 GrantedAuthorityDetailElement element
= new GrantedAuthorityDetailElement(this, parentElement
);
2164 addAndAdaptElement(parentElement
, element
);
2168 public GroupDetailElement
createGroupDetailElement(ICdmFormElement parentElement
){
2169 GroupDetailElement element
= new GroupDetailElement(this, parentElement
);
2170 addAndAdaptElement(parentElement
, element
);
2174 public UserDetailElement
createUserDetailElement(ICdmFormElement parentElement
){
2175 UserDetailElement element
= new UserDetailElement(this, parentElement
);
2176 addAndAdaptElement(parentElement
, element
);
2180 public HybridDetailElement
createHybridDetailElement(ICdmFormElement parentElement
){
2181 HybridDetailElement element
= new HybridDetailElement(this, parentElement
);
2182 addAndAdaptElement(parentElement
, element
);
2186 public InstitutionDetailElement
createInstitutionDetailElement(ICdmFormElement parentElement
){
2187 InstitutionDetailElement element
= new InstitutionDetailElement(this, parentElement
);
2188 addAndAdaptElement(parentElement
, element
);
2192 public PolytomousKeyNodeDetailElement
createPolytomousKeyNodeDetailElement(ICdmFormElement parentElement
){
2193 PolytomousKeyNodeDetailElement element
= new PolytomousKeyNodeDetailElement(this, parentElement
);
2194 addAndAdaptElement(parentElement
, element
);
2198 public PolytomousKeyDetailElement
createPolytomousKeyDetailElement(ICdmFormElement parentElement
){
2199 PolytomousKeyDetailElement element
= new PolytomousKeyDetailElement(this, parentElement
);
2200 addAndAdaptElement(parentElement
, element
);
2204 public CollectionDetailElement
createCollectionDetailElement(ICdmFormElement parentElement
){
2205 CollectionDetailElement element
= new CollectionDetailElement(this, parentElement
);
2206 addAndAdaptElement(parentElement
, element
);
2210 public TaxonNodeAgentRelationCollectionSection
createTaxonNodeAgentRelationCollectionElement(ICdmFormElement parentElement
, ConversationHolder conversation
, int style
){
2211 TaxonNodeAgentRelationCollectionSection element
= new TaxonNodeAgentRelationCollectionSection(this, conversation
, parentElement
, style
);
2213 parentElement
.addElement(element
);
2218 public TaxonNodeDetailElement
createTaxonNodeDetailElement(ICdmFormElement parentElement
, boolean createNew
){
2219 TaxonNodeDetailElement element
= new TaxonNodeDetailElement(this, parentElement
, createNew
);
2220 addAndAdaptElement(parentElement
, element
);
2224 public ClassificationDetailElement
createClassificationDetailElement(ICdmFormElement parentElement
){
2225 ClassificationDetailElement element
= new ClassificationDetailElement(this, parentElement
);
2226 addAndAdaptElement(parentElement
, element
);
2230 public CloneClassificationDetailElement
createCloneClassificationDetailElement(ICdmFormElement parentElement
){
2231 CloneClassificationDetailElement element
= new CloneClassificationDetailElement(this, parentElement
);
2232 addAndAdaptElement(parentElement
, element
);
2236 public FeatureDistributionDetailElement
createFeatureDistributionDetailElement(ICdmFormElement parentElement
){
2237 FeatureDistributionDetailElement element
= new FeatureDistributionDetailElement(this, parentElement
);
2238 addAndAdaptElement(parentElement
, element
);
2242 public NaturalLanguageDetailElement
createNaturalLanguageDetailElement(ICdmFormElement parentElement
){
2243 NaturalLanguageDetailElement element
= new NaturalLanguageDetailElement(this, parentElement
);
2244 addAndAdaptElement(parentElement
, element
);
2248 public NonViralNameDetailElement
createNonViralNameDetailElement(ICdmFormElement parentElement
){
2249 NonViralNameDetailElement element
= new NonViralNameDetailElement(this, parentElement
);
2250 addAndAdaptElement(parentElement
, element
);
2254 public DescriptionElementDetailElement
createDescriptionElementDetailElement(ICdmFormElement parentElement
, int style
){
2255 DescriptionElementDetailElement element
= new DescriptionElementDetailElement(this, parentElement
, style
);
2256 addAndAdaptElement(parentElement
, element
);
2260 public DescriptionDetailElement
createDescriptionDetailElement(ICdmFormElement parentElement
, int style
){
2261 DescriptionDetailElement element
= new DescriptionDetailElement(this, parentElement
, style
);
2262 addAndAdaptElement(parentElement
, element
);
2266 public PersonDetailElement
createPersonDetailElement(ICdmFormElement parentElement
, int style
){
2267 PersonDetailElement element
= new PersonDetailElement(this, parentElement
, style
);
2268 addAndAdaptElement(parentElement
, element
);
2272 public TeamDetailElement
createTeamDetailElement(ICdmFormElement parentElement
, int style
, boolean isNomenclatural
){
2273 TeamDetailElement element
= new TeamDetailElement(this, parentElement
, style
, isNomenclatural
);
2274 addAndAdaptElement(parentElement
, element
);
2278 public AuthorshipDetailElement
createAuthorshipDetailElement(ICdmFormElement parentElement
, int style
){
2279 AuthorshipDetailElement element
= new AuthorshipDetailElement(this, parentElement
, style
);
2280 addAndAdaptElement(parentElement
, element
);
2284 public TaxonBaseDetailElement
createTaxonBaseDetailElement(ICdmFormElement parentElement
, int style
){
2285 TaxonBaseDetailElement element
= new TaxonBaseDetailElement(this, parentElement
, style
);
2286 addAndAdaptElement(parentElement
, element
);
2290 public NameDetailElement
createNameDetailElement(ICdmFormElement parentElement
, int style
){
2291 NameDetailElement element
= new NameDetailElement(this, parentElement
, style
);
2292 addAndAdaptElement(parentElement
, element
);
2296 public ReferenceDetailElement
createReferenceDetailElement(ICdmFormElement parentElement
, int style
, boolean isWizard
){
2297 ReferenceDetailElement element
= new ReferenceDetailElement(this, parentElement
, style
, isWizard
);
2298 addAndAdaptElement(parentElement
, element
);
2302 public NomenclaturalReferenceDetailElement
createNomenclaturalReferenceDetailElement(ICdmFormElement parentElement
, int style
){
2303 NomenclaturalReferenceDetailElement element
= new NomenclaturalReferenceDetailElement(this, parentElement
, style
);
2304 addAndAdaptElement(parentElement
, element
);
2309 public FieldUnitGeneralDetailElement
createFieldUnitGeneralDetailElement(ICdmFormElement parentElement
){
2310 FieldUnitGeneralDetailElement element
= new FieldUnitGeneralDetailElement(this, parentElement
);
2311 addAndAdaptElement(parentElement
, element
);
2315 public DerivedUnitGeneralDetailElement
createDerivedUnitGeneralDetailElement(ICdmFormElement parentElement
){
2316 DerivedUnitGeneralDetailElement element
= new DerivedUnitGeneralDetailElement(this, parentElement
);
2317 addAndAdaptElement(parentElement
, element
);
2321 public TaxonAssociationDetailElement
createTaxonAssociationDetailElement(ICdmFormElement parentElement
){
2322 TaxonAssociationDetailElement element
= new TaxonAssociationDetailElement(this, parentElement
);
2323 addAndAdaptElement(parentElement
, element
);
2327 public PreservedSpecimenGeneralDetailElement
createPreservedSpecimenGeneralDetailElement(ICdmFormElement parentElement
){
2328 PreservedSpecimenGeneralDetailElement element
= new PreservedSpecimenGeneralDetailElement(this, parentElement
);
2329 addAndAdaptElement(parentElement
, element
);
2333 public TissueSampleGeneralDetailElement
createTissueSampleGeneralDetailElement(ICdmFormElement parentElement
){
2334 TissueSampleGeneralDetailElement element
= new TissueSampleGeneralDetailElement(this, parentElement
);
2335 addAndAdaptElement(parentElement
, element
);
2339 public DnaSampleGeneralDetailElement
createDnaSampleGeneralDetailElement(ICdmFormElement parentElement
){
2340 DnaSampleGeneralDetailElement element
= new DnaSampleGeneralDetailElement(this, parentElement
);
2341 addAndAdaptElement(parentElement
, element
);
2345 public DnaSamplePreparationPreservationDetailElement
createDnaSamplePreparationPreservationDetailElement(ICdmFormElement parentElement
){
2346 DnaSamplePreparationPreservationDetailElement element
= new DnaSamplePreparationPreservationDetailElement(this, parentElement
);
2347 addAndAdaptElement(parentElement
, element
);
2351 public DnaQualityDetailElement
createDnaQualityDetailElement(ICdmFormElement parentElement
){
2352 DnaQualityDetailElement element
= new DnaQualityDetailElement(this, parentElement
);
2353 addAndAdaptElement(parentElement
, element
);
2357 public SequenceGeneralDetailElement
createSequenceGeneralDetailElement(ICdmFormElement parentElement
){
2358 SequenceGeneralDetailElement element
= new SequenceGeneralDetailElement(this, parentElement
);
2359 addAndAdaptElement(parentElement
, element
);
2363 public SingleReadGeneralDetailElement
createSingleReadGeneralDetailElement(ICdmFormElement parentElement
){
2364 SingleReadGeneralDetailElement element
= new SingleReadGeneralDetailElement(this, parentElement
);
2365 addAndAdaptElement(parentElement
, element
);
2369 public PrimerGeneralDetailElement
createPrimerGeneralDetailElement(ICdmFormElement parentElement
){
2370 PrimerGeneralDetailElement element
= new PrimerGeneralDetailElement(this, parentElement
);
2371 addAndAdaptElement(parentElement
, element
);
2375 public AmplificationGeneralDetailElement
createAmplificationGeneralDetailElement(ICdmFormElement parentElement
){
2376 AmplificationGeneralDetailElement element
= new AmplificationGeneralDetailElement(this, parentElement
);
2377 addAndAdaptElement(parentElement
, element
);
2381 public AmplificationPrimerDetailElement
createAmplificationPrimerDetailElement(ICdmFormElement parentElement
){
2382 AmplificationPrimerDetailElement element
= new AmplificationPrimerDetailElement(this, parentElement
);
2383 addAndAdaptElement(parentElement
, element
);
2387 public AmplificationCloningDetailElement
createAmplificationCloningDetailElement(ICdmFormElement parentElement
){
2388 AmplificationCloningDetailElement element
= new AmplificationCloningDetailElement(this, parentElement
);
2389 addAndAdaptElement(parentElement
, element
);
2393 public AmplificationGelPhotoDetailElement
createAmplificationGelPhotoDetailElement(ICdmFormElement parentElement
){
2394 AmplificationGelPhotoDetailElement element
= new AmplificationGelPhotoDetailElement(this, parentElement
);
2395 addAndAdaptElement(parentElement
, element
);
2399 public MediaSpecimenGeneralDetailElement
createMediaSpecimenGeneralDetailElement(ICdmFormElement parentElement
){
2400 MediaSpecimenGeneralDetailElement element
= new MediaSpecimenGeneralDetailElement(this, parentElement
);
2401 addAndAdaptElement(parentElement
, element
);
2405 public MediaDetailElement
createMediaDetailElement(ICdmFormElement parentElement
){
2406 MediaDetailElement mediaDetailElement
= new MediaDetailElement(this, parentElement
);
2407 addAndAdaptElement(parentElement
, mediaDetailElement
);
2408 return mediaDetailElement
;
2411 public GatheringEventDetailElement
createGatheringEventDetailElement(ICdmFormElement parentElement
) {
2412 GatheringEventDetailElement element
= new GatheringEventDetailElement(this, parentElement
);
2413 addAndAdaptElement(parentElement
, element
);
2417 public FieldUnitDetailElement
createFieldUnitDetailElement(ICdmFormElement parentElement
) {
2418 FieldUnitDetailElement element
= new FieldUnitDetailElement(this, parentElement
);
2419 addAndAdaptElement(parentElement
, element
);
2423 public DerivedUnitBaseDetailElement
createDerivedUnitBaseDetailElement(ICdmFormElement parentElement
) {
2424 DerivedUnitBaseDetailElement element
= new DerivedUnitBaseDetailElement(this, parentElement
);
2425 addAndAdaptElement(parentElement
, element
);
2429 public OriginalLabelDataElement
createOriginalLabelDataElement(ICdmFormElement parentElement
) {
2430 OriginalLabelDataElement element
= new OriginalLabelDataElement(this, parentElement
);
2431 addAndAdaptElement(parentElement
, element
);
2435 public PreservedSpecimenDetailElement
createPreservedSpecimenDetailElement(ICdmFormElement parentElement
) {
2436 PreservedSpecimenDetailElement element
= new PreservedSpecimenDetailElement(this, parentElement
);
2437 addAndAdaptElement(parentElement
, element
);
2441 public DeterminationDetailElement
createDeterminationDetailElement(ICdmFormElement parentElement
) {
2442 DeterminationDetailElement element
= new DeterminationDetailElement(this, parentElement
);
2443 addAndAdaptElement(parentElement
, element
);
2447 public SampleDesignationDetailElement
createSampleDesignationDetailElement(ICdmFormElement parentElement
) {
2448 SampleDesignationDetailElement element
= new SampleDesignationDetailElement(this, parentElement
);
2449 addAndAdaptElement(parentElement
, element
);
2454 * @param parentElement
2457 private void addAndAdaptElement(ICdmFormElement parentElement
, AbstractCdmDetailElement
<?
> element
) {
2459 parentElement
.addElement(element
);
2462 //--------EntityCollectionSection----------
2463 public TeamMemberSection
createTeamMemberSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
, boolean isNomenclatural
){
2464 TeamMemberSection section
= new TeamMemberSection(this, conversation
, parentElement
, style
, isNomenclatural
);
2465 addAndAdaptSection(parentElement
, section
);
2469 public InapplicableIfEntityCollectionSection
createInapplicableIfEntityCollectionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2470 InapplicableIfEntityCollectionSection section
= new InapplicableIfEntityCollectionSection(this, conversation
, parentElement
, style
);
2471 addAndAdaptSection(parentElement
, section
);
2475 public OnlyApplicableIfEntityCollectionSection
createOnlyApplicableIfEntityCollectionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2476 OnlyApplicableIfEntityCollectionSection section
= new OnlyApplicableIfEntityCollectionSection(this, conversation
, parentElement
, style
);
2477 addAndAdaptSection(parentElement
, section
);
2481 public AnnotationSection
createAnnotationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2482 AnnotationSection section
= new AnnotationSection(this, conversation
, parentElement
, style
);
2483 addAndAdaptSection(parentElement
, section
);
2487 public CreditSection
createCreditSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2488 CreditSection section
= new CreditSection(this, conversation
, parentElement
, style
);
2489 addAndAdaptSection(parentElement
, section
);
2493 public DescriptionElementSourceSection
createDescriptionElementSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2494 DescriptionElementSourceSection section
= new DescriptionElementSourceSection(this, conversation
, parentElement
, style
);
2495 addAndAdaptSection(parentElement
, section
);
2499 public ExtensionSection
createExtensionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2500 ExtensionSection section
= new ExtensionSection(this, conversation
, parentElement
, style
);
2501 addAndAdaptSection(parentElement
, section
);
2505 public MarkerSection
createMarkerSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2506 MarkerSection section
= new MarkerSection(this, conversation
, parentElement
, style
);
2507 addAndAdaptSection(parentElement
, section
);
2511 public MediaSection
createMediaSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2512 MediaSection section
= new MediaSection(this, conversation
, parentElement
, style
);
2513 addAndAdaptSection(parentElement
, section
);
2517 public DescriptionElementMediaSection
createDescriptionElementMediaSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2518 DescriptionElementMediaSection section
= new DescriptionElementMediaSection(this, conversation
, parentElement
, style
);
2519 addAndAdaptSection(parentElement
, section
);
2523 public MediaRepresentationSection
createMediaRepresentationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2524 MediaRepresentationSection section
= new MediaRepresentationSection(this, conversation
, parentElement
, style
);
2525 addAndAdaptSection(parentElement
, section
);
2529 public MediaRepresentationPartSection
createMediaRepresentationPartSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2530 MediaRepresentationPartSection section
= new MediaRepresentationPartSection(this, conversation
, parentElement
, style
);
2531 addAndAdaptSection(parentElement
, section
);
2535 public ModifierSection
createModifierSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2536 ModifierSection section
= new ModifierSection(this, conversation
, parentElement
, style
);
2537 addAndAdaptSection(parentElement
, section
);
2541 public NomenclaturalStatusSection
createNomenclaturalStatusSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2542 NomenclaturalStatusSection section
= new NomenclaturalStatusSection(this, conversation
, parentElement
, style
);
2543 addAndAdaptSection(parentElement
, section
);
2547 public NameRelationshipDetailSection
createNameRelationshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2548 NameRelationshipDetailSection section
= new NameRelationshipDetailSection(this, conversation
, parentElement
, style
);
2549 addAndAdaptSection(parentElement
, section
);
2553 public ProtologueSection
createProtologueSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2554 ProtologueSection section
= new ProtologueSection(this, conversation
, parentElement
, style
);
2555 addAndAdaptSection(parentElement
, section
);
2558 public ExternalLinksSection
createExternalLinksSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2559 ExternalLinksSection section
= new ExternalLinksSection(this, conversation
, parentElement
, style
);
2560 addAndAdaptSection(parentElement
, section
);
2564 public RightsSection
createRightsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2565 RightsSection section
= new RightsSection(this, conversation
, parentElement
, style
);
2566 addAndAdaptSection(parentElement
, section
);
2570 public SourceSection
createSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2571 SourceSection section
= new SourceSection(this, conversation
, parentElement
, style
);
2572 addAndAdaptSection(parentElement
, section
);
2576 public ScopeSection
createScopeSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2577 ScopeSection section
= new ScopeSection(this, conversation
, parentElement
, style
);
2578 addAndAdaptSection(parentElement
, section
);
2582 public DescriptionSourceSection
createDescriptionSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2583 DescriptionSourceSection section
= new DescriptionSourceSection(this, conversation
, parentElement
, style
);
2584 addAndAdaptSection(parentElement
, section
);
2588 public TypeDesignationSection
createTypeDesignationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2589 TypeDesignationSection section
= new TypeDesignationSection(this, conversation
, parentElement
, style
);
2590 addAndAdaptSection(parentElement
, section
);
2594 public StateDataSection
createStateDataSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2595 StateDataSection section
= new StateDataSection(this, conversation
, parentElement
, style
);
2596 addAndAdaptSection(parentElement
, section
);
2600 public StatisticalMeasurementValueSection
createStatisticalMeasurementValueSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2601 StatisticalMeasurementValueSection section
= new StatisticalMeasurementValueSection(this, conversation
, parentElement
, style
);
2602 addAndAdaptSection(parentElement
, section
);
2606 public DescribedSpecimenSection
createDescribedSpecimenSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2607 DescribedSpecimenSection section
= new DescribedSpecimenSection(this, conversation
, parentElement
, style
);
2608 addAndAdaptSection(parentElement
, section
);
2612 public StateVocabularyCollectionSection
createStateVocabulariesSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2613 StateVocabularyCollectionSection section
= new StateVocabularyCollectionSection(this, conversation
, parentElement
, style
);
2614 addAndAdaptSection(parentElement
, section
);
2618 public RecommendedModifierVocabulariesCollectionSection
createRecommendedModifierVocabulariesCollectionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2619 RecommendedModifierVocabulariesCollectionSection section
= new RecommendedModifierVocabulariesCollectionSection(this, conversation
, parentElement
, style
);
2620 addAndAdaptSection(parentElement
, section
);
2624 public MeasurementUnitCollectionSection
createMeasurementUnitCollectionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2625 MeasurementUnitCollectionSection section
= new MeasurementUnitCollectionSection(this, conversation
, parentElement
, style
);
2626 addAndAdaptSection(parentElement
, section
);
2630 public StatisticalMeasureCollectionSection
createStatisticalMeasureCollectionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2631 StatisticalMeasureCollectionSection section
= new StatisticalMeasureCollectionSection(this, conversation
, parentElement
, style
);
2632 addAndAdaptSection(parentElement
, section
);
2636 public CollectingAreasDetailSection
createCollectingAreasDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2637 CollectingAreasDetailSection section
= new CollectingAreasDetailSection(this, conversation
, parentElement
, style
);
2638 addAndAdaptSection(parentElement
, section
);
2642 public GeoScopeDetailSection
createGeoScopeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2643 GeoScopeDetailSection section
= new GeoScopeDetailSection(this, conversation
, parentElement
, style
);
2644 addAndAdaptSection(parentElement
, section
);
2648 public GeoScopePolyKeyDetailSection
createGeoScopePolyKeyDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2649 GeoScopePolyKeyDetailSection section
= new GeoScopePolyKeyDetailSection(this, conversation
, parentElement
, style
);
2650 addAndAdaptSection(parentElement
, section
);
2654 public IdentifierSection
createIdentifierDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2655 IdentifierSection section
= new IdentifierSection(this, conversation
, parentElement
, style
);
2656 addAndAdaptSection(parentElement
, section
);
2660 public DerivedUnitFacadeIdentifierSection
createDerivedUnitFacadeIdentifierSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2661 DerivedUnitFacadeIdentifierSection section
= new DerivedUnitFacadeIdentifierSection(this, conversation
, parentElement
, style
);
2662 addAndAdaptSection(parentElement
, section
);
2666 public CurrentSampleDesignationDetailSection
createCurrentSampleDesignationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2667 CurrentSampleDesignationDetailSection section
= new CurrentSampleDesignationDetailSection(this, conversation
, parentElement
, style
);
2668 addAndAdaptSection(parentElement
, section
);
2672 public CurrentDeterminationDetailSection
createCurrentDeterminationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2673 CurrentDeterminationDetailSection section
= new CurrentDeterminationDetailSection(this, conversation
, parentElement
, style
);
2674 addAndAdaptSection(parentElement
, section
);
2678 public PreservedSpecimenCurrentDeterminationDetailSection
createPreservedSpecimenCurrentDeterminationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2679 PreservedSpecimenCurrentDeterminationDetailSection section
= new PreservedSpecimenCurrentDeterminationDetailSection(this, conversation
, parentElement
, style
);
2680 addAndAdaptSection(parentElement
, section
);
2684 public SampleDesignationHistoryDetailSection
createSampleDesignationHistoryDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2685 SampleDesignationHistoryDetailSection section
= new SampleDesignationHistoryDetailSection(this, conversation
, parentElement
, style
);
2686 addAndAdaptSection(parentElement
, section
);
2690 public DeterminationHistoryDetailSection
createDeterminationHistoryDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2691 DeterminationHistoryDetailSection section
= new DeterminationHistoryDetailSection(this, conversation
, parentElement
, style
);
2692 addAndAdaptSection(parentElement
, section
);
2696 public SpecimenCollectionDetailSection
createSpecimenCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2697 SpecimenCollectionDetailSection section
= new SpecimenCollectionDetailSection(this, conversation
, parentElement
, style
);
2698 addAndAdaptSection(parentElement
, section
);
2702 public PreservedSpecimenSourceCollectionDetailSection
createPreservedSpecimenSourceCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2703 PreservedSpecimenSourceCollectionDetailSection section
= new PreservedSpecimenSourceCollectionDetailSection(this, conversation
, parentElement
, style
);
2704 addAndAdaptSection(parentElement
, section
);
2708 public SourceCollectionDetailSection
createSourceCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2709 SourceCollectionDetailSection section
= new SourceCollectionDetailSection(this, conversation
, parentElement
, style
);
2710 addAndAdaptSection(parentElement
, section
);
2714 public ScopeRestrictionSection
createScopeRestrictionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2715 ScopeRestrictionSection section
= new ScopeRestrictionSection(this, conversation
, parentElement
, style
);
2716 addAndAdaptSection(parentElement
, section
);
2720 public MemberDetailSection
createMemberDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2721 MemberDetailSection section
= new MemberDetailSection(this, conversation
, parentElement
, style
);
2722 addAndAdaptSection(parentElement
, section
);
2726 public GrantedAuthorityDetailSection
createGrantedAuthorityDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2727 GrantedAuthorityDetailSection section
= new GrantedAuthorityDetailSection(this, conversation
, parentElement
, style
);
2728 addAndAdaptSection(parentElement
, section
);
2732 public GroupsByUserDetailSection
createGroupsByUserDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2733 GroupsByUserDetailSection section
= new GroupsByUserDetailSection(this, conversation
, parentElement
, style
);
2734 addAndAdaptSection(parentElement
, section
);
2738 public TaxonomicScopeSection
createTaxonomicScopeSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2739 TaxonomicScopeSection section
= new TaxonomicScopeSection(this, conversation
, parentElement
, style
);
2740 addAndAdaptSection(parentElement
, section
);
2745 public AbstractEntityCollectionElement
createEntityCollectionElement(AbstractFormSection parentElement
,
2746 Object versionableEntity
, SelectionListener removeListener
, Color backgroundColor
, int style
) {
2747 AbstractEntityCollectionElement
<?
> element
= null;
2749 Object entity
= HibernateProxyHelper
.deproxy(versionableEntity
);
2751 if (entity
instanceof Annotation
) {
2752 element
= new AnnotationElement(this, parentElement
, (Annotation
) entity
, removeListener
, style
);
2753 }else if (entity
instanceof Person
) {
2754 boolean isNomenclatural
= false;
2755 if (parentElement
instanceof TeamMemberSection
){
2756 isNomenclatural
= ((TeamMemberSection
) parentElement
).isNomenclaturalTeam();
2758 element
= new TeamMemberElement(this, parentElement
, (Person
) entity
, removeListener
, style
, isNomenclatural
);
2759 } else if (entity
instanceof Credit
) {
2760 element
= new CreditElement(this, parentElement
, (Credit
) entity
, removeListener
, style
);
2761 } else if (entity
instanceof Extension
) {
2762 element
= new ExtensionElement(this, parentElement
, (Extension
) entity
, removeListener
, style
);
2763 } else if (entity
instanceof ExternalLink
) {
2764 element
= new ExternalLinksElement(this, parentElement
, (ExternalLink
) entity
, removeListener
, style
);
2765 } else if (entity
instanceof Marker
) {
2766 element
= new MarkerElement(this, parentElement
, (Marker
) entity
, removeListener
, style
);
2767 } else if (entity
instanceof TaxonNodeAgentRelation
) {
2768 element
= new TaxonNodeAgentRelationCollectionElement(this, parentElement
, (TaxonNodeAgentRelation
) entity
, removeListener
, backgroundColor
, style
);
2769 }else if (entity
instanceof Media
) {
2770 element
= new MediaMetaElement(this, parentElement
, (Media
) entity
, removeListener
, style
);
2771 } else if (entity
instanceof MediaRepresentation
) {
2772 element
= new MediaRepresentationElement(this, parentElement
, (MediaRepresentation
) entity
, removeListener
,
2774 } else if (entity
instanceof ImageFile
) {
2775 element
= new ImageFileElement(this, parentElement
, (ImageFile
) entity
, removeListener
, style
);
2776 } else if (entity
instanceof MediaRepresentationPart
) {
2777 element
= new MediaRepresentationPartElement
<>(this, parentElement
, (MediaRepresentationPart
) entity
,
2778 removeListener
, style
);
2779 } else if (entity
instanceof NomenclaturalStatus
) {
2780 element
= new NomenclaturalStatusElement(this, parentElement
, (NomenclaturalStatus
) entity
, removeListener
,
2782 } else if (entity
instanceof Rights
) {
2783 element
= new RightsElement(this, parentElement
, (Rights
) entity
, removeListener
, style
);
2784 } else if (entity
instanceof DescriptionElementSource
&& parentElement
.getEntity() instanceof CommonTaxonName
) {
2785 element
= new CommonNameSourceElement(this, parentElement
, (DescriptionElementSource
) entity
,
2786 removeListener
, style
);
2787 } else if (entity
instanceof DescriptionElementSource
) {
2788 element
= new DescriptionElementSourceElement(this, parentElement
, (DescriptionElementSource
) entity
,
2789 removeListener
, style
, false);
2790 } else if (entity
instanceof TaxonNodeAgentRelation
) {
2791 element
= new TaxonNodeAgentRelationCollectionElement(this, parentElement
, (TaxonNodeAgentRelation
) entity
,
2792 removeListener
,backgroundColor
, style
);
2794 else if (entity
instanceof IdentifiableSource
) {
2795 element
= new IdentifiableSourceElement(this, parentElement
, (IdentifiableSource
) entity
, removeListener
,
2797 } else if (entity
instanceof DefinedTerm
) {
2798 switch(((DefinedTerm
)entity
).getTermType()) {
2800 element
= new ScopeElement(this,
2802 (DefinedTerm
) entity
,
2807 element
= new ModifierElement(this,
2809 (DefinedTerm
) entity
,
2817 } else if (entity
instanceof Reference
) {
2818 if(parentElement
instanceof SequenceReferenceCollectionDetailSection
){
2819 element
= new SequenceReferenceCollectionDetailElement(this, parentElement
, (Reference
) entity
, removeListener
, style
);
2822 element
= new DescriptionSourceElement(this, parentElement
, (Reference
) entity
, removeListener
, style
);
2824 } else if (entity
instanceof NameTypeDesignation
) {
2825 element
= new NameTypeDesignationElement(this, parentElement
, (NameTypeDesignation
) entity
, removeListener
,
2827 } else if (entity
instanceof TextualTypeDesignation
) {
2828 element
= new TextTypeDesignationElement(this, parentElement
, (TextualTypeDesignation
) entity
, removeListener
,
2830 } else if (entity
instanceof NameRelationship
) {
2831 element
= new NameRelationshipDetailElement(this, parentElement
, (NameRelationship
) entity
, removeListener
,
2833 } else if (entity
instanceof SpecimenTypeDesignation
) {
2834 if(parentElement
instanceof DerivedUnitTypeDesignationSection
){
2835 element
= new DerivedUnitTypeDesignationElement(this, parentElement
, (SpecimenTypeDesignation
) entity
,
2836 removeListener
, style
);
2839 element
= new SpecimenTypeDesignationElement(this, parentElement
, (SpecimenTypeDesignation
) entity
,
2840 removeListener
, style
);
2842 } else if (entity
instanceof StateData
) {
2843 element
= new StateDataElement(this, parentElement
, (StateData
) entity
, removeListener
, style
);
2844 } else if (entity
instanceof StatisticalMeasurementValue
) {
2845 element
= new StatisticalMeasurementValueElement(this, parentElement
, (StatisticalMeasurementValue
) entity
,
2846 removeListener
, style
);
2847 } else if (entity
instanceof DerivedUnit
) {
2848 switch(((DerivedUnit
)entity
).getRecordBasis()) {
2849 case LivingSpecimen
:
2850 case PreservedSpecimen
:
2852 element
= new SpecimenCollectionDetailElement(this,
2854 (DerivedUnit
) entity
,
2859 element
= new DerivedUnitElement(this,
2861 (DerivedUnit
) entity
,
2866 } else if (entity
instanceof NamedArea
) {
2867 element
= new CollectingAreaDetailElement(this, parentElement
, (NamedArea
) entity
, removeListener
, style
);
2868 } else if (entity
instanceof DeterminationEvent
) {
2869 element
= new DeterminationEventDetailElement(this, parentElement
, (DeterminationEvent
) entity
, removeListener
, style
);
2870 } else if (entity
instanceof User
) {
2871 element
= new MemberDetailElement(this, parentElement
, (User
) entity
, removeListener
, style
);
2872 } else if (entity
instanceof GrantedAuthority
) {
2873 element
= new GrantedAuthorityCollectionElement(this, parentElement
, (GrantedAuthorityImpl
) entity
, ((Group
)parentElement
.getEntity()),
2874 removeListener
, style
);
2875 } else if (entity
instanceof Group
) {
2876 element
= new GroupsByUserDetailElement(this, parentElement
, (Group
) entity
, removeListener
, style
);
2877 } else if (entity
instanceof Taxon
) {
2878 element
= new TaxonDetailElement(this, parentElement
, (Taxon
) entity
, removeListener
, style
);
2879 } else if (entity
instanceof DescriptionElementBase
) {
2880 // this is the special case for protologs, maybe we can do this
2881 // differently when API improves
2882 DescriptionElementBase descriptionElement
= (DescriptionElementBase
) entity
;
2883 if (descriptionElement
.getFeature().equals(Feature
.PROTOLOGUE())) {
2884 element
= new ProtologueElement(this, parentElement
, descriptionElement
, removeListener
, style
);
2886 } else if (entity
instanceof Identifier
) {
2887 if(parentElement
instanceof AbstractSampleDesignationDetailSection
){
2888 element
= new SampleDesignationTextDetailElement(this, parentElement
, (Identifier
<DnaSample
>) entity
, removeListener
, backgroundColor
, style
);
2891 element
= new IdentifierElement(this, parentElement
, (Identifier
) entity
, removeListener
, style
);
2893 } else if (entity
instanceof TermVocabulary
) {
2894 TermVocabulary
<?
> termVocabulary
= (TermVocabulary
<?
>)entity
;
2895 switch (termVocabulary
.getTermType()) {
2897 element
= new StateVocabularyCollectionElement(this, parentElement
, (TermVocabulary
<State
>) entity
, removeListener
, backgroundColor
, style
);
2900 element
= new RecommendedModifierVocabulariesElement(this, parentElement
, (TermVocabulary
<DefinedTerm
>) entity
, removeListener
, backgroundColor
, style
);
2905 } else if (entity
instanceof MeasurementUnit
) {
2906 element
= new MeasurementUnitCollectionElement(this, parentElement
, (MeasurementUnit
) entity
, removeListener
, backgroundColor
, style
);
2907 } else if (entity
instanceof StatisticalMeasure
) {
2908 element
= new StatisticalMeasureCollectionElement(this, parentElement
, (StatisticalMeasure
) entity
, removeListener
, backgroundColor
, style
);
2909 } else if (entity
instanceof FeatureState
&& parentElement
instanceof InapplicableIfEntityCollectionSection
) {
2910 element
= new InapplicableIfCollectionElement(this, parentElement
, (FeatureState
) entity
, removeListener
, backgroundColor
, style
);
2911 } else if (entity
instanceof FeatureState
&& parentElement
instanceof OnlyApplicableIfEntityCollectionSection
) {
2912 element
= new OnlyApplicableIfCollectionElement(this, parentElement
, (FeatureState
) entity
, removeListener
, backgroundColor
, style
);
2915 //check for parent section when entity is null
2916 //this happens when AbstractUnboundEntityCollectionSection is used
2918 if(parentElement
instanceof ScopeSection
|| parentElement
instanceof ScopeRestrictionSection
){
2919 element
= new ScopeElement(this,
2921 (DefinedTerm
) entity
,
2925 else if(parentElement
instanceof ModifierSection
){
2926 element
= new ModifierElement(this,
2928 (DefinedTerm
) entity
,
2935 if (element
== null) {
2936 MessagingUtils
.messageDialog(
2937 String
.format("Error when creating section %s",
2938 parentElement
.getClass().getSimpleName()),
2940 String
.format("Could not generate collection element for entity of class %s."
2941 + " Looks like the case is not yet handled. Check implementation.\n"
2942 + "Entity: %s", entity
.getClass(), entity
.toString()), null);
2946 if (backgroundColor
!= null && !backgroundColor
.isDisposed()) {
2947 element
.setPersistentBackground(backgroundColor
);
2950 parentElement
.addElement(element
);
2958 * Creates a selection element for the given type T.
2961 * <strong>Selection elements not handled by this method:</strong>
2963 * <li>{@link TaxonNodeSelectionElement} see
2964 * {@link #createTaxonNodeSelectionElement(ConversationHolder, ICdmFormElement, String, TaxonNode, int, int)}
2966 * <li>{@link NomenclaturalAuthorTeamSelectionElement} see
2967 * {@link #createNomenclaturalAuthorTeamSelectionElement(ConversationHolder, ICdmFormElement, String, Team, int, int)}
2973 * a {@link Class} object of the type that you want the selection
2975 * @param parentElement
2976 * a {@link ICdmFormElement} object.
2977 * @param labelString
2978 * a {@link String} object.
2979 * @param selectionType
2981 * a {@link ICdmBase} object.
2984 * @param conversation
2985 * a {@link ConversationHolder} object.
2986 * @return a {@link EntitySelectionElement} object.
2988 public <T
extends CdmBase
> EntitySelectionElement
<T
> createSelectionElement(Class
<T
> clazz
,
2989 ICdmFormElement parentElement
, String labelString
, T selection
, int mode
,
2990 int style
, boolean filterElement
) {
2991 EntitySelectionElement
<T
> element
= new EntitySelectionElement
<T
>(this, //conversation,
2992 parentElement
, clazz
,
2993 labelString
, selection
, mode
, style
, filterElement
);
2995 parentElement
.addElement(element
);
2999 public <T
extends CdmBase
> EntitySelectionElement
<T
> createSelectionElement(Class
<T
> clazz
,
3000 // ConversationHolder conversation,
3001 ICdmFormElement parentElement
, String labelString
, T selection
, int mode
,
3003 EntitySelectionElement
<T
> element
= new EntitySelectionElement
<T
>(this,
3004 parentElement
, clazz
,
3005 labelString
, selection
, mode
, style
);
3007 parentElement
.addElement(element
);
3011 public CommonNameReferenceSelectionElement
createCommonNameReferenceSelectionElement(ICdmFormElement parentElement
, String labelString
, Reference selection
, int mode
,
3013 CommonNameReferenceSelectionElement element
= new CommonNameReferenceSelectionElement(this,
3014 parentElement
, labelString
, selection
, mode
, style
);
3016 parentElement
.addElement(element
);
3022 * Creates a selection element for the given type T which shows only the <b>abbreviated</b> title as the label.
3025 * <strong>Selection elements not handled by this method:</strong>
3027 * <li>{@link TaxonNodeSelectionElement} see
3028 * {@link #createTaxonNodeSelectionElement(ConversationHolder, ICdmFormElement, String, TaxonNode, int, int)}
3030 * <li>{@link NomenclaturalAuthorTeamSelectionElement} see
3031 * {@link #createNomenclaturalAuthorTeamSelectionElement(ConversationHolder, ICdmFormElement, String, Team, int, int)}
3037 * a {@link Class} object of the type that you want the selection
3039 * @param parentElement
3040 * a {@link ICdmFormElement} object.
3041 * @param labelString
3042 * a {@link String} object.
3043 * @param selectionType
3045 * a {@link ICdmBase} object.
3048 * @param conversation
3049 * a {@link ConversationHolder} object.
3050 * @return a {@link EntitySelectionElement} object.
3052 public <T
extends CdmBase
> EntitySelectionElementWithAbbreviatedTitle
<T
> createSelectionElementWithAbbreviatedTitle(
3053 Class
<T
> clazz
, ConversationHolder conversation
, ICdmFormElement parentElement
, String labelString
,
3054 T selection
, int mode
, int style
) {
3055 EntitySelectionElementWithAbbreviatedTitle
<T
> element
= new EntitySelectionElementWithAbbreviatedTitle
<T
>(this, //conversation,
3056 parentElement
, clazz
,
3057 labelString
, selection
, mode
, style
);
3059 parentElement
.addElement(element
);
3063 public TaxonNodeSelectionElement
createTaxonNodeSelectionElement(ConversationHolder conversation
,
3064 ICdmFormElement parentElement
, String labelString
, TaxonNode selection
, int mode
, int style
) {
3065 TaxonNodeSelectionElement element
= new TaxonNodeSelectionElement(this, //conversation,
3067 labelString
, selection
, mode
, style
);
3069 parentElement
.addElement(element
);
3075 // public NomenclaturalAuthorTeamSelectionElement createNomenclaturalAuthorTeamSelectionElement(
3076 // ConversationHolder conversation, ICdmFormElement parentElement, String labelString, Team selection,
3077 // int mode, int style) {
3078 // NomenclaturalAuthorTeamSelectionElement element = new NomenclaturalAuthorTeamSelectionElement(this,
3079 // conversation, parentElement, labelString, selection, mode, style);
3081 // parentElement.addElement(element);
3085 /** {@inheritDoc} */
3086 public LabelElement
createLabel(ICdmFormElement parentElement
, String text
) {
3087 LabelElement labelElement
= new LabelElement(this, parentElement
, text
);
3088 adapt(labelElement
);
3089 parentElement
.addElement(labelElement
);
3090 return labelElement
;
3095 // public DateElementFormElement createDateElementForm(ICdmFormElement formElement, String labelText, DateTime dateTime, int style){
3096 // Label label = new Label(formElement.getLayoutComposite(), style);
3097 // label.setText(labelText+" (yyyy-MM-dd)");
3098 // DateElementFormElement dateElement = new DateElementFormElement(this, dateTime, style, formElement.getLayoutComposite());
3099 // dateElement.initInternalController();
3101 // return dateElement;
3104 public DateElement
createDateElement(ICdmFormElement formElement
, String labelText
, DateTime dateTime
, int style
, boolean editableText
){
3105 Label label
= new Label(formElement
.getLayoutComposite(), style
);
3106 label
.setText(labelText
);
3107 label
.setLayoutData(new TableWrapData(TableWrapData
.LEFT
, TableWrapData
.MIDDLE
, 1, 1));
3108 DateElement dateElement
= new DateElement(formElement
.getLayoutComposite(), dateTime
, labelText
, style
, editableText
);
3109 dateElement
.initController(this, formElement
);
3110 dateElement
.setLayoutData(new TableWrapData(TableWrapData
.LEFT
, TableWrapData
.MIDDLE
, 1, 1));
3116 * Getter for the field <code>selectionProvider</code>.
3119 * @return a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
3121 public ISelectionProvider
getSelectionProvider() {
3122 return selectionProvider
;
3127 * createDetailedDescriptionDetailElement
3130 * @param parentElement
3131 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
3135 * {@link eu.etaxonomy.cdm.model.description.DescriptionElementBase}
3140 * {@link eu.etaxonomy.taxeditor.ui.section.description.detail.AbstractDetailedDescriptionDetailElement}
3143 public AbstractDetailedDescriptionDetailElement
createDetailedDescriptionDetailElement(
3144 ICdmFormElement parentElement
, DescriptionElementBase entity
, int style
, boolean enabled
) {
3145 AbstractDetailedDescriptionDetailElement detailedDescriptionElement
= null;
3147 if (entity
instanceof CategoricalData
) {
3148 detailedDescriptionElement
= new CategoricalDataDetailElement(this, parentElement
,
3149 (CategoricalData
) entity
, style
);
3150 } else if (entity
instanceof CommonTaxonName
) {
3151 detailedDescriptionElement
= new CommonNameDetailElement(this, parentElement
, (CommonTaxonName
) entity
,
3153 } else if (entity
instanceof Distribution
&& !enabled
) {
3154 detailedDescriptionElement
= new DistributionDetailElement(this, parentElement
, (Distribution
) entity
,
3156 } else if (entity
instanceof Distribution
) {
3157 detailedDescriptionElement
= new DistributionDetailElement(this, parentElement
, (Distribution
) entity
,
3159 }else if (entity
instanceof IndividualsAssociation
) {
3160 detailedDescriptionElement
= new IndividualsAssociationDetailElement(this, parentElement
,
3161 (IndividualsAssociation
) entity
, style
);
3162 } else if (entity
instanceof QuantitativeData
) {
3163 detailedDescriptionElement
= new QuantitativeDataDetailElement(this, parentElement
,
3164 (QuantitativeData
) entity
, style
);
3165 } else if (entity
instanceof TaxonInteraction
) {
3166 detailedDescriptionElement
= new TaxonInteractionDetailElement(this, parentElement
,
3167 (TaxonInteraction
) entity
, style
);
3168 } else if (entity
instanceof TextData
) {
3169 detailedDescriptionElement
= new TextDataDetailElement(this, parentElement
, (TextData
) entity
, style
);
3171 throw new IllegalStateException("There is no interface for the given description element");
3173 adapt(detailedDescriptionElement
);
3174 parentElement
.addElement(detailedDescriptionElement
);
3175 return detailedDescriptionElement
;
3180 * Creates a styled text as a part of the form.
3185 * the text initial value
3188 * @return the text widget
3190 public StyledText
createStyledText(Composite parent
, String value
, int style
) {
3191 StyledText text
= new StyledText(parent
, getBorderStyle() | style
| getOrientation());
3192 if (value
!= null) {
3193 text
.setText(value
);
3195 text
.setForeground(getColors().getForeground());
3196 text
.setBackground(getColors().getBackground());
3197 // text.addFocusListener(visibilityHandler);
3201 public PreservedSpecimenDetailSection
createPreservedSpecimenDetailsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
3202 PreservedSpecimenDetailSection section
= new PreservedSpecimenDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
3203 addAndAdaptSection(parentElement
, section
);
3208 * @param formElement
3209 * @param conversationHolder
3213 public TaxonNodeAgentRelationCollectionSection
createTaxonNodeAgentRelationCollectionSection(
3214 ICdmFormElement formElement
, ConversationHolder conversationHolder
, int style
) {
3215 TaxonNodeAgentRelationCollectionSection section
= new TaxonNodeAgentRelationCollectionSection(this, conversationHolder
, formElement
, style
);
3216 addAndAdaptSection(formElement
, section
);
3221 public TaxonOfRelationshipElement
createTaxonOfRelationshipDetailElement(
3222 ICdmFormElement parentElement
, int style
) {
3223 TaxonOfRelationshipElement section
= new TaxonOfRelationshipElement(this, parentElement
, style
);
3224 addAndAdaptElement(parentElement
, section
);
3228 public TaxonDetailSection
createTaxonDetailSection(ConversationHolder conversationHolder
,
3229 ICdmFormElement formElement
, ISelectionProvider selectionProvider
, int style
) {
3230 TaxonDetailSection section
= new TaxonDetailSection(this, conversationHolder
, formElement
, selectionProvider
, style
);
3231 addAndAdaptSection(formElement
, section
);
3239 // public RichTextWithLabelElement createRichTextLabelElement(ICdmFormElement parentElement, String labelString, String initialText, int textHeight, int style) {
3240 // RichTextWithLabelElement element = new RichTextWithLabelElement(this, parentElement, labelString,
3241 // initialText, textHeight, style);
3243 // parentElement.addElement(element);