4 package eu
.etaxonomy
.taxeditor
.ui
.element
;
7 import java
.util
.ArrayList
;
8 import java
.util
.HashSet
;
13 import org
.eclipse
.jface
.util
.IPropertyChangeListener
;
14 import org
.eclipse
.jface
.viewers
.ISelection
;
15 import org
.eclipse
.jface
.viewers
.ISelectionProvider
;
16 import org
.eclipse
.jface
.window
.Window
;
17 import org
.eclipse
.swt
.SWT
;
18 import org
.eclipse
.swt
.custom
.StyledText
;
19 import org
.eclipse
.swt
.events
.FocusAdapter
;
20 import org
.eclipse
.swt
.events
.FocusEvent
;
21 import org
.eclipse
.swt
.events
.FocusListener
;
22 import org
.eclipse
.swt
.events
.MouseAdapter
;
23 import org
.eclipse
.swt
.events
.MouseEvent
;
24 import org
.eclipse
.swt
.events
.MouseListener
;
25 import org
.eclipse
.swt
.events
.SelectionEvent
;
26 import org
.eclipse
.swt
.events
.SelectionListener
;
27 import org
.eclipse
.swt
.events
.TypedEvent
;
28 import org
.eclipse
.swt
.graphics
.Color
;
29 import org
.eclipse
.swt
.graphics
.Font
;
30 import org
.eclipse
.swt
.widgets
.Composite
;
31 import org
.eclipse
.swt
.widgets
.Control
;
32 import org
.eclipse
.swt
.widgets
.Display
;
33 import org
.eclipse
.swt
.widgets
.Event
;
34 import org
.eclipse
.swt
.widgets
.Label
;
35 import org
.eclipse
.ui
.forms
.IFormColors
;
36 import org
.eclipse
.ui
.forms
.widgets
.ExpandableComposite
;
37 import org
.eclipse
.ui
.forms
.widgets
.FormToolkit
;
38 import org
.eclipse
.ui
.forms
.widgets
.Section
;
39 import org
.eclipse
.ui
.internal
.forms
.widgets
.FormFonts
;
40 import org
.joda
.time
.Partial
;
41 import org
.springframework
.security
.core
.GrantedAuthority
;
43 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
44 import eu
.etaxonomy
.cdm
.api
.facade
.DerivedUnitFacade
;
45 import eu
.etaxonomy
.cdm
.hibernate
.HibernateProxyHelper
;
46 import eu
.etaxonomy
.cdm
.model
.agent
.Person
;
47 import eu
.etaxonomy
.cdm
.model
.agent
.Team
;
48 import eu
.etaxonomy
.cdm
.model
.common
.Annotation
;
49 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
50 import eu
.etaxonomy
.cdm
.model
.common
.Credit
;
51 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTerm
;
52 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTermBase
;
53 import eu
.etaxonomy
.cdm
.model
.common
.Extension
;
54 import eu
.etaxonomy
.cdm
.model
.common
.GrantedAuthorityImpl
;
55 import eu
.etaxonomy
.cdm
.model
.common
.Group
;
56 import eu
.etaxonomy
.cdm
.model
.common
.ICdmBase
;
57 import eu
.etaxonomy
.cdm
.model
.common
.IEnumTerm
;
58 import eu
.etaxonomy
.cdm
.model
.common
.IdentifiableSource
;
59 import eu
.etaxonomy
.cdm
.model
.common
.Language
;
60 import eu
.etaxonomy
.cdm
.model
.common
.LanguageString
;
61 import eu
.etaxonomy
.cdm
.model
.common
.Marker
;
62 import eu
.etaxonomy
.cdm
.model
.common
.TermType
;
63 import eu
.etaxonomy
.cdm
.model
.common
.TimePeriod
;
64 import eu
.etaxonomy
.cdm
.model
.common
.User
;
65 import eu
.etaxonomy
.cdm
.model
.common
.VersionableEntity
;
66 import eu
.etaxonomy
.cdm
.model
.description
.CategoricalData
;
67 import eu
.etaxonomy
.cdm
.model
.description
.CommonTaxonName
;
68 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionElementBase
;
69 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionElementSource
;
70 import eu
.etaxonomy
.cdm
.model
.description
.Distribution
;
71 import eu
.etaxonomy
.cdm
.model
.description
.Feature
;
72 import eu
.etaxonomy
.cdm
.model
.description
.IndividualsAssociation
;
73 import eu
.etaxonomy
.cdm
.model
.description
.KeyStatement
;
74 import eu
.etaxonomy
.cdm
.model
.description
.QuantitativeData
;
75 import eu
.etaxonomy
.cdm
.model
.description
.StateData
;
76 import eu
.etaxonomy
.cdm
.model
.description
.StatisticalMeasurementValue
;
77 import eu
.etaxonomy
.cdm
.model
.description
.TaxonInteraction
;
78 import eu
.etaxonomy
.cdm
.model
.description
.TextData
;
79 import eu
.etaxonomy
.cdm
.model
.location
.NamedArea
;
80 import eu
.etaxonomy
.cdm
.model
.location
.NamedAreaLevel
;
81 import eu
.etaxonomy
.cdm
.model
.location
.Point
;
82 import eu
.etaxonomy
.cdm
.model
.media
.ImageFile
;
83 import eu
.etaxonomy
.cdm
.model
.media
.Media
;
84 import eu
.etaxonomy
.cdm
.model
.media
.MediaRepresentation
;
85 import eu
.etaxonomy
.cdm
.model
.media
.MediaRepresentationPart
;
86 import eu
.etaxonomy
.cdm
.model
.media
.Rights
;
87 import eu
.etaxonomy
.cdm
.model
.name
.NameRelationship
;
88 import eu
.etaxonomy
.cdm
.model
.name
.NameTypeDesignation
;
89 import eu
.etaxonomy
.cdm
.model
.name
.NomenclaturalStatus
;
90 import eu
.etaxonomy
.cdm
.model
.name
.SpecimenTypeDesignation
;
91 import eu
.etaxonomy
.cdm
.model
.occurrence
.DerivedUnit
;
92 import eu
.etaxonomy
.cdm
.model
.occurrence
.DeterminationEvent
;
93 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
94 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
95 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonNode
;
96 import eu
.etaxonomy
.cdm
.strategy
.parser
.ParserProblem
;
97 import eu
.etaxonomy
.taxeditor
.model
.AbstractUtility
;
98 import eu
.etaxonomy
.taxeditor
.ui
.combo
.EnumComboElement
;
99 import eu
.etaxonomy
.taxeditor
.ui
.combo
.TermComboElement
;
100 import eu
.etaxonomy
.taxeditor
.ui
.element
.MinMaxTextSection
.UnitType
;
101 import eu
.etaxonomy
.taxeditor
.ui
.openurl
.IOpenUrlEnabled
;
102 import eu
.etaxonomy
.taxeditor
.ui
.openurl
.OpenUrlSelectorElement
;
103 import eu
.etaxonomy
.taxeditor
.ui
.password
.EditPasswordElement
;
104 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailElement
;
105 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailSection
;
106 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionElement
;
107 import eu
.etaxonomy
.taxeditor
.ui
.section
.EmptyElement
;
108 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.InstitutionDetailElement
;
109 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.InstitutionDetailSection
;
110 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailElement
;
111 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailSection
;
112 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailElement
;
113 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailSection
;
114 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamMemberElement
;
115 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamMemberSection
;
116 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamOrPersonBaseDetailSection
;
117 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.ClassificationDetailElement
;
118 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.ClassificationDetailSection
;
119 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.TaxonNodeDetailElement
;
120 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.TaxonNodeDetailSection
;
121 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferenceEntityDetailElement
;
122 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferencedEntityDetailSection
;
123 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DerivedUnitElement
;
124 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescribedSpecimenSection
;
125 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailElement
;
126 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailSection
;
127 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailElement
;
128 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailSection
;
129 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementMediaSection
;
130 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceElement
;
131 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceSection
;
132 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceElement
;
133 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceSection
;
134 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.MediaDetailsSection
;
135 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ModifierElement
;
136 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ModifierSection
;
137 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageDetailElement
;
138 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageSection
;
139 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeElement
;
140 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeSection
;
141 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StateDataElement
;
142 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StateDataSection
;
143 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StatisticalMeasurementValueElement
;
144 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StatisticalMeasurementValueSection
;
145 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.AbstractDetailedDescriptionDetailElement
;
146 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.CategoricalDataDetailElement
;
147 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.CommonNameDetailElement
;
148 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.DistributionDetailElement
;
149 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.IndividualsAssociationDetailElement
;
150 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.QuantitativeDataDetailElement
;
151 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.TaxonInteractionDetailElement
;
152 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.TextDataDetailElement
;
153 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailElement
;
154 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailSection
;
155 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityCollectionElement
;
156 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailElement
;
157 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailSection
;
158 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailElement
;
159 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailSection
;
160 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailElement
;
161 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailSection
;
162 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.GeographicalScopeDetailSection
;
163 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailElement
;
164 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailSection
;
165 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailElement
;
166 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailSection
;
167 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.ScopeRestrictionSection
;
168 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.TaxonomicScopeSection
;
169 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.ImageFileElement
;
170 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaElement
;
171 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationElement
;
172 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationPartElement
;
173 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationPartSection
;
174 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationSection
;
175 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaSection
;
176 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.AuthorshipDetailElement
;
177 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.AuthorshipDetailSection
;
178 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.HybridDetailElement
;
179 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.HybridDetailSection
;
180 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameDetailElement
;
181 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameDetailSection
;
182 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailElement
;
183 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailSection
;
184 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameTypeDesignationElement
;
185 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusElement
;
186 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusSection
;
187 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailElement
;
188 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailSection
;
189 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.ProtologueElement
;
190 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.ProtologueSection
;
191 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.SpecimenTypeDesignationElement
;
192 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.TypeDesignationSection
;
193 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CollectingAreasDetailSection
;
194 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CollectionDetailElement
;
195 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CurrentDeterminationDetailSection
;
196 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitBaseDetailElement
;
197 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitBaseDetailSection
;
198 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitFacadeDetailElement
;
199 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitFacadeDetailSection
;
200 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitGeneralDetailElement
;
201 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitGeneralDetailSection
;
202 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailElement
;
203 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailSection
;
204 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationEventDetailElement
;
205 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationHistoryDetailSection
;
206 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitDetailElement
;
207 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitDetailSection
;
208 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitGeneralDetailElement
;
209 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitGeneralDetailSection
;
210 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailElement
;
211 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailSection
;
212 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.NamedAreaDetailElement
;
213 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SourceCollectionDetailSection
;
214 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SpecimenCollectionDetailElement
;
215 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SpecimenCollectionDetailSection
;
216 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailElement
;
217 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailSection
;
218 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailElement
;
219 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailSection
;
220 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.AnnotationElement
;
221 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.AnnotationSection
;
222 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CdmBaseElement
;
223 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CdmBaseSection
;
224 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CreditElement
;
225 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CreditSection
;
226 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.ExtensionElement
;
227 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.ExtensionSection
;
228 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.HeadlineSection
;
229 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.IdentifiableSourceElement
;
230 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.MarkerElement
;
231 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.MarkerSection
;
232 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.RightsElement
;
233 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.RightsSection
;
234 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.SourceSection
;
235 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.VersionElement
;
236 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.VersionSection
;
237 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessageElement
;
238 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessagesSection
;
239 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailElement
;
240 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailSection
;
241 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonDetailElement
;
242 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailElement
;
243 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailSection
;
244 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailElement
;
245 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailSection
;
246 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailElement
;
247 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailSection
;
248 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailElement
;
249 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailSection
;
250 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.DefinedTermDetailElement
;
251 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.DefinedTermDetailSection
;
252 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.FeatureDetailElement
;
253 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailSection
;
254 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailElement
;
255 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailSection
;
256 import eu
.etaxonomy
.taxeditor
.ui
.selection
.EntitySelectionElement
;
257 import eu
.etaxonomy
.taxeditor
.ui
.selection
.NomenclaturalAuthorTeamSelectionElement
;
258 import eu
.etaxonomy
.taxeditor
.ui
.selection
.TaxonNodeSelectionElement
;
262 * CdmFormFactory class.
266 * @created Feb 24, 2010
269 public class CdmFormFactory
extends FormToolkit
{
271 private BoldFontHolder2 boldFontHolder2
;
272 private MouseListener selectionMouseHandler
;
273 private FocusListener selectionFocusHandler
;
275 private final Set
<SelectionListener
> selectionListenerList
= new HashSet
<SelectionListener
>();
277 private final List
<IPropertyChangeListener
> propertyChangeListeners
= new ArrayList
<IPropertyChangeListener
>();
279 private final int orientation
= Window
.getDefaultOrientation();
280 private ISelectionProvider selectionProvider
;
282 /** Constant <code>EMPTY_SELECTION</code> */
283 public static ISelection EMPTY_SELECTION
= new ISelection() {
285 public boolean isEmpty() {
296 private class SelectionMouseHandler
extends MouseAdapter
{
298 public void mouseDown(MouseEvent e
) {
299 notifySelectionListeners(e
);
309 private class SelectionFocusHandler
extends FocusAdapter
{
311 public void focusGained(FocusEvent e
) {
312 notifySelectionListeners(e
);
316 private void notifySelectionListeners(TypedEvent e
) {
317 Event event
= new Event();
318 event
.widget
= e
.widget
;
319 SelectionEvent selectionEvent
= new SelectionEvent(event
);
321 for (SelectionListener listener
: selectionListenerList
) {
322 listener
.widgetSelected(selectionEvent
);
328 * Constructor for CdmFormFactory.
332 * a {@link org.eclipse.swt.widgets.Display} object.
333 * @param selectionProvider
334 * a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
336 public CdmFormFactory(Display display
, ISelectionProvider selectionProvider
) {
338 this.selectionProvider
= selectionProvider
;
344 * Constructor for CdmFormFactory.
348 * a {@link org.eclipse.swt.widgets.Display} object.
350 public CdmFormFactory(Display display
) {
358 private void init() {
359 boldFontHolder2
= new BoldFontHolder2();
360 selectionMouseHandler
= new SelectionMouseHandler();
361 selectionFocusHandler
= new SelectionFocusHandler();
365 * Creates an instance initialized with the correct selectionProvider
367 * Make sure to remove the instance when the entityComposite disposes via
368 * destroySelectionArbitrator(..)
370 * @param entityElement
371 * a {@link eu.etaxonomy.taxeditor.ui.element.IEntityElement}
373 * @return a {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator}
376 public SelectionArbitrator
createSelectionArbitrator(IEntityElement entityElement
) {
377 SelectionArbitrator selectionArbitrator
= new SelectionArbitrator(entityElement
);
378 selectionArbitrator
.addSelectionProvider(selectionProvider
);
379 selectionProvider
.addSelectionChangedListener(selectionArbitrator
);
380 addSelectionListener(selectionArbitrator
);
381 return selectionArbitrator
;
386 * destroySelectionArbitrator
389 * @param selectionArbitrator
391 * {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator}
394 public void destroySelectionArbitrator(SelectionArbitrator selectionArbitrator
) {
395 removeSelectionListener(selectionArbitrator
);
396 if (selectionProvider
!= null) {
397 selectionProvider
.removeSelectionChangedListener(selectionArbitrator
);
399 AbstractUtility
.error(this.getClass(),
400 "Tried to destroy a selection listener from this factories listeners but was null", null);
406 public void adapt(Composite composite
) {
407 composite
.addMouseListener(selectionMouseHandler
);
408 super.adapt(composite
);
413 * Adapts the {@link AbstractCdmFormElement}:<br>
414 * - sets the {@link IPropertyChangeListener}s handled by this class
419 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement}
422 public void adapt(AbstractCdmFormElement formElement
) {
423 formElement
.setPropertyChangeListeners(propertyChangeListeners
);
428 public void adapt(Control control
, boolean trackFocus
, boolean trackKeyboard
) {
430 control
.addFocusListener(selectionFocusHandler
);
432 super.adapt(control
, trackFocus
, trackKeyboard
);
441 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
444 public void destroyElement(ICdmFormElement formElement
) {
445 // return if element was not initialized
446 if (formElement
== null) {
449 // destroy selection arbitrator, if any
450 if (formElement
instanceof ISelectableElement
) {
451 destroySelectionArbitrator(((ISelectableElement
) formElement
).getSelectionArbitrator());
453 // remove this element form its parents list of elements
454 // ICdmFormElement parentElement = formElement.getParentElement();
455 // if(parentElement != null){
456 // parentElement.removeElement(formElement);
458 // call destroy on child elements recursively
459 for (ICdmFormElement childElement
: formElement
.getElements()) {
460 destroyElement(childElement
);
462 // dispose of the controls
463 for (Control control
: formElement
.getControls()) {
464 // we added the layoutComposite of the parental element as the
465 // layout composite to this formElement
466 // but we do not want to destroy it.
467 if (control
.equals(formElement
.getLayoutComposite())) {
482 * a {@link org.eclipse.swt.widgets.Composite} object.
483 * @return a {@link org.eclipse.swt.widgets.Label} object.
485 public Label
createEmptyCell(Composite parent
) {
486 return this.createLabel(parent
, null);
491 * createMultilineTextWithLabel
495 * a {@link java.lang.String} object.
500 * @param parentElement
501 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
503 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
506 public TextWithLabelElement
createMultilineTextWithLabel(ICdmFormElement parentElement
, String labelString
,
507 int textHeight
, int style
) {
508 TextWithLabelElement element
= new TextWithLabelElement(this, parentElement
, labelString
, "", textHeight
, style
);
510 parentElement
.addElement(element
);
516 * createMultiLanguageTextElement
519 * @param parentElement
520 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
523 * a {@link java.lang.String} object.
524 * @param multilanguageText
525 * a {@link java.util.Map} object.
531 * {@link eu.etaxonomy.taxeditor.ui.element.MultilanguageTextElement}
534 public MultilanguageTextElement
createMultiLanguageTextElement(ICdmFormElement parentElement
, String labelString
,
535 Map
<Language
, LanguageString
> multilanguageText
, int textHeight
, int style
) {
536 MultilanguageTextElement element
= new MultilanguageTextElement(this, parentElement
, labelString
,
537 multilanguageText
, textHeight
, style
);
539 parentElement
.addElement(element
);
543 public KeyStatementElement
createKeyStatementElement(ICdmFormElement parentElement
, String labelString
,
544 KeyStatement keyStatement
, int textHeight
, int style
) {
545 KeyStatementElement element
= new KeyStatementElement(this, parentElement
, labelString
, keyStatement
,
548 parentElement
.addElement(element
);
554 * createTextWithLabelElement
558 * a {@link java.lang.String} object.
560 * a {@link java.lang.String} object.
563 * @param parentElement
564 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
566 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
569 public TextWithLabelElement
createTextWithLabelElement(ICdmFormElement parentElement
, String labelString
,
570 String initialText
, int style
) {
571 TextWithLabelElement element
= new TextWithLabelElement(this, parentElement
, labelString
, initialText
, null,
574 parentElement
.addElement(element
);
578 public UriWithLabelElement
createUriWithLabelElement(ICdmFormElement parentElement
, String labelString
,
579 URI initialUri
, int style
) {
580 UriWithLabelElement element
= new UriWithLabelElement(this, parentElement
, labelString
, initialUri
, null, style
);
582 parentElement
.addElement(element
);
593 public OpenUrlSelectorElement
createOpenUrlSelectorElement(ICdmFormElement parentElement
, String labelString
,
594 IOpenUrlEnabled openUrlEnabled
, int style
) {
595 OpenUrlSelectorElement element
= new OpenUrlSelectorElement(this, parentElement
, labelString
, openUrlEnabled
,
598 parentElement
.addElement(element
);
604 * @param parentElement
606 * @param conversationEnabled
611 public EditPasswordElement
createEditPasswordElement(ICdmFormElement parentElement
, String labelString
,
612 ConversationHolder conversation
, User user
, int style
) {
613 EditPasswordElement element
= new EditPasswordElement(this, parentElement
, labelString
, user
, conversation
);
615 parentElement
.addElement(element
);
621 * createIntegerTextWithLabelElement
624 * @param parentElement
625 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
628 * a {@link java.lang.String} object.
629 * @param initialInteger
630 * a {@link java.lang.Integer} object.
634 * {@link eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement}
637 public NumberWithLabelElement
createNumberTextWithLabelElement(
638 ICdmFormElement parentElement
, String labelString
,
639 Number initialNumber
, int style
) {
640 NumberWithLabelElement element
= new NumberWithLabelElement(this,
641 parentElement
, labelString
, initialNumber
, style
);
643 parentElement
.addElement(element
);
650 * createLanguageStringWithLabelElement
653 * @param parentElement
654 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
657 * a {@link java.lang.String} object.
658 * @param languageString
659 * a {@link eu.etaxonomy.cdm.model.common.LanguageString} object.
663 * {@link eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement}
666 public LanguageStringWithLabelElement
createLanguageStringWithLabelElement(ICdmFormElement parentElement
,
667 String labelString
, LanguageString languageString
, int style
) {
668 LanguageStringWithLabelElement element
= new LanguageStringWithLabelElement(this, parentElement
, labelString
,
669 languageString
, style
);
671 parentElement
.addElement(element
);
677 * createLanguageStringWithLabelElement
680 * @param parentElement
681 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
684 * a {@link java.lang.String} object.
685 * @param languageString
686 * a {@link eu.etaxonomy.cdm.model.common.LanguageString} object.
692 * {@link eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement}
695 public LanguageStringWithLabelElement
createLanguageStringWithLabelElement(ICdmFormElement parentElement
,
696 String labelString
, LanguageString languageString
, int height
, int style
) {
697 LanguageStringWithLabelElement element
= new LanguageStringWithLabelElement(this, parentElement
, labelString
,
698 languageString
, height
, style
);
700 parentElement
.addElement(element
);
709 * @param parentElement
710 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
713 * a {@link java.lang.String} object.
716 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
719 public TextWithLabelElement
createTextElement(ICdmFormElement parentElement
, String initialText
, int style
) {
720 TextWithLabelElement element
= new TextWithLabelElement(this, parentElement
, null, initialText
, null, style
);
722 parentElement
.addElement(element
);
728 * createKeyValueViewerElement
731 * @param parentElement
732 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
735 * a {@link java.lang.String} object.
736 * @param valueHeading
737 * a {@link java.lang.String} object.
739 * a {@link java.util.Map} object.
740 * @return a {@link eu.etaxonomy.taxeditor.ui.element.KeyValueViewerElement}
743 public KeyValueViewerElement
createKeyValueViewerElement(ICdmFormElement parentElement
, String keyHeading
,
744 String valueHeading
, Map
<Object
, Object
> map
) {
745 KeyValueViewerElement element
= new KeyValueViewerElement(this, parentElement
, keyHeading
, valueHeading
, map
);
747 parentElement
.addElement(element
);
753 * createTermComboElement
756 * @param termComboType
758 * {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.TermComboType}
760 * @param parentElement
761 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
764 * a {@link java.lang.String} object.
766 * a {@link eu.etaxonomy.cdm.model.common.DefinedTermBase}
770 * @return a {@link eu.etaxonomy.taxeditor.ui.combo.TermComboElement}
774 public <T
extends DefinedTermBase
> TermComboElement
<T
> createTermComboElement(Class
<T
> termComboType
,
775 ICdmFormElement parentElement
, String labelString
, T selection
, int style
) {
776 TermComboElement
<T
> element
= new TermComboElement
<T
>(this, parentElement
, termComboType
, labelString
,
779 parentElement
.addElement(element
);
785 * createTermComboElement
788 * @param termComboType
790 * {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.TermComboType}
792 * @param parentElement
793 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
796 * a {@link java.lang.String} object.
798 * a {@link eu.etaxonomy.cdm.model.common.DefinedTermBase}
802 * @return a {@link eu.etaxonomy.taxeditor.ui.combo.TermComboElement}
806 public <T
extends DefinedTermBase
> TermComboElement
<T
> createDefinedTermComboElement(
808 ICdmFormElement parentElement
,
812 TermComboElement
<T
> element
= new TermComboElement
<T
>(this, parentElement
, termType
, labelString
, selection
, style
);
814 parentElement
.addElement(element
);
820 * createEnumComboElement
823 * @param enumComboType
825 * {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EnumComboType}
827 * @param parentElement
828 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
832 * @return a {@link eu.etaxonomy.taxeditor.ui.term.AbstractEnumComboElement}
835 public <T
extends IEnumTerm
<T
>> EnumComboElement
<T
> createEnumComboElement(
836 Class
<T
> enumComboType
, ICdmFormElement parentElement
,
838 EnumComboElement
<T
> element
= new EnumComboElement
<T
>(this, parentElement
, enumComboType
, style
);
840 parentElement
.addElement(element
);
846 * createBrowserElement
850 * a {@link java.net.URI} object.
853 * @param parentElement
854 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
856 * @return a {@link eu.etaxonomy.taxeditor.ui.element.BrowserElement}
859 public BrowserElement
createBrowserElement(ICdmFormElement parentElement
, URI imageUri
, int style
) {
860 BrowserElement element
= new BrowserElement(this, parentElement
, imageUri
, style
);
862 parentElement
.addElement(element
);
871 * @param parentElement
872 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
875 * a {@link java.net.URI} object.
878 * @return a {@link eu.etaxonomy.taxeditor.ui.element.ImageElement} object.
880 public ImageElement
createImageElement(ICdmFormElement parentElement
, URI imageUri
, int style
) {
881 ImageElement element
= new ImageElement(this, parentElement
, imageUri
, style
);
883 parentElement
.addElement(element
);
889 * createTextActionElement
893 * a {@link java.lang.String} object.
895 * a {@link java.lang.String} object.
898 * @param parentElement
899 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
902 * a {@link java.lang.String} object.
903 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextActionElement}
906 public TextActionElement
createTextActionElement(ICdmFormElement parentElement
, String labelString
,
907 String buttonLabel
, String initialText
, int style
) {
908 TextActionElement element
= new TextActionElement(this, parentElement
, labelString
, buttonLabel
, initialText
,
911 parentElement
.addElement(element
);
920 * @param parentElement
921 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
924 * a {@link java.lang.String} object.
925 * @param initialState
929 * @return a {@link eu.etaxonomy.taxeditor.ui.element.CheckboxElement}
932 public CheckboxElement
createCheckbox(ICdmFormElement parentElement
, String label
, boolean initialState
, int style
) {
933 CheckboxElement element
= new CheckboxElement(this, parentElement
, label
, initialState
, style
| orientation
);
935 parentElement
.addElement(element
);
940 * Creates a section as a part of the form.
942 * @return the section widget
945 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
948 public Section
adapt(AbstractFormSection section
) {
949 section
.setMenu(section
.getLayoutComposite().getMenu());
950 adapt(section
, true, true);
952 // handle focus and property change events for cdm use
953 section
.addFocusListener(selectionFocusHandler
);
954 section
.setPropertyChangeListeners(propertyChangeListeners
);
956 if (section
.getToggle() != null) {
957 section
.getToggle().setHoverDecorationColor(getColors().getColor(IFormColors
.TB_TOGGLE_HOVER
));
958 section
.getToggle().setDecorationColor(getColors().getColor(IFormColors
.TB_TOGGLE
));
961 section
.setFont(boldFontHolder2
.getBoldFont(section
.getLayoutComposite().getFont()));
963 if ((section
.getStyle() & ExpandableComposite
.TITLE_BAR
) != 0
964 || (section
.getStyle() & ExpandableComposite
.SHORT_TITLE_BAR
) != 0) {
965 getColors().initializeSectionToolBarColors();
966 section
.setTitleBarBackground(getColors().getColor(IFormColors
.TB_BG
));
967 section
.setTitleBarBorderColor(getColors().getColor(IFormColors
.TB_BORDER
));
969 // call setTitleBarForeground regardless as it also sets the label color
970 section
.setTitleBarForeground(getColors().getColor(IFormColors
.TB_TOGGLE
));
974 private class BoldFontHolder2
{
975 private Font normalFont
;
977 private Font boldFont
;
979 public BoldFontHolder2() {
982 public Font
getBoldFont(Font font
) {
983 createBoldFont(font
);
987 private void createBoldFont(Font font
) {
988 if (normalFont
== null || !normalFont
.equals(font
)) {
992 if (boldFont
== null) {
993 boldFont
= FormFonts
.getInstance().getBoldFont(getColors().getDisplay(), normalFont
);
997 public void dispose() {
998 if (boldFont
!= null) {
999 FormFonts
.getInstance().markFinished(boldFont
, getColors().getDisplay());
1007 * createToggleableTextField
1010 * @param parentElement
1011 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1013 * @param labelString
1014 * a {@link java.lang.String} object.
1015 * @param initialText
1016 * a {@link java.lang.String} object.
1017 * @param initialState
1021 * @return a {@link eu.etaxonomy.taxeditor.ui.element.ToggleableTextElement}
1024 public ToggleableTextElement
createToggleableTextField(ICdmFormElement parentElement
, String labelString
,
1025 String initialText
, boolean initialState
, int style
) {
1026 ToggleableTextElement element
= new ToggleableTextElement(this, parentElement
, labelString
, initialText
,
1027 initialState
, style
| orientation
);
1029 parentElement
.addElement(element
);
1035 * createTimePeriodElement
1038 * @param parentElement
1039 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1041 * @param labelString
1042 * a {@link java.lang.String} object.
1044 * a {@link eu.etaxonomy.cdm.model.common.TimePeriod} object.
1047 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TimePeriodElement}
1050 public TimePeriodElement
createTimePeriodElement(ICdmFormElement parentElement
, String labelString
,
1051 TimePeriod timePeriod
, int style
) {
1052 TimePeriodElement element
= new TimePeriodElement(this, parentElement
, labelString
, timePeriod
, style
);
1054 parentElement
.addElement(element
);
1060 * createGatheringEventUnitElement
1063 * @param parentElement
1064 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1066 * @param labelString
1067 * a {@link java.lang.String} object.
1069 * a {@link eu.etaxonomy.cdm.model.common.GatheringEvent} object.
1072 * @return a {@link eu.etaxonomy.taxeditor.ui.element.GatheringEventUnitElement}
1075 public GatheringEventUnitElement
createGatheringEventUnitElement(
1076 ICdmFormElement parentElement
,
1078 DerivedUnitFacade gatheringEvent
,
1079 MinMaxTextSection
.UnitType unitType
,
1081 GatheringEventUnitElement element
= new GatheringEventUnitElement(this,
1088 parentElement
.addElement(element
);
1094 * createPointElement
1099 * @param parentElement
1100 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1103 * a {@link eu.etaxonomy.cdm.model.location.Point} object.
1104 * @return a {@link eu.etaxonomy.taxeditor.ui.element.PointElement} object.
1106 public PointElement
createPointElement(ICdmFormElement parentElement
, Point point
, int style
) {
1107 PointElement element
= new PointElement(this, parentElement
, point
, style
);
1109 parentElement
.addElement(element
);
1115 * createDateDetailSection
1118 * @param parentElement
1119 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1123 * @return a {@link eu.etaxonomy.taxeditor.ui.element.DateDetailSection}
1126 public DateDetailSection
createDateDetailSection(ICdmFormElement parentElement
, int style
) {
1127 DateDetailSection section
= new DateDetailSection(this, parentElement
, style
);
1128 parentElement
.addElement(section
);
1135 * createDateDetailSection
1138 * @param parentElement
1139 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1143 * @return a {@link eu.etaxonomy.taxeditor.ui.element.MinMaxTextSection}
1146 public MinMaxTextSection
createMinMaxTextSection(ICdmFormElement parentElement
, UnitType unitType
, int style
) {
1147 MinMaxTextSection section
= new MinMaxTextSection(this, parentElement
, unitType
, style
);
1148 parentElement
.addElement(section
);
1155 * createPartialElement
1158 * @param parentElement
1159 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1161 * @param labelString
1162 * a {@link java.lang.String} object.
1164 * a {@link org.joda.time.Partial} object.
1167 * @return a {@link eu.etaxonomy.taxeditor.ui.element.PartialElement}
1170 public PartialElement
createPartialElement(ICdmFormElement parentElement
, String labelString
, Partial partial
,
1172 PartialElement element
= new PartialElement(this, parentElement
, labelString
, style
);
1174 parentElement
.addElement(element
);
1180 * addSelectionListener
1184 * a {@link org.eclipse.swt.events.SelectionListener} object.
1186 public void addSelectionListener(SelectionListener listener
) {
1187 selectionListenerList
.add(listener
);
1192 * removeSelectionListener
1196 * a {@link org.eclipse.swt.events.SelectionListener} object.
1198 public void removeSelectionListener(SelectionListener listener
) {
1199 if (listener
== null) {
1200 AbstractUtility
.error(this.getClass(),
1201 "Tried to remove a selection listener from this factories listeners but was null", null);
1203 selectionListenerList
.remove(listener
);
1209 * addPropertyChangeListener
1213 * a {@link org.eclipse.jface.util.IPropertyChangeListener}
1216 public void addPropertyChangeListener(IPropertyChangeListener listener
) {
1217 if(propertyChangeListeners
.contains(listener
)){
1220 propertyChangeListeners
.add(0, listener
);
1225 * removePropertyChangeListener
1229 * a {@link org.eclipse.jface.util.IPropertyChangeListener}
1232 public void removePropertyChangeListener(IPropertyChangeListener listener
) {
1233 propertyChangeListeners
.remove(listener
);
1238 * createHorizontalSeparator
1241 * @param parentElement
1242 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1246 * @return a {@link org.eclipse.swt.widgets.Label} object.
1248 public Label
createHorizontalSeparator(ICdmFormElement parentElement
, int style
) {
1249 Label separator
= this.createSeparator(parentElement
.getLayoutComposite(), SWT
.HORIZONTAL
| style
);
1250 separator
.setLayoutData(LayoutConstants
.FILL_HORIZONTALLY());
1256 * createVersionElement
1259 * @param parentElement
1260 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1263 * a {@link eu.etaxonomy.cdm.model.common.VersionableEntity}
1268 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.VersionElement}
1271 public VersionElement
createVersionElement(ICdmFormElement parentElement
, VersionableEntity entity
, int style
) {
1272 VersionElement element
= new VersionElement(this, parentElement
, entity
, style
);
1274 parentElement
.addElement(element
);
1279 * @param cdmBaseSection
1284 public CdmBaseElement
createCdmBaseElement(ICdmFormElement parentElement
, CdmBase entity
, int style
) {
1285 CdmBaseElement element
= new CdmBaseElement(this, parentElement
, entity
, style
);
1287 parentElement
.addElement(element
);
1294 * createVersionSection
1297 * @param parentElement
1298 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1303 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.VersionSection}
1306 public VersionSection
createVersionSection(ICdmFormElement parentElement
, int style
) {
1307 VersionSection section
= new VersionSection(this, parentElement
, style
);
1308 parentElement
.addElement(section
);
1318 public CdmBaseSection
createCdmBaseSection(ICdmFormElement parentElement
, int style
) {
1319 CdmBaseSection section
= new CdmBaseSection(this, parentElement
, style
);
1320 parentElement
.addElement(section
);
1327 * createEmptyElement
1330 * @param parentElement
1331 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1333 * @return a {@link eu.etaxonomy.taxeditor.ui.section.EmptyElement} object.
1335 public EmptyElement
createEmptyElement(ICdmFormElement parentElement
) {
1336 EmptyElement element
= new EmptyElement(this, parentElement
, null, SWT
.NULL
);
1338 parentElement
.addElement(element
);
1344 * createHeadlineSection
1347 * @param parentElement
1348 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1351 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.HeadlineSection}
1354 public HeadlineSection
createHeadlineSection(ICdmFormElement parentElement
) {
1355 HeadlineSection section
= new HeadlineSection(this, parentElement
, SWT
.NULL
);
1356 parentElement
.addElement(section
);
1363 * createParsingMessageElement
1366 * @param parentElement
1367 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1369 * @param parserProblem
1370 * a {@link eu.etaxonomy.cdm.strategy.parser.ParserProblem}
1375 * {@link eu.etaxonomy.taxeditor.ui.section.taxon.ParsingMessageElement}
1378 public ParsingMessageElement
createParsingMessageElement(ICdmFormElement parentElement
,
1379 ParserProblem parserProblem
, int style
) {
1380 ParsingMessageElement element
= new ParsingMessageElement(this, parentElement
, parserProblem
, style
);
1382 parentElement
.addElement(element
);
1386 public AbstractFormSection
createDefinedTermDetailSection(Class definedTermClass
, ConversationHolder conversation
,
1387 ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
1389 AbstractFormSection section
= new DefinedTermDetailSection(this, definedTermClass
, conversation
, parentElement
,
1390 selectionProvider
, style
);
1392 parentElement
.addElement(section
);
1399 * @param definedTermClass
1400 * @param formElement
1404 public AbstractCdmDetailElement
createDefinedTermDetailElement(Class definedTermClass
,
1405 AbstractCdmDetailSection parentElement
, int style
) {
1406 AbstractCdmDetailElement element
= null;
1408 if (NamedArea
.class.isAssignableFrom(definedTermClass
)) {
1409 element
= new eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement(this, parentElement
);
1410 } else if (definedTermClass
.equals(Feature
.class)) {
1411 element
= new FeatureDetailElement(this, parentElement
);
1413 element
= new DefinedTermDetailElement(this, parentElement
);
1417 parentElement
.addElement(element
);
1422 //--------DetailSections---------
1423 public NameDetailSection
createNameDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1424 NameDetailSection section
= new NameDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1425 addAndAdaptSection(parentElement
, section
);
1429 public ReferenceDetailSection
createReferenceDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1430 ReferenceDetailSection section
= new ReferenceDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1431 addAndAdaptSection(parentElement
, section
);
1435 public NomenclaturalReferenceDetailSection
createNomenclaturalReferenceDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1436 NomenclaturalReferenceDetailSection section
= new NomenclaturalReferenceDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1437 addAndAdaptSection(parentElement
, section
);
1441 public TaxonBaseDetailSection
createTaxonBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1442 TaxonBaseDetailSection section
= new TaxonBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1443 addAndAdaptSection(parentElement
, section
);
1447 public AuthorshipDetailSection
createAuthorshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1448 AuthorshipDetailSection section
= new AuthorshipDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1449 addAndAdaptSection(parentElement
, section
);
1453 public TeamOrPersonBaseDetailSection
createTeamOrPersonBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1454 TeamOrPersonBaseDetailSection section
= new TeamOrPersonBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1455 addAndAdaptSection(parentElement
, section
);
1459 public TeamDetailSection
createTeamDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1460 TeamDetailSection section
= new TeamDetailSection(this, conversation
, parentElement
, null, style
);
1461 addAndAdaptSection(parentElement
, section
);
1465 public PersonDetailSection
createPersonDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1466 PersonDetailSection section
= new PersonDetailSection(this, conversation
, parentElement
, null, style
);
1467 addAndAdaptSection(parentElement
, section
);
1471 public DescriptionDetailSection
createDescriptionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1472 DescriptionDetailSection section
= new DescriptionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1473 addAndAdaptSection(parentElement
, section
);
1477 public DescriptionElementDetailSection
createDescriptionElementDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1478 DescriptionElementDetailSection section
= new DescriptionElementDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1479 addAndAdaptSection(parentElement
, section
);
1483 public ParsingMessagesSection
createParsingMessagesSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1484 ParsingMessagesSection section
= new ParsingMessagesSection(this, conversation
, parentElement
, selectionProvider
, style
);
1485 addAndAdaptSection(parentElement
, section
);
1489 public NonViralNameDetailSection
createNonViralNameDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1490 NonViralNameDetailSection section
= new NonViralNameDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1491 addAndAdaptSection(parentElement
, section
);
1495 public MediaDetailsSection
createMediaDetailsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1496 MediaDetailsSection section
= new MediaDetailsSection(this, conversation
, parentElement
, selectionProvider
, style
);
1497 addAndAdaptSection(parentElement
, section
);
1501 public DerivedUnitFacadeDetailSection
createDerivedUnitFacadeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1502 DerivedUnitFacadeDetailSection section
= new DerivedUnitFacadeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1503 addAndAdaptSection(parentElement
, section
);
1507 public FieldUnitDetailSection
createFieldUnitDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1508 FieldUnitDetailSection section
= new FieldUnitDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1509 addAndAdaptSection(parentElement
, section
);
1513 public GatheringEventDetailSection
createGatheringEventDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1514 GatheringEventDetailSection section
= new GatheringEventDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1515 addAndAdaptSection(parentElement
, section
);
1519 public DerivedUnitBaseDetailSection
createDerivedUnitBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1520 DerivedUnitBaseDetailSection section
= new DerivedUnitBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1521 addAndAdaptSection(parentElement
, section
);
1525 public NaturalLanguageSection
createNaturalLanguageSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1526 NaturalLanguageSection section
= new NaturalLanguageSection(this, conversation
, parentElement
, selectionProvider
, style
);
1527 addAndAdaptSection(parentElement
, section
);
1531 public FeatureDistributionDetailSection
createFeatureDistributionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1532 FeatureDistributionDetailSection section
= new FeatureDistributionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1533 addAndAdaptSection(parentElement
, section
);
1537 public ClassificationDetailSection
createClassificationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1538 ClassificationDetailSection section
= new ClassificationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1539 addAndAdaptSection(parentElement
, section
);
1543 public TaxonNodeDetailSection
createTaxonNodeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1544 TaxonNodeDetailSection section
= new TaxonNodeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1545 addAndAdaptSection(parentElement
, section
);
1549 public PolytomousKeyDetailSection
createPolytomousKeyDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1550 PolytomousKeyDetailSection section
= new PolytomousKeyDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1551 addAndAdaptSection(parentElement
, section
);
1555 public PolytomousKeyNodeDetailSection
createPolytomousKeyNodeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1556 PolytomousKeyNodeDetailSection section
= new PolytomousKeyNodeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1557 addAndAdaptSection(parentElement
, section
);
1561 public InstitutionDetailSection
createInstitutionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1562 InstitutionDetailSection section
= new InstitutionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1563 addAndAdaptSection(parentElement
, section
);
1567 public FieldUnitGeneralDetailSection
createFieldUnitGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1568 FieldUnitGeneralDetailSection section
= new FieldUnitGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1569 addAndAdaptSection(parentElement
, section
);
1573 public DerivedUnitGeneralDetailSection
createDerivedUnitGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1574 DerivedUnitGeneralDetailSection section
= new DerivedUnitGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1575 addAndAdaptSection(parentElement
, section
);
1579 public HybridDetailSection
createHybridDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1580 HybridDetailSection section
= new HybridDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1581 addAndAdaptSection(parentElement
, section
);
1585 public UserDetailSection
createUserDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1586 UserDetailSection section
= new UserDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1587 addAndAdaptSection(parentElement
, section
);
1591 public GroupDetailSection
createGroupDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1592 GroupDetailSection section
= new GroupDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1593 addAndAdaptSection(parentElement
, section
);
1597 public DeterminationDetailSection
createDeterminationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1598 DeterminationDetailSection section
= new DeterminationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1599 addAndAdaptSection(parentElement
, section
);
1603 public TaxonRelationshipDetailSection
createTaxonRelationshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1604 TaxonRelationshipDetailSection section
= new TaxonRelationshipDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1605 addAndAdaptSection(parentElement
, section
);
1609 public ReferencedEntityDetailSection
createReferencedEntityDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1610 ReferencedEntityDetailSection section
= new ReferencedEntityDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1611 addAndAdaptSection(parentElement
, section
);
1615 public TermVocabularyDetailSection
createTermVocabularyDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1616 TermVocabularyDetailSection section
= new TermVocabularyDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1617 addAndAdaptSection(parentElement
, section
);
1622 public NamedAreaDetailSection
createNamedAreaDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1623 NamedAreaDetailSection section
= new NamedAreaDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1624 addAndAdaptSection(parentElement
, section
);
1628 public UseRecordDetailSection
createUseRecordDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1629 UseRecordDetailSection section
= new UseRecordDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1630 addAndAdaptSection(parentElement
, section
);
1634 public DerivedUnitGeneralDetailSection
createFOSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1635 DerivedUnitGeneralDetailSection section
= new DerivedUnitGeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1636 addAndAdaptSection(parentElement
, section
);
1640 public GatheringEventDetailSection
createGatheringSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1641 GatheringEventDetailSection section
= new GatheringEventDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1642 addAndAdaptSection(parentElement
, section
);
1646 public FieldUnitDetailSection
createFODetailsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1647 FieldUnitDetailSection section
= new FieldUnitDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1648 addAndAdaptSection(parentElement
, section
);
1652 private void addAndAdaptSection(ICdmFormElement parentElement
, AbstractFormSection
<?
> section
) {
1653 parentElement
.addElement(section
);
1657 //--------DetailElements------------
1659 public UseRecordDetailElement
createUseRecordDetailElement(ICdmFormElement parentElement
){
1660 UseRecordDetailElement element
= new UseRecordDetailElement(this, parentElement
);
1661 addAndAdaptElement(parentElement
, element
);
1665 public DefinedTermDetailElement
<NamedAreaLevel
> createNamedAreaLevelElement(ICdmFormElement parentElement
){
1666 DefinedTermDetailElement
<NamedAreaLevel
> element
= new DefinedTermDetailElement
<NamedAreaLevel
>(this, parentElement
);
1667 addAndAdaptElement(parentElement
, element
);
1671 public eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement
createNamedAreaDetailElement(ICdmFormElement parentElement
){
1672 eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement element
= new eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement(this, parentElement
);
1673 addAndAdaptElement(parentElement
, element
);
1677 public TermVocabularyDetailElement
createTermVocabularyDetailElement(ICdmFormElement parentElement
){
1678 TermVocabularyDetailElement element
= new TermVocabularyDetailElement(this, parentElement
);
1679 addAndAdaptElement(parentElement
, element
);
1683 public ReferenceEntityDetailElement
createReferenceEntityDetailElement(ICdmFormElement parentElement
){
1684 ReferenceEntityDetailElement element
= new ReferenceEntityDetailElement(this, parentElement
);
1685 addAndAdaptElement(parentElement
, element
);
1689 public TaxonRelationshipDetailElement
createTaxonRelationshipDetailElement(ICdmFormElement parentElement
){
1690 TaxonRelationshipDetailElement element
= new TaxonRelationshipDetailElement(this, parentElement
);
1691 addAndAdaptElement(parentElement
, element
);
1695 public GrantedAuthorityDetailElement
createGrantedAuthorityDetailElement(ICdmFormElement parentElement
){
1696 GrantedAuthorityDetailElement element
= new GrantedAuthorityDetailElement(this, parentElement
);
1697 addAndAdaptElement(parentElement
, element
);
1701 public GroupDetailElement
createGroupDetailElement(ICdmFormElement parentElement
){
1702 GroupDetailElement element
= new GroupDetailElement(this, parentElement
);
1703 addAndAdaptElement(parentElement
, element
);
1707 public UserDetailElement
createUserDetailElement(ICdmFormElement parentElement
){
1708 UserDetailElement element
= new UserDetailElement(this, parentElement
);
1709 addAndAdaptElement(parentElement
, element
);
1713 public HybridDetailElement
createHybridDetailElement(ICdmFormElement parentElement
){
1714 HybridDetailElement element
= new HybridDetailElement(this, parentElement
);
1715 addAndAdaptElement(parentElement
, element
);
1719 public InstitutionDetailElement
createInstitutionDetailElement(ICdmFormElement parentElement
){
1720 InstitutionDetailElement element
= new InstitutionDetailElement(this, parentElement
);
1721 addAndAdaptElement(parentElement
, element
);
1725 public PolytomousKeyNodeDetailElement
createPolytomousKeyNodeDetailElement(ICdmFormElement parentElement
){
1726 PolytomousKeyNodeDetailElement element
= new PolytomousKeyNodeDetailElement(this, parentElement
);
1727 addAndAdaptElement(parentElement
, element
);
1731 public PolytomousKeyDetailElement
createPolytomousKeyDetailElement(ICdmFormElement parentElement
){
1732 PolytomousKeyDetailElement element
= new PolytomousKeyDetailElement(this, parentElement
);
1733 addAndAdaptElement(parentElement
, element
);
1737 public CollectionDetailElement
createCollectionDetailElement(ICdmFormElement parentElement
){
1738 CollectionDetailElement element
= new CollectionDetailElement(this, parentElement
);
1739 addAndAdaptElement(parentElement
, element
);
1743 public TaxonNodeDetailElement
createTaxonNodeDetailElement(ICdmFormElement parentElement
){
1744 TaxonNodeDetailElement element
= new TaxonNodeDetailElement(this, parentElement
);
1745 addAndAdaptElement(parentElement
, element
);
1749 public ClassificationDetailElement
createClassificationDetailElement(ICdmFormElement parentElement
){
1750 ClassificationDetailElement element
= new ClassificationDetailElement(this, parentElement
);
1751 addAndAdaptElement(parentElement
, element
);
1755 public FeatureDistributionDetailElement
createFeatureDistributionDetailElement(ICdmFormElement parentElement
){
1756 FeatureDistributionDetailElement element
= new FeatureDistributionDetailElement(this, parentElement
);
1757 addAndAdaptElement(parentElement
, element
);
1761 public NaturalLanguageDetailElement
createNaturalLanguageDetailElement(ICdmFormElement parentElement
){
1762 NaturalLanguageDetailElement element
= new NaturalLanguageDetailElement(this, parentElement
);
1763 addAndAdaptElement(parentElement
, element
);
1767 public DerivedUnitFacadeDetailElement
createDerivedUnitFacadeDetailElement(ICdmFormElement parentElement
){
1768 DerivedUnitFacadeDetailElement element
= new DerivedUnitFacadeDetailElement(this, parentElement
);
1769 addAndAdaptElement(parentElement
, element
);
1773 public NonViralNameDetailElement
createNonViralNameDetailElement(ICdmFormElement parentElement
){
1774 NonViralNameDetailElement element
= new NonViralNameDetailElement(this, parentElement
);
1775 addAndAdaptElement(parentElement
, element
);
1779 public DescriptionElementDetailElement
createDescriptionElementDetailElement(ICdmFormElement parentElement
, int style
){
1780 DescriptionElementDetailElement element
= new DescriptionElementDetailElement(this, parentElement
, style
);
1781 addAndAdaptElement(parentElement
, element
);
1785 public DescriptionDetailElement
createDescriptionDetailElement(ICdmFormElement parentElement
, int style
){
1786 DescriptionDetailElement element
= new DescriptionDetailElement(this, parentElement
, style
);
1787 addAndAdaptElement(parentElement
, element
);
1791 public PersonDetailElement
createPersonDetailElement(ICdmFormElement parentElement
, int style
){
1792 PersonDetailElement element
= new PersonDetailElement(this, parentElement
, style
);
1793 addAndAdaptElement(parentElement
, element
);
1797 public TeamDetailElement
createTeamDetailElement(ICdmFormElement parentElement
, int style
){
1798 TeamDetailElement element
= new TeamDetailElement(this, parentElement
, style
);
1799 addAndAdaptElement(parentElement
, element
);
1803 public AuthorshipDetailElement
createAuthorshipDetailElement(ICdmFormElement parentElement
, int style
){
1804 AuthorshipDetailElement element
= new AuthorshipDetailElement(this, parentElement
, style
);
1805 addAndAdaptElement(parentElement
, element
);
1809 public TaxonBaseDetailElement
createTaxonBaseDetailElement(ICdmFormElement parentElement
, int style
){
1810 TaxonBaseDetailElement element
= new TaxonBaseDetailElement(this, parentElement
, style
);
1811 addAndAdaptElement(parentElement
, element
);
1815 public NameDetailElement
createNameDetailElement(ICdmFormElement parentElement
, int style
){
1816 NameDetailElement element
= new NameDetailElement(this, parentElement
, style
);
1817 addAndAdaptElement(parentElement
, element
);
1821 public ReferenceDetailElement
createReferenceDetailElement(ICdmFormElement parentElement
, int style
){
1822 ReferenceDetailElement element
= new ReferenceDetailElement(this, parentElement
, style
);
1823 addAndAdaptElement(parentElement
, element
);
1827 public NomenclaturalReferenceDetailElement
createNomenclaturalReferenceDetailElement(ICdmFormElement parentElement
, int style
){
1828 NomenclaturalReferenceDetailElement element
= new NomenclaturalReferenceDetailElement(this, parentElement
, style
);
1829 addAndAdaptElement(parentElement
, element
);
1834 public FieldUnitGeneralDetailElement
createFieldUnitGeneralDetailElement(ICdmFormElement parentElement
){
1835 FieldUnitGeneralDetailElement element
= new FieldUnitGeneralDetailElement(this, parentElement
);
1836 addAndAdaptElement(parentElement
, element
);
1840 public DerivedUnitGeneralDetailElement
createDerivedUnitGeneralDetailElement(ICdmFormElement parentElement
){
1841 DerivedUnitGeneralDetailElement element
= new DerivedUnitGeneralDetailElement(this, parentElement
);
1842 addAndAdaptElement(parentElement
, element
);
1846 public GatheringEventDetailElement
createGatheringEventDetailElement(ICdmFormElement parentElement
) {
1847 GatheringEventDetailElement element
= new GatheringEventDetailElement(this, parentElement
);
1848 addAndAdaptElement(parentElement
, element
);
1852 public FieldUnitDetailElement
createFieldUnitDetailElement(ICdmFormElement parentElement
) {
1853 FieldUnitDetailElement element
= new FieldUnitDetailElement(this, parentElement
);
1854 addAndAdaptElement(parentElement
, element
);
1858 public DerivedUnitBaseDetailElement
createDerivedUnitBaseDetailElement(ICdmFormElement parentElement
) {
1859 DerivedUnitBaseDetailElement element
= new DerivedUnitBaseDetailElement(this, parentElement
);
1860 addAndAdaptElement(parentElement
, element
);
1864 public DeterminationDetailElement
createDeterminationDetailElement(ICdmFormElement parentElement
) {
1865 DeterminationDetailElement element
= new DeterminationDetailElement(this, parentElement
);
1866 addAndAdaptElement(parentElement
, element
);
1871 * @param parentElement
1874 private void addAndAdaptElement(ICdmFormElement parentElement
, AbstractCdmDetailElement
<?
> element
) {
1876 parentElement
.addElement(element
);
1879 //--------EntityCollectionSection----------
1880 public TeamMemberSection
createTeamMemberSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1881 TeamMemberSection section
= new TeamMemberSection(this, conversation
, parentElement
, style
);
1882 addAndAdaptSection(parentElement
, section
);
1886 public AnnotationSection
createAnnotationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1887 AnnotationSection section
= new AnnotationSection(this, conversation
, parentElement
, style
);
1888 addAndAdaptSection(parentElement
, section
);
1892 public CreditSection
createCreditSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1893 CreditSection section
= new CreditSection(this, conversation
, parentElement
, style
);
1894 addAndAdaptSection(parentElement
, section
);
1898 public DescriptionElementSourceSection
createDescriptionElementSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1899 DescriptionElementSourceSection section
= new DescriptionElementSourceSection(this, conversation
, parentElement
, style
);
1900 addAndAdaptSection(parentElement
, section
);
1904 public ExtensionSection
createExtensionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1905 ExtensionSection section
= new ExtensionSection(this, conversation
, parentElement
, style
);
1906 addAndAdaptSection(parentElement
, section
);
1910 public MarkerSection
createMarkerSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1911 MarkerSection section
= new MarkerSection(this, conversation
, parentElement
, style
);
1912 addAndAdaptSection(parentElement
, section
);
1916 public MediaSection
createMediaSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1917 MediaSection section
= new MediaSection(this, conversation
, parentElement
, style
);
1918 addAndAdaptSection(parentElement
, section
);
1922 public DescriptionElementMediaSection
createDescriptionElementMediaSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1923 DescriptionElementMediaSection section
= new DescriptionElementMediaSection(this, conversation
, parentElement
, style
);
1924 addAndAdaptSection(parentElement
, section
);
1928 public MediaRepresentationSection
createMediaRepresentationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1929 MediaRepresentationSection section
= new MediaRepresentationSection(this, conversation
, parentElement
, style
);
1930 addAndAdaptSection(parentElement
, section
);
1934 public MediaRepresentationPartSection
createMediaRepresentationPartSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1935 MediaRepresentationPartSection section
= new MediaRepresentationPartSection(this, conversation
, parentElement
, style
);
1936 addAndAdaptSection(parentElement
, section
);
1940 public ModifierSection
createModifierSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1941 ModifierSection section
= new ModifierSection(this, conversation
, parentElement
, style
);
1942 addAndAdaptSection(parentElement
, section
);
1946 public NomenclaturalStatusSection
createNomenclaturalStatusSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1947 NomenclaturalStatusSection section
= new NomenclaturalStatusSection(this, conversation
, parentElement
, style
);
1948 addAndAdaptSection(parentElement
, section
);
1952 public NameRelationshipDetailSection
createNameRelationshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1953 NameRelationshipDetailSection section
= new NameRelationshipDetailSection(this, conversation
, parentElement
, style
);
1954 addAndAdaptSection(parentElement
, section
);
1958 public ProtologueSection
createProtologueSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1959 ProtologueSection section
= new ProtologueSection(this, conversation
, parentElement
, style
);
1960 addAndAdaptSection(parentElement
, section
);
1964 public RightsSection
createRightsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1965 RightsSection section
= new RightsSection(this, conversation
, parentElement
, style
);
1966 addAndAdaptSection(parentElement
, section
);
1970 public SourceSection
createSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1971 SourceSection section
= new SourceSection(this, conversation
, parentElement
, style
);
1972 addAndAdaptSection(parentElement
, section
);
1976 public ScopeSection
createScopeSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1977 ScopeSection section
= new ScopeSection(this, conversation
, parentElement
, style
);
1978 addAndAdaptSection(parentElement
, section
);
1982 public DescriptionSourceSection
createDescriptionSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1983 DescriptionSourceSection section
= new DescriptionSourceSection(this, conversation
, parentElement
, style
);
1984 addAndAdaptSection(parentElement
, section
);
1988 public TypeDesignationSection
createTypeDesignationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1989 TypeDesignationSection section
= new TypeDesignationSection(this, conversation
, parentElement
, style
);
1990 addAndAdaptSection(parentElement
, section
);
1994 public StateDataSection
createStateDataSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1995 StateDataSection section
= new StateDataSection(this, conversation
, parentElement
, style
);
1996 addAndAdaptSection(parentElement
, section
);
2000 public StatisticalMeasurementValueSection
createStatisticalMeasurementValueSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2001 StatisticalMeasurementValueSection section
= new StatisticalMeasurementValueSection(this, conversation
, parentElement
, style
);
2002 addAndAdaptSection(parentElement
, section
);
2006 public DescribedSpecimenSection
createDescribedSpecimenSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2007 DescribedSpecimenSection section
= new DescribedSpecimenSection(this, conversation
, parentElement
, style
);
2008 addAndAdaptSection(parentElement
, section
);
2012 public CollectingAreasDetailSection
createCollectingAreasDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2013 CollectingAreasDetailSection section
= new CollectingAreasDetailSection(this, conversation
, parentElement
, style
);
2014 addAndAdaptSection(parentElement
, section
);
2018 public CurrentDeterminationDetailSection
createCurrentDeterminationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2019 CurrentDeterminationDetailSection section
= new CurrentDeterminationDetailSection(this, conversation
, parentElement
, style
);
2020 addAndAdaptSection(parentElement
, section
);
2024 public DeterminationHistoryDetailSection
createDeterminationHistoryDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2025 DeterminationHistoryDetailSection section
= new DeterminationHistoryDetailSection(this, conversation
, parentElement
, style
);
2026 addAndAdaptSection(parentElement
, section
);
2030 public SpecimenCollectionDetailSection
createSpecimenCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2031 SpecimenCollectionDetailSection section
= new SpecimenCollectionDetailSection(this, conversation
, parentElement
, style
);
2032 addAndAdaptSection(parentElement
, section
);
2036 public SourceCollectionDetailSection
createSourceCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2037 SourceCollectionDetailSection section
= new SourceCollectionDetailSection(this, conversation
, parentElement
, style
);
2038 addAndAdaptSection(parentElement
, section
);
2042 public GeographicalScopeDetailSection
createGeographicalScopeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2043 GeographicalScopeDetailSection section
= new GeographicalScopeDetailSection(this, conversation
, parentElement
, style
);
2044 addAndAdaptSection(parentElement
, section
);
2048 public ScopeRestrictionSection
createScopeRestrictionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2049 ScopeRestrictionSection section
= new ScopeRestrictionSection(this, conversation
, parentElement
, style
);
2050 addAndAdaptSection(parentElement
, section
);
2054 public MemberDetailSection
createMemberDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2055 MemberDetailSection section
= new MemberDetailSection(this, conversation
, parentElement
, style
);
2056 addAndAdaptSection(parentElement
, section
);
2060 public GrantedAuthorityDetailSection
createGrantedAuthorityDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2061 GrantedAuthorityDetailSection section
= new GrantedAuthorityDetailSection(this, conversation
, parentElement
, style
);
2062 addAndAdaptSection(parentElement
, section
);
2066 public GroupsByUserDetailSection
createGroupsByUserDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2067 GroupsByUserDetailSection section
= new GroupsByUserDetailSection(this, conversation
, parentElement
, style
);
2068 addAndAdaptSection(parentElement
, section
);
2072 public TaxonomicScopeSection
createTaxonomicScopeSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2073 TaxonomicScopeSection section
= new TaxonomicScopeSection(this, conversation
, parentElement
, style
);
2074 addAndAdaptSection(parentElement
, section
);
2080 * createEntityCollectionElement
2083 * @param removeListener
2084 * a {@link org.eclipse.swt.events.SelectionListener} object.
2087 * @param parentElement
2089 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
2091 * @param versionableEntity
2092 * a {@link eu.etaxonomy.cdm.model.common.IVersionableEntity}
2094 * @param backgroundColor
2095 * a {@link org.eclipse.swt.graphics.Color} object.
2097 * {@link eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement}
2100 public AbstractEntityCollectionElement
createEntityCollectionElement(AbstractFormSection parentElement
,
2101 Object versionableEntity
, SelectionListener removeListener
, Color backgroundColor
, int style
) {
2102 AbstractEntityCollectionElement element
= null;
2104 Object entity
= HibernateProxyHelper
.deproxy(versionableEntity
);
2106 if (entity
instanceof Annotation
) {
2107 element
= new AnnotationElement(this, parentElement
, (Annotation
) entity
, removeListener
, style
);
2108 } else if (entity
instanceof Person
) {
2109 element
= new TeamMemberElement(this, parentElement
, (Person
) entity
, removeListener
, style
);
2110 } else if (entity
instanceof Credit
) {
2111 element
= new CreditElement(this, parentElement
, (Credit
) entity
, removeListener
, style
);
2112 } else if (entity
instanceof Extension
) {
2113 element
= new ExtensionElement(this, parentElement
, (Extension
) entity
, removeListener
, style
);
2114 } else if (entity
instanceof Marker
) {
2115 element
= new MarkerElement(this, parentElement
, (Marker
) entity
, removeListener
, style
);
2116 } else if (entity
instanceof Media
) {
2117 element
= new MediaElement(this, parentElement
, (Media
) entity
, removeListener
, style
);
2118 } else if (entity
instanceof MediaRepresentation
) {
2119 element
= new MediaRepresentationElement(this, parentElement
, (MediaRepresentation
) entity
, removeListener
,
2121 } else if (entity
instanceof ImageFile
) {
2122 element
= new ImageFileElement(this, parentElement
, (ImageFile
) entity
, removeListener
, style
);
2123 } else if (entity
instanceof MediaRepresentationPart
){
2124 element
= new MediaRepresentationPartElement(this, parentElement
, (MediaRepresentationPart
) entity
,
2125 removeListener
, style
);
2126 } else if (entity
instanceof NomenclaturalStatus
) {
2127 element
= new NomenclaturalStatusElement(this, parentElement
, (NomenclaturalStatus
) entity
, removeListener
,
2129 } else if (entity
instanceof Rights
) {
2130 element
= new RightsElement(this, parentElement
, (Rights
) entity
, removeListener
, style
);
2131 } else if (entity
instanceof DescriptionElementSource
) {
2132 element
= new DescriptionElementSourceElement(this, parentElement
, (DescriptionElementSource
) entity
,
2133 removeListener
, style
);
2134 } else if (entity
instanceof IdentifiableSource
) {
2135 element
= new IdentifiableSourceElement(this, parentElement
, (IdentifiableSource
) entity
, removeListener
,
2137 } else if (entity
instanceof DefinedTerm
) {
2138 switch(((DefinedTerm
)entity
).getTermType()) {
2140 element
= new ScopeElement(this,
2142 (DefinedTerm
) entity
,
2147 element
= new ModifierElement(this,
2149 (DefinedTerm
) entity
,
2154 //FIXME : Actually we should through an exception here
2159 } else if (entity
instanceof Reference
) {
2160 element
= new DescriptionSourceElement(this, parentElement
, (Reference
) entity
, removeListener
, style
);
2161 } else if (entity
instanceof NameTypeDesignation
) {
2162 element
= new NameTypeDesignationElement(this, parentElement
, (NameTypeDesignation
) entity
, removeListener
,
2164 } else if (entity
instanceof NameRelationship
) {
2165 element
= new NameRelationshipDetailElement(this, parentElement
, (NameRelationship
) entity
, removeListener
,
2167 } else if (entity
instanceof SpecimenTypeDesignation
) {
2168 element
= new SpecimenTypeDesignationElement(this, parentElement
, (SpecimenTypeDesignation
) entity
,
2169 removeListener
, style
);
2170 } else if (entity
instanceof StateData
) {
2171 element
= new StateDataElement(this, parentElement
, (StateData
) entity
, removeListener
, style
);
2172 } else if (entity
instanceof StatisticalMeasurementValue
) {
2173 element
= new StatisticalMeasurementValueElement(this, parentElement
, (StatisticalMeasurementValue
) entity
,
2174 removeListener
, style
);
2175 } else if (entity
instanceof DerivedUnit
) {
2176 switch(((DerivedUnit
)entity
).getRecordBasis()) {
2177 case LivingSpecimen
:
2178 case PreservedSpecimen
:
2180 element
= new SpecimenCollectionDetailElement(this,
2182 (DerivedUnit
) entity
,
2187 element
= new DerivedUnitElement(this,
2189 (DerivedUnit
) entity
,
2194 } else if (entity
instanceof NamedArea
) {
2195 element
= new NamedAreaDetailElement(this, parentElement
, (NamedArea
) entity
, removeListener
, style
);
2196 } else if (entity
instanceof DeterminationEvent
) {
2197 element
= new DeterminationEventDetailElement(this, parentElement
, (DeterminationEvent
) entity
,
2198 removeListener
, style
);
2199 } else if (entity
instanceof User
) {
2200 element
= new MemberDetailElement(this, parentElement
, (User
) entity
, removeListener
, style
);
2201 } else if (entity
instanceof GrantedAuthority
) {
2202 element
= new GrantedAuthorityCollectionElement(this, parentElement
, (GrantedAuthorityImpl
) entity
,
2203 removeListener
, style
);
2204 } else if (entity
instanceof Group
) {
2205 element
= new GroupsByUserDetailElement(this, parentElement
, (Group
) entity
, removeListener
, style
);
2206 } else if (entity
instanceof Taxon
) {
2207 element
= new TaxonDetailElement(this, parentElement
, (Taxon
) entity
, removeListener
, style
);
2208 } else if (entity
instanceof DescriptionElementBase
) {
2209 // this is the special case for protologs, maybe we can do this
2210 // differently when API improves
2211 DescriptionElementBase descriptionElement
= (DescriptionElementBase
) entity
;
2212 if (descriptionElement
.getFeature().equals(Feature
.PROTOLOGUE())) {
2213 element
= new ProtologueElement(this, parentElement
, descriptionElement
, removeListener
, style
);
2217 if (element
== null) {
2218 AbstractUtility
.errorDialog("No element for entity", this,
2219 "Could not generate element for entity. Looks like the case is not handled already. Check implementation. Entity: "
2224 else if (backgroundColor
!= null && !backgroundColor
.isDisposed()) {
2225 element
.setPersistentBackground(backgroundColor
);
2229 parentElement
.addElement(element
);
2235 * Creates a selection element for the given type T.
2238 * <strong>Selection elements not handled by this method:</strong>
2240 * <li>{@link TaxonNodeSelectionElement} see
2241 * {@link #createTaxonNodeSelectionElement(ConversationHolder, ICdmFormElement, String, TaxonNode, int, int)}
2243 * <li>{@link NomenclaturalAuthorTeamSelectionElement} see
2244 * {@link #createNomenclaturalAuthorTeamSelectionElement(ConversationHolder, ICdmFormElement, String, Team, int, int)}
2250 * a {@link Class} object of the type that you want the selection
2252 * @param parentElement
2253 * a {@link ICdmFormElement} object.
2254 * @param labelString
2255 * a {@link String} object.
2256 * @param selectionType
2258 * a {@link ICdmBase} object.
2261 * @param conversation
2262 * a {@link ConversationHolder} object.
2263 * @return a {@link EntitySelectionElement} object.
2265 public <T
extends ICdmBase
> EntitySelectionElement
<T
> createSelectionElement(Class
<T
> clazz
,
2266 ConversationHolder conversation
, ICdmFormElement parentElement
, String labelString
, T selection
, int mode
,
2268 EntitySelectionElement
<T
> element
= new EntitySelectionElement
<T
>(this, conversation
, parentElement
, clazz
,
2269 labelString
, selection
, mode
, style
);
2271 parentElement
.addElement(element
);
2275 public TaxonNodeSelectionElement
createTaxonNodeSelectionElement(ConversationHolder conversation
,
2276 ICdmFormElement parentElement
, String labelString
, TaxonNode selection
, int mode
, int style
) {
2277 TaxonNodeSelectionElement element
= new TaxonNodeSelectionElement(this, conversation
, parentElement
,
2278 labelString
, selection
, mode
, style
);
2280 parentElement
.addElement(element
);
2284 public NomenclaturalAuthorTeamSelectionElement
createNomenclaturalAuthorTeamSelectionElement(
2285 ConversationHolder conversation
, ICdmFormElement parentElement
, String labelString
, Team selection
,
2286 int mode
, int style
) {
2287 NomenclaturalAuthorTeamSelectionElement element
= new NomenclaturalAuthorTeamSelectionElement(this,
2288 conversation
, parentElement
, labelString
, selection
, mode
, style
);
2290 parentElement
.addElement(element
);
2295 /** {@inheritDoc} */
2296 public LabelElement
createLabel(ICdmFormElement parentElement
, String text
) {
2297 LabelElement labelElement
= new LabelElement(this, parentElement
, text
);
2298 adapt(labelElement
);
2299 parentElement
.addElement(labelElement
);
2300 return labelElement
;
2305 * Getter for the field <code>selectionProvider</code>.
2308 * @return a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
2310 public ISelectionProvider
getSelectionProvider() {
2311 return selectionProvider
;
2316 * createDetailedDescriptionDetailElement
2319 * @param parentElement
2320 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
2324 * {@link eu.etaxonomy.cdm.model.description.DescriptionElementBase}
2329 * {@link eu.etaxonomy.taxeditor.ui.section.description.detail.AbstractDetailedDescriptionDetailElement}
2332 public AbstractDetailedDescriptionDetailElement
createDetailedDescriptionDetailElement(
2333 ICdmFormElement parentElement
, DescriptionElementBase entity
, int style
) {
2334 AbstractDetailedDescriptionDetailElement detailedDescriptionElement
= null;
2336 if (entity
instanceof CategoricalData
) {
2337 detailedDescriptionElement
= new CategoricalDataDetailElement(this, parentElement
,
2338 (CategoricalData
) entity
, style
);
2339 } else if (entity
instanceof CommonTaxonName
) {
2340 detailedDescriptionElement
= new CommonNameDetailElement(this, parentElement
, (CommonTaxonName
) entity
,
2342 } else if (entity
instanceof Distribution
) {
2343 detailedDescriptionElement
= new DistributionDetailElement(this, parentElement
, (Distribution
) entity
,
2345 } else if (entity
instanceof IndividualsAssociation
) {
2346 detailedDescriptionElement
= new IndividualsAssociationDetailElement(this, parentElement
,
2347 (IndividualsAssociation
) entity
, style
);
2348 } else if (entity
instanceof QuantitativeData
) {
2349 detailedDescriptionElement
= new QuantitativeDataDetailElement(this, parentElement
,
2350 (QuantitativeData
) entity
, style
);
2351 } else if (entity
instanceof TaxonInteraction
) {
2352 detailedDescriptionElement
= new TaxonInteractionDetailElement(this, parentElement
,
2353 (TaxonInteraction
) entity
, style
);
2354 } else if (entity
instanceof TextData
) {
2355 detailedDescriptionElement
= new TextDataDetailElement(this, parentElement
, (TextData
) entity
, style
);
2357 throw new IllegalStateException("There is no interface for the given description element");
2359 adapt(detailedDescriptionElement
);
2360 parentElement
.addElement(detailedDescriptionElement
);
2361 return detailedDescriptionElement
;
2366 * Creates a styled text as a part of the form.
2371 * the text initial value
2374 * @return the text widget
2376 public StyledText
createStyledText(Composite parent
, String value
, int style
) {
2377 StyledText text
= new StyledText(parent
, getBorderStyle() | style
| getOrientation());
2378 if (value
!= null) {
2379 text
.setText(value
);
2381 text
.setForeground(getColors().getForeground());
2382 text
.setBackground(getColors().getBackground());
2383 // text.addFocusListener(visibilityHandler);