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
.hibernate
.HibernateProxyHelper
;
45 import eu
.etaxonomy
.cdm
.model
.agent
.Person
;
46 import eu
.etaxonomy
.cdm
.model
.agent
.Team
;
47 import eu
.etaxonomy
.cdm
.model
.common
.Annotation
;
48 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
49 import eu
.etaxonomy
.cdm
.model
.common
.Credit
;
50 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTermBase
;
51 import eu
.etaxonomy
.cdm
.model
.common
.DescriptionElementSource
;
52 import eu
.etaxonomy
.cdm
.model
.common
.Extension
;
53 import eu
.etaxonomy
.cdm
.model
.common
.GrantedAuthorityImpl
;
54 import eu
.etaxonomy
.cdm
.model
.common
.Group
;
55 import eu
.etaxonomy
.cdm
.model
.common
.ICdmBase
;
56 import eu
.etaxonomy
.cdm
.model
.common
.IDefinedTerm
;
57 import eu
.etaxonomy
.cdm
.model
.common
.IdentifiableSource
;
58 import eu
.etaxonomy
.cdm
.model
.common
.Language
;
59 import eu
.etaxonomy
.cdm
.model
.common
.LanguageString
;
60 import eu
.etaxonomy
.cdm
.model
.common
.Marker
;
61 import eu
.etaxonomy
.cdm
.model
.common
.TimePeriod
;
62 import eu
.etaxonomy
.cdm
.model
.common
.User
;
63 import eu
.etaxonomy
.cdm
.model
.common
.VersionableEntity
;
64 import eu
.etaxonomy
.cdm
.model
.description
.CategoricalData
;
65 import eu
.etaxonomy
.cdm
.model
.description
.CommonTaxonName
;
66 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionElementBase
;
67 import eu
.etaxonomy
.cdm
.model
.description
.Distribution
;
68 import eu
.etaxonomy
.cdm
.model
.description
.Feature
;
69 import eu
.etaxonomy
.cdm
.model
.description
.IndividualsAssociation
;
70 import eu
.etaxonomy
.cdm
.model
.description
.KeyStatement
;
71 import eu
.etaxonomy
.cdm
.model
.description
.Modifier
;
72 import eu
.etaxonomy
.cdm
.model
.description
.QuantitativeData
;
73 import eu
.etaxonomy
.cdm
.model
.description
.Scope
;
74 import eu
.etaxonomy
.cdm
.model
.description
.StateData
;
75 import eu
.etaxonomy
.cdm
.model
.description
.StatisticalMeasurementValue
;
76 import eu
.etaxonomy
.cdm
.model
.description
.TaxonInteraction
;
77 import eu
.etaxonomy
.cdm
.model
.description
.TextData
;
78 import eu
.etaxonomy
.cdm
.model
.location
.NamedArea
;
79 import eu
.etaxonomy
.cdm
.model
.location
.NamedAreaLevel
;
80 import eu
.etaxonomy
.cdm
.model
.location
.Point
;
81 import eu
.etaxonomy
.cdm
.model
.media
.ImageFile
;
82 import eu
.etaxonomy
.cdm
.model
.media
.Media
;
83 import eu
.etaxonomy
.cdm
.model
.media
.MediaRepresentation
;
84 import eu
.etaxonomy
.cdm
.model
.media
.MediaRepresentationPart
;
85 import eu
.etaxonomy
.cdm
.model
.media
.Rights
;
86 import eu
.etaxonomy
.cdm
.model
.name
.NameRelationship
;
87 import eu
.etaxonomy
.cdm
.model
.name
.NameTypeDesignation
;
88 import eu
.etaxonomy
.cdm
.model
.name
.NomenclaturalStatus
;
89 import eu
.etaxonomy
.cdm
.model
.name
.SpecimenTypeDesignation
;
90 import eu
.etaxonomy
.cdm
.model
.occurrence
.DerivedUnit
;
91 import eu
.etaxonomy
.cdm
.model
.occurrence
.DeterminationEvent
;
92 import eu
.etaxonomy
.cdm
.model
.occurrence
.Specimen
;
93 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
94 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
95 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonNode
;
96 import eu
.etaxonomy
.cdm
.strategy
.parser
.ParserProblem
;
97 import eu
.etaxonomy
.taxeditor
.model
.AbstractUtility
;
98 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.FieldObservationGeneralElement
;
99 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.FieldObservationGeneralElementController
;
100 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.GatheringEventDetailsElement
;
101 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.GatheringEventDetailsElementController
;
102 import eu
.etaxonomy
.taxeditor
.ui
.combo
.EnumComboElement
;
103 import eu
.etaxonomy
.taxeditor
.ui
.combo
.TermComboElement
;
104 import eu
.etaxonomy
.taxeditor
.ui
.openurl
.IOpenUrlEnabled
;
105 import eu
.etaxonomy
.taxeditor
.ui
.openurl
.OpenUrlSelectorElement
;
106 import eu
.etaxonomy
.taxeditor
.ui
.password
.EditPasswordElement
;
107 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailElement
;
108 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailSection
;
109 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionElement
;
110 import eu
.etaxonomy
.taxeditor
.ui
.section
.EmptyElement
;
111 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.InstitutionDetailElement
;
112 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.InstitutionDetailSection
;
113 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailElement
;
114 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailSection
;
115 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailElement
;
116 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailSection
;
117 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamMemberElement
;
118 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamMemberSection
;
119 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamOrPersonBaseDetailSection
;
120 import eu
.etaxonomy
.taxeditor
.ui
.section
.campanula
.compatibility
.ICdmFormElement
;
121 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.ClassificationDetailElement
;
122 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.ClassificationDetailSection
;
123 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.TaxonNodeDetailElement
;
124 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.TaxonNodeDetailSection
;
125 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferenceEntityDetailElement
;
126 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferencedEntityDetailSection
;
127 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DerivedUnitElement
;
128 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescribedSpecimenSection
;
129 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailElement
;
130 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailSection
;
131 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailElement
;
132 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailSection
;
133 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementMediaSection
;
134 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceElement
;
135 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceSection
;
136 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceElement
;
137 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceSection
;
138 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.MediaDetailsSection
;
139 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ModifierElement
;
140 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ModifierSection
;
141 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageDetailElement
;
142 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageSection
;
143 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeElement
;
144 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeSection
;
145 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StateDataElement
;
146 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StateDataSection
;
147 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StatisticalMeasurementValueElement
;
148 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StatisticalMeasurementValueSection
;
149 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.AbstractDetailedDescriptionDetailElement
;
150 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.CategoricalDataDetailElement
;
151 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.CommonNameDetailElement
;
152 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.DistributionDetailElement
;
153 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.IndividualsAssociationDetailElement
;
154 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.QuantitativeDataDetailElement
;
155 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.TaxonInteractionDetailElement
;
156 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.TextDataDetailElement
;
157 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailElement
;
158 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailSection
;
159 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityCollectionElement
;
160 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailElement
;
161 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailSection
;
162 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailElement
;
163 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailSection
;
164 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailElement
;
165 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailSection
;
166 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.GeographicalScopeDetailSection
;
167 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailElement
;
168 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailSection
;
169 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailElement
;
170 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailSection
;
171 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.ScopeRestrictionSection
;
172 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.TaxonomicScopeSection
;
173 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.ImageFileElement
;
174 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaElement
;
175 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationElement
;
176 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationPartElement
;
177 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationPartSection
;
178 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationSection
;
179 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaSection
;
180 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.AuthorshipDetailElement
;
181 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.AuthorshipDetailSection
;
182 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.HybridDetailElement
;
183 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.HybridDetailSection
;
184 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameDetailElement
;
185 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameDetailSection
;
186 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailElement
;
187 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailSection
;
188 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameTypeDesignationElement
;
189 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusElement
;
190 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusSection
;
191 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailElement
;
192 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailSection
;
193 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.ProtologueElement
;
194 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.ProtologueSection
;
195 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.SpecimenTypeDesignationElement
;
196 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.TypeDesignationSection
;
197 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CollectingAreasDetailSection
;
198 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CollectionDetailElement
;
199 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CurrentDeterminationDetailSection
;
200 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitBaseDetailElement
;
201 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitBaseDetailSection
;
202 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitFacadeDetailElement
;
203 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitFacadeDetailSection
;
204 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailElement
;
205 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailSection
;
206 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationEventDetailElement
;
207 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationHistoryDetailSection
;
208 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldObservationDetailElement
;
209 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldObservationDetailSection
;
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
.GeneralDetailElement
;
213 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GeneralDetailSection
;
214 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.NamedAreaDetailElement
;
215 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SourceCollectionDetailSection
;
216 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SpecimenCollectionDetailElement
;
217 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SpecimenCollectionDetailSection
;
218 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailElement
;
219 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailSection
;
220 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailElement
;
221 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailSection
;
222 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.AnnotationElement
;
223 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.AnnotationSection
;
224 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CdmBaseElement
;
225 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CdmBaseSection
;
226 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CreditElement
;
227 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CreditSection
;
228 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.ExtensionElement
;
229 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.ExtensionSection
;
230 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.HeadlineSection
;
231 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.IdentifiableSourceElement
;
232 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.MarkerElement
;
233 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.MarkerSection
;
234 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.RightsElement
;
235 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.RightsSection
;
236 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.SourceSection
;
237 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.VersionElement
;
238 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.VersionSection
;
239 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessageElement
;
240 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessagesSection
;
241 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailElement
;
242 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailSection
;
243 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonDetailElement
;
244 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailElement
;
245 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailSection
;
246 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailElement
;
247 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailSection
;
248 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailElement
;
249 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailSection
;
250 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailElement
;
251 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailSection
;
252 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.DefinedTermDetailElement
;
253 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.DefinedTermDetailSection
;
254 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailSection
;
255 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailElement
;
256 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailSection
;
257 import eu
.etaxonomy
.taxeditor
.ui
.selection
.EntitySelectionElement
;
258 import eu
.etaxonomy
.taxeditor
.ui
.selection
.NomenclaturalAuthorTeamSelectionElement
;
259 import eu
.etaxonomy
.taxeditor
.ui
.selection
.TaxonNodeSelectionElement
;
263 * CdmFormFactory class.
267 * @created Feb 24, 2010
270 public class CdmFormFactory
extends FormToolkit
{
272 private BoldFontHolder2 boldFontHolder2
;
273 private MouseListener selectionMouseHandler
;
274 private FocusListener selectionFocusHandler
;
276 private final Set
<SelectionListener
> selectionListenerList
= new HashSet
<SelectionListener
>();
278 private final List
<IPropertyChangeListener
> propertyChangeListeners
= new ArrayList
<IPropertyChangeListener
>();
280 private final int orientation
= Window
.getDefaultOrientation();
281 private ISelectionProvider selectionProvider
;
283 /** Constant <code>EMPTY_SELECTION</code> */
284 public static ISelection EMPTY_SELECTION
= new ISelection() {
286 public boolean isEmpty() {
297 private class SelectionMouseHandler
extends MouseAdapter
{
299 public void mouseDown(MouseEvent e
) {
300 notifySelectionListeners(e
);
310 private class SelectionFocusHandler
extends FocusAdapter
{
312 public void focusGained(FocusEvent e
) {
313 notifySelectionListeners(e
);
317 private void notifySelectionListeners(TypedEvent e
) {
318 Event event
= new Event();
319 event
.widget
= e
.widget
;
320 SelectionEvent selectionEvent
= new SelectionEvent(event
);
322 for (SelectionListener listener
: selectionListenerList
) {
323 listener
.widgetSelected(selectionEvent
);
329 * Constructor for CdmFormFactory.
333 * a {@link org.eclipse.swt.widgets.Display} object.
334 * @param selectionProvider
335 * a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
337 public CdmFormFactory(Display display
, ISelectionProvider selectionProvider
) {
339 this.selectionProvider
= selectionProvider
;
345 * Constructor for CdmFormFactory.
349 * a {@link org.eclipse.swt.widgets.Display} object.
351 public CdmFormFactory(Display display
) {
359 private void init() {
360 boldFontHolder2
= new BoldFontHolder2();
361 selectionMouseHandler
= new SelectionMouseHandler();
362 selectionFocusHandler
= new SelectionFocusHandler();
366 * Creates an instance initialized with the correct selectionProvider
368 * Make sure to remove the instance when the entityComposite disposes via
369 * destroySelectionArbitrator(..)
371 * @param entityElement
372 * a {@link eu.etaxonomy.taxeditor.ui.element.IEntityElement}
374 * @return a {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator}
377 public SelectionArbitrator
createSelectionArbitrator(IEntityElement entityElement
) {
378 SelectionArbitrator selectionArbitrator
= new SelectionArbitrator(entityElement
);
379 selectionArbitrator
.addSelectionProvider(selectionProvider
);
380 selectionProvider
.addSelectionChangedListener(selectionArbitrator
);
381 addSelectionListener(selectionArbitrator
);
382 return selectionArbitrator
;
387 * destroySelectionArbitrator
390 * @param selectionArbitrator
392 * {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator}
395 public void destroySelectionArbitrator(SelectionArbitrator selectionArbitrator
) {
396 removeSelectionListener(selectionArbitrator
);
397 if (selectionProvider
!= null) {
398 selectionProvider
.removeSelectionChangedListener(selectionArbitrator
);
400 AbstractUtility
.error(this.getClass(),
401 "Tried to destroy a selection listener from this factories listeners but was null", null);
407 * Adapts the {@link AbstractCdmFormElement}:<br>
408 * - sets the {@link IPropertyChangeListener}s handled by this class
413 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement}
416 public void adapt(AbstractCdmFormElement formElement
) {
417 formElement
.setPropertyChangeListeners(propertyChangeListeners
);
422 public void adapt(Control control
, boolean trackFocus
, boolean trackKeyboard
) {
424 control
.addFocusListener(selectionFocusHandler
);
426 super.adapt(control
, trackFocus
, trackKeyboard
);
431 public void adapt(Composite composite
) {
432 composite
.addMouseListener(selectionMouseHandler
);
433 super.adapt(composite
);
442 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
445 public void destroyElement(ICdmFormElement formElement
) {
446 // return if element was not initialized
447 if (formElement
== null) {
450 // destroy selection arbitrator, if any
451 if (formElement
instanceof ISelectableElement
) {
452 destroySelectionArbitrator(((ISelectableElement
) formElement
).getSelectionArbitrator());
454 // remove this element form its parents list of elements
455 // ICdmFormElement parentElement = formElement.getParentElement();
456 // if(parentElement != null){
457 // parentElement.removeElement(formElement);
459 // call destroy on child elements recursively
460 for (ICdmFormElement childElement
: formElement
.getElements()) {
461 destroyElement(childElement
);
463 // dispose of the controls
464 for (Control control
: formElement
.getControls()) {
465 // we added the layoutComposite of the parental element as the
466 // layout composite to this formElement
467 // but we do not want to destroy it.
468 if (control
.equals(formElement
.getLayoutComposite())) {
483 * a {@link org.eclipse.swt.widgets.Composite} object.
484 * @return a {@link org.eclipse.swt.widgets.Label} object.
486 public Label
createEmptyCell(Composite parent
) {
487 return this.createLabel(parent
, null);
492 * createMultilineTextWithLabel
496 * a {@link java.lang.String} object.
501 * @param parentElement
502 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
504 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
507 public TextWithLabelElement
createMultilineTextWithLabel(ICdmFormElement parentElement
, String labelString
,
508 int textHeight
, int style
) {
509 TextWithLabelElement element
= new TextWithLabelElement(this, parentElement
, labelString
, "", textHeight
, style
);
511 parentElement
.addElement(element
);
517 * createMultiLanguageTextElement
520 * @param parentElement
521 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
524 * a {@link java.lang.String} object.
525 * @param multilanguageText
526 * a {@link java.util.Map} object.
532 * {@link eu.etaxonomy.taxeditor.ui.element.MultilanguageTextElement}
535 public MultilanguageTextElement
createMultiLanguageTextElement(ICdmFormElement parentElement
, String labelString
,
536 Map
<Language
, LanguageString
> multilanguageText
, int textHeight
, int style
) {
537 MultilanguageTextElement element
= new MultilanguageTextElement(this, parentElement
, labelString
,
538 multilanguageText
, textHeight
, style
);
540 parentElement
.addElement(element
);
544 public KeyStatementElement
createKeyStatementElement(ICdmFormElement parentElement
, String labelString
,
545 KeyStatement keyStatement
, int textHeight
, int style
) {
546 KeyStatementElement element
= new KeyStatementElement(this, parentElement
, labelString
, keyStatement
,
549 parentElement
.addElement(element
);
555 * createTextWithLabelElement
559 * a {@link java.lang.String} object.
561 * a {@link java.lang.String} object.
564 * @param parentElement
565 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
567 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
570 public TextWithLabelElement
createTextWithLabelElement(ICdmFormElement parentElement
, String labelString
,
571 String initialText
, int style
) {
572 TextWithLabelElement element
= new TextWithLabelElement(this, parentElement
, labelString
, initialText
, null,
575 parentElement
.addElement(element
);
579 public UriWithLabelElement
createUriWithLabelElement(ICdmFormElement parentElement
, String labelString
,
580 URI initialUri
, int style
) {
581 UriWithLabelElement element
= new UriWithLabelElement(this, parentElement
, labelString
, initialUri
, null, style
);
583 parentElement
.addElement(element
);
594 public OpenUrlSelectorElement
createOpenUrlSelectorElement(ICdmFormElement parentElement
, String labelString
,
595 IOpenUrlEnabled openUrlEnabled
, int style
) {
596 OpenUrlSelectorElement element
= new OpenUrlSelectorElement(this, parentElement
, labelString
, openUrlEnabled
,
599 parentElement
.addElement(element
);
605 * @param parentElement
607 * @param conversationEnabled
612 public EditPasswordElement
createEditPasswordElement(ICdmFormElement parentElement
, String labelString
,
613 ConversationHolder conversation
, User user
, int style
) {
614 EditPasswordElement element
= new EditPasswordElement(this, parentElement
, labelString
, user
, conversation
);
616 parentElement
.addElement(element
);
622 * createIntegerTextWithLabelElement
625 * @param parentElement
626 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
629 * a {@link java.lang.String} object.
630 * @param initialInteger
631 * a {@link java.lang.Integer} object.
635 * {@link eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement}
638 public NumberWithLabelElement
createIntegerTextWithLabelElement(ICdmFormElement parentElement
, String labelString
,
639 Integer initialInteger
, int style
) {
640 NumberWithLabelElement element
= new NumberWithLabelElement(this, parentElement
, labelString
, initialInteger
,
643 parentElement
.addElement(element
);
649 * createFloatTextWithLabelElement
652 * @param parentElement
653 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
656 * a {@link java.lang.String} object.
657 * @param initialFloat
662 * {@link eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement}
665 public NumberWithLabelElement
createFloatTextWithLabelElement(ICdmFormElement parentElement
, String labelString
,
666 float initialFloat
, int style
) {
667 NumberWithLabelElement element
= new NumberWithLabelElement(this, parentElement
, labelString
, initialFloat
,
670 parentElement
.addElement(element
);
676 * createLanguageStringWithLabelElement
679 * @param parentElement
680 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
683 * a {@link java.lang.String} object.
684 * @param languageString
685 * a {@link eu.etaxonomy.cdm.model.common.LanguageString} object.
689 * {@link eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement}
692 public LanguageStringWithLabelElement
createLanguageStringWithLabelElement(ICdmFormElement parentElement
,
693 String labelString
, LanguageString languageString
, int style
) {
694 LanguageStringWithLabelElement element
= new LanguageStringWithLabelElement(this, parentElement
, labelString
,
695 languageString
, style
);
697 parentElement
.addElement(element
);
703 * createLanguageStringWithLabelElement
706 * @param parentElement
707 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
710 * a {@link java.lang.String} object.
711 * @param languageString
712 * a {@link eu.etaxonomy.cdm.model.common.LanguageString} object.
718 * {@link eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement}
721 public LanguageStringWithLabelElement
createLanguageStringWithLabelElement(ICdmFormElement parentElement
,
722 String labelString
, LanguageString languageString
, int height
, int style
) {
723 LanguageStringWithLabelElement element
= new LanguageStringWithLabelElement(this, parentElement
, labelString
,
724 languageString
, height
, style
);
726 parentElement
.addElement(element
);
735 * @param parentElement
736 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
739 * a {@link java.lang.String} object.
742 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
745 public TextWithLabelElement
createTextElement(ICdmFormElement parentElement
, String initialText
, int style
) {
746 TextWithLabelElement element
= new TextWithLabelElement(this, parentElement
, null, initialText
, null, style
);
748 parentElement
.addElement(element
);
754 * createKeyValueViewerElement
757 * @param parentElement
758 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
761 * a {@link java.lang.String} object.
762 * @param valueHeading
763 * a {@link java.lang.String} object.
765 * a {@link java.util.Map} object.
766 * @return a {@link eu.etaxonomy.taxeditor.ui.element.KeyValueViewerElement}
769 public KeyValueViewerElement
createKeyValueViewerElement(ICdmFormElement parentElement
, String keyHeading
,
770 String valueHeading
, Map
<Object
, Object
> map
) {
771 KeyValueViewerElement element
= new KeyValueViewerElement(this, parentElement
, keyHeading
, valueHeading
, map
);
773 parentElement
.addElement(element
);
779 * createTermComboElement
782 * @param termComboType
784 * {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.TermComboType}
786 * @param parentElement
787 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
790 * a {@link java.lang.String} object.
792 * a {@link eu.etaxonomy.cdm.model.common.DefinedTermBase}
796 * @return a {@link eu.etaxonomy.taxeditor.ui.combo.TermComboElement}
800 public <T
extends DefinedTermBase
> TermComboElement
<T
> createTermComboElement(Class
<T
> termComboType
,
801 ICdmFormElement parentElement
, String labelString
, T selection
, int style
) {
802 TermComboElement
<T
> element
= new TermComboElement
<T
>(this, parentElement
, termComboType
, labelString
,
805 parentElement
.addElement(element
);
811 * createEnumComboElement
814 * @param enumComboType
816 * {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EnumComboType}
818 * @param parentElement
819 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
823 * @return a {@link eu.etaxonomy.taxeditor.ui.term.AbstractEnumComboElement}
826 public <T
extends IDefinedTerm
> EnumComboElement
<T
> createEnumComboElement(Class
<T
> enumComboType
,
827 ICdmFormElement parentElement
, int style
) {
828 EnumComboElement
<T
> element
= new EnumComboElement
<T
>(this, parentElement
, enumComboType
, style
);
830 parentElement
.addElement(element
);
836 * createBrowserElement
840 * a {@link java.net.URI} object.
843 * @param parentElement
844 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
846 * @return a {@link eu.etaxonomy.taxeditor.ui.element.BrowserElement}
849 public BrowserElement
createBrowserElement(ICdmFormElement parentElement
, URI imageUri
, int style
) {
850 BrowserElement element
= new BrowserElement(this, parentElement
, imageUri
, style
);
852 parentElement
.addElement(element
);
861 * @param parentElement
862 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
865 * a {@link java.net.URI} object.
868 * @return a {@link eu.etaxonomy.taxeditor.ui.element.ImageElement} object.
870 public ImageElement
createImageElement(ICdmFormElement parentElement
, URI imageUri
, int style
) {
871 ImageElement element
= new ImageElement(this, parentElement
, imageUri
, style
);
873 parentElement
.addElement(element
);
879 * createTextActionElement
883 * a {@link java.lang.String} object.
885 * a {@link java.lang.String} object.
888 * @param parentElement
889 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
892 * a {@link java.lang.String} object.
893 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextActionElement}
896 public TextActionElement
createTextActionElement(ICdmFormElement parentElement
, String labelString
,
897 String buttonLabel
, String initialText
, int style
) {
898 TextActionElement element
= new TextActionElement(this, parentElement
, labelString
, buttonLabel
, initialText
,
901 parentElement
.addElement(element
);
910 * @param parentElement
911 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
914 * a {@link java.lang.String} object.
915 * @param initialState
919 * @return a {@link eu.etaxonomy.taxeditor.ui.element.CheckboxElement}
922 public CheckboxElement
createCheckbox(ICdmFormElement parentElement
, String label
, boolean initialState
, int style
) {
923 CheckboxElement element
= new CheckboxElement(this, parentElement
, label
, initialState
, style
| orientation
);
925 parentElement
.addElement(element
);
930 * Creates a section as a part of the form.
932 * @return the section widget
935 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
938 public Section
adapt(AbstractFormSection section
) {
939 section
.setMenu(section
.getLayoutComposite().getMenu());
940 adapt(section
, true, true);
942 // handle focus and property change events for cdm use
943 section
.addFocusListener(selectionFocusHandler
);
944 section
.setPropertyChangeListeners(propertyChangeListeners
);
946 if (section
.getToggle() != null) {
947 section
.getToggle().setHoverDecorationColor(getColors().getColor(IFormColors
.TB_TOGGLE_HOVER
));
948 section
.getToggle().setDecorationColor(getColors().getColor(IFormColors
.TB_TOGGLE
));
951 section
.setFont(boldFontHolder2
.getBoldFont(section
.getLayoutComposite().getFont()));
953 if ((section
.getStyle() & ExpandableComposite
.TITLE_BAR
) != 0
954 || (section
.getStyle() & ExpandableComposite
.SHORT_TITLE_BAR
) != 0) {
955 getColors().initializeSectionToolBarColors();
956 section
.setTitleBarBackground(getColors().getColor(IFormColors
.TB_BG
));
957 section
.setTitleBarBorderColor(getColors().getColor(IFormColors
.TB_BORDER
));
959 // call setTitleBarForeground regardless as it also sets the label color
960 section
.setTitleBarForeground(getColors().getColor(IFormColors
.TB_TOGGLE
));
964 private class BoldFontHolder2
{
965 private Font normalFont
;
967 private Font boldFont
;
969 public BoldFontHolder2() {
972 public Font
getBoldFont(Font font
) {
973 createBoldFont(font
);
977 private void createBoldFont(Font font
) {
978 if (normalFont
== null || !normalFont
.equals(font
)) {
982 if (boldFont
== null) {
983 boldFont
= FormFonts
.getInstance().getBoldFont(getColors().getDisplay(), normalFont
);
987 public void dispose() {
988 if (boldFont
!= null) {
989 FormFonts
.getInstance().markFinished(boldFont
, getColors().getDisplay());
997 * createToggleableTextField
1000 * @param parentElement
1001 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1003 * @param labelString
1004 * a {@link java.lang.String} object.
1005 * @param initialText
1006 * a {@link java.lang.String} object.
1007 * @param initialState
1011 * @return a {@link eu.etaxonomy.taxeditor.ui.element.ToggleableTextElement}
1014 public ToggleableTextElement
createToggleableTextField(ICdmFormElement parentElement
, String labelString
,
1015 String initialText
, boolean initialState
, int style
) {
1016 ToggleableTextElement element
= new ToggleableTextElement(this, parentElement
, labelString
, initialText
,
1017 initialState
, style
| orientation
);
1019 parentElement
.addElement(element
);
1025 * createTimePeriodElement
1028 * @param parentElement
1029 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1031 * @param labelString
1032 * a {@link java.lang.String} object.
1034 * a {@link eu.etaxonomy.cdm.model.common.TimePeriod} object.
1037 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TimePeriodElement}
1040 public TimePeriodElement
createTimePeriodElement(ICdmFormElement parentElement
, String labelString
,
1041 TimePeriod timePeriod
, int style
) {
1042 TimePeriodElement element
= new TimePeriodElement(this, parentElement
, labelString
, timePeriod
, style
);
1044 parentElement
.addElement(element
);
1050 * createPointElement
1055 * @param parentElement
1056 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1059 * a {@link eu.etaxonomy.cdm.model.location.Point} object.
1060 * @return a {@link eu.etaxonomy.taxeditor.ui.element.PointElement} object.
1062 public PointElement
createPointElement(ICdmFormElement parentElement
, Point point
, int style
) {
1063 PointElement element
= new PointElement(this, parentElement
, point
, style
);
1065 parentElement
.addElement(element
);
1071 * createDateDetailSection
1074 * @param parentElement
1075 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1079 * @return a {@link eu.etaxonomy.taxeditor.ui.element.DateDetailSection}
1082 public DateDetailSection
createDateDetailSection(ICdmFormElement parentElement
, int style
) {
1083 DateDetailSection section
= new DateDetailSection(this, parentElement
, style
);
1084 parentElement
.addElement(section
);
1091 * createPartialElement
1094 * @param parentElement
1095 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1097 * @param labelString
1098 * a {@link java.lang.String} object.
1100 * a {@link org.joda.time.Partial} object.
1103 * @return a {@link eu.etaxonomy.taxeditor.ui.element.PartialElement}
1106 public PartialElement
createPartialElement(ICdmFormElement parentElement
, String labelString
, Partial partial
,
1108 PartialElement element
= new PartialElement(this, parentElement
, labelString
, style
);
1110 parentElement
.addElement(element
);
1116 * addSelectionListener
1120 * a {@link org.eclipse.swt.events.SelectionListener} object.
1122 public void addSelectionListener(SelectionListener listener
) {
1123 selectionListenerList
.add(listener
);
1128 * removeSelectionListener
1132 * a {@link org.eclipse.swt.events.SelectionListener} object.
1134 public void removeSelectionListener(SelectionListener listener
) {
1135 if (listener
== null) {
1136 AbstractUtility
.error(this.getClass(),
1137 "Tried to remove a selection listener from this factories listeners but was null", null);
1139 selectionListenerList
.remove(listener
);
1145 * addPropertyChangeListener
1149 * a {@link org.eclipse.jface.util.IPropertyChangeListener}
1152 public void addPropertyChangeListener(IPropertyChangeListener listener
) {
1153 if (propertyChangeListeners
.contains(listener
)) {
1156 propertyChangeListeners
.add(0, listener
);
1161 * removePropertyChangeListener
1165 * a {@link org.eclipse.jface.util.IPropertyChangeListener}
1168 public void removePropertyChangeListener(IPropertyChangeListener listener
) {
1169 propertyChangeListeners
.remove(listener
);
1173 * @return the propertyChangeListeners
1175 public List
<IPropertyChangeListener
> getPropertyChangeListeners() {
1176 return propertyChangeListeners
;
1181 * createHorizontalSeparator
1184 * @param parentElement
1185 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1189 * @return a {@link org.eclipse.swt.widgets.Label} object.
1191 public Label
createHorizontalSeparator(ICdmFormElement parentElement
, int style
) {
1192 Label separator
= this.createSeparator(parentElement
.getLayoutComposite(), SWT
.HORIZONTAL
| style
);
1193 separator
.setLayoutData(LayoutConstants
.FILL_HORIZONTALLY());
1199 * createVersionElement
1202 * @param parentElement
1203 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1206 * a {@link eu.etaxonomy.cdm.model.common.VersionableEntity}
1211 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.VersionElement}
1214 public VersionElement
createVersionElement(ICdmFormElement parentElement
, VersionableEntity entity
, int style
) {
1215 VersionElement element
= new VersionElement(this, parentElement
, entity
, style
);
1217 parentElement
.addElement(element
);
1222 * @param cdmBaseSection
1227 public CdmBaseElement
createCdmBaseElement(ICdmFormElement parentElement
, CdmBase entity
, int style
) {
1228 CdmBaseElement element
= new CdmBaseElement(this, parentElement
, entity
, style
);
1230 parentElement
.addElement(element
);
1236 * createVersionSection
1239 * @param parentElement
1240 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1245 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.VersionSection}
1248 public VersionSection
createVersionSection(ICdmFormElement parentElement
, int style
) {
1249 VersionSection section
= new VersionSection(this, parentElement
, style
);
1250 parentElement
.addElement(section
);
1260 public CdmBaseSection
createCdmBaseSection(ICdmFormElement parentElement
, int style
) {
1261 CdmBaseSection section
= new CdmBaseSection(this, parentElement
, style
);
1262 parentElement
.addElement(section
);
1269 * createEmptyElement
1272 * @param parentElement
1273 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1275 * @return a {@link eu.etaxonomy.taxeditor.ui.section.EmptyElement} object.
1277 public EmptyElement
createEmptyElement(ICdmFormElement parentElement
) {
1278 EmptyElement element
= new EmptyElement(this, parentElement
, null, SWT
.NULL
);
1280 parentElement
.addElement(element
);
1286 * createHeadlineSection
1289 * @param parentElement
1290 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1293 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.HeadlineSection}
1296 public HeadlineSection
createHeadlineSection(ICdmFormElement parentElement
) {
1297 HeadlineSection section
= new HeadlineSection(this, parentElement
, SWT
.NULL
);
1298 parentElement
.addElement(section
);
1305 * createParsingMessageElement
1308 * @param parentElement
1309 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1311 * @param parserProblem
1312 * a {@link eu.etaxonomy.cdm.strategy.parser.ParserProblem}
1317 * {@link eu.etaxonomy.taxeditor.ui.section.taxon.ParsingMessageElement}
1320 public ParsingMessageElement
createParsingMessageElement(ICdmFormElement parentElement
,
1321 ParserProblem parserProblem
, int style
) {
1322 ParsingMessageElement element
= new ParsingMessageElement(this, parentElement
, parserProblem
, style
);
1324 parentElement
.addElement(element
);
1328 public AbstractFormSection
createDefinedTermDetailSection(Class definedTermClass
, ConversationHolder conversation
,
1329 ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
1331 AbstractFormSection section
= new DefinedTermDetailSection(this, definedTermClass
, conversation
, parentElement
,
1332 selectionProvider
, style
);
1334 parentElement
.addElement(section
);
1341 * @param definedTermClass
1342 * @param formElement
1346 public AbstractCdmDetailElement
createDefinedTermDetailElement(Class definedTermClass
, AbstractCdmDetailSection parentElement
, int style
) {
1347 AbstractCdmDetailElement element
= null;
1349 if (NamedArea
.class.isAssignableFrom(definedTermClass
)) {
1350 element
= new eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement(this, parentElement
);
1352 element
= new DefinedTermDetailElement(this, parentElement
);
1356 parentElement
.addElement(element
);
1361 //--------DetailSections---------
1362 public NameDetailSection
createNameDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1363 NameDetailSection section
= new NameDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1364 addAndAdaptSection(parentElement
, section
);
1368 public ReferenceDetailSection
createReferenceDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1369 ReferenceDetailSection section
= new ReferenceDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1370 addAndAdaptSection(parentElement
, section
);
1374 public NomenclaturalReferenceDetailSection
createNomenclaturalReferenceDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1375 NomenclaturalReferenceDetailSection section
= new NomenclaturalReferenceDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1376 addAndAdaptSection(parentElement
, section
);
1380 public TaxonBaseDetailSection
createTaxonBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1381 TaxonBaseDetailSection section
= new TaxonBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1382 addAndAdaptSection(parentElement
, section
);
1386 public AuthorshipDetailSection
createAuthorshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1387 AuthorshipDetailSection section
= new AuthorshipDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1388 addAndAdaptSection(parentElement
, section
);
1392 public TeamOrPersonBaseDetailSection
createTeamOrPersonBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1393 TeamOrPersonBaseDetailSection section
= new TeamOrPersonBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1394 addAndAdaptSection(parentElement
, section
);
1398 public TeamDetailSection
createTeamDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1399 TeamDetailSection section
= new TeamDetailSection(this, conversation
, parentElement
, null, style
);
1400 addAndAdaptSection(parentElement
, section
);
1404 public PersonDetailSection
createPersonDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1405 PersonDetailSection section
= new PersonDetailSection(this, conversation
, parentElement
, null, style
);
1406 addAndAdaptSection(parentElement
, section
);
1410 public DescriptionDetailSection
createDescriptionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1411 DescriptionDetailSection section
= new DescriptionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1412 addAndAdaptSection(parentElement
, section
);
1416 public DescriptionElementDetailSection
createDescriptionElementDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1417 DescriptionElementDetailSection section
= new DescriptionElementDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1418 addAndAdaptSection(parentElement
, section
);
1422 public ParsingMessagesSection
createParsingMessagesSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1423 ParsingMessagesSection section
= new ParsingMessagesSection(this, conversation
, parentElement
, selectionProvider
, style
);
1424 addAndAdaptSection(parentElement
, section
);
1428 public NonViralNameDetailSection
createNonViralNameDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1429 NonViralNameDetailSection section
= new NonViralNameDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1430 addAndAdaptSection(parentElement
, section
);
1434 public MediaDetailsSection
createMediaDetailsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1435 MediaDetailsSection section
= new MediaDetailsSection(this, conversation
, parentElement
, selectionProvider
, style
);
1436 addAndAdaptSection(parentElement
, section
);
1440 public DerivedUnitFacadeDetailSection
createDerivedUnitFacadeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1441 DerivedUnitFacadeDetailSection section
= new DerivedUnitFacadeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1442 addAndAdaptSection(parentElement
, section
);
1446 public FieldObservationDetailSection
createFieldObservationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1447 FieldObservationDetailSection section
= new FieldObservationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1448 addAndAdaptSection(parentElement
, section
);
1452 public GatheringEventDetailSection
createGatheringEventDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1453 GatheringEventDetailSection section
= new GatheringEventDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1454 addAndAdaptSection(parentElement
, section
);
1458 public DerivedUnitBaseDetailSection
createDerivedUnitBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1459 DerivedUnitBaseDetailSection section
= new DerivedUnitBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1460 addAndAdaptSection(parentElement
, section
);
1464 public NaturalLanguageSection
createNaturalLanguageSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1465 NaturalLanguageSection section
= new NaturalLanguageSection(this, conversation
, parentElement
, selectionProvider
, style
);
1466 addAndAdaptSection(parentElement
, section
);
1470 public FeatureDistributionDetailSection
createFeatureDistributionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1471 FeatureDistributionDetailSection section
= new FeatureDistributionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1472 addAndAdaptSection(parentElement
, section
);
1476 public ClassificationDetailSection
createClassificationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1477 ClassificationDetailSection section
= new ClassificationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1478 addAndAdaptSection(parentElement
, section
);
1482 public TaxonNodeDetailSection
createTaxonNodeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1483 TaxonNodeDetailSection section
= new TaxonNodeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1484 addAndAdaptSection(parentElement
, section
);
1488 public PolytomousKeyDetailSection
createPolytomousKeyDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1489 PolytomousKeyDetailSection section
= new PolytomousKeyDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1490 addAndAdaptSection(parentElement
, section
);
1494 public PolytomousKeyNodeDetailSection
createPolytomousKeyNodeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1495 PolytomousKeyNodeDetailSection section
= new PolytomousKeyNodeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1496 addAndAdaptSection(parentElement
, section
);
1500 public InstitutionDetailSection
createInstitutionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1501 InstitutionDetailSection section
= new InstitutionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1502 addAndAdaptSection(parentElement
, section
);
1506 public GeneralDetailSection
createGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1507 GeneralDetailSection section
= new GeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1508 addAndAdaptSection(parentElement
, section
);
1512 public HybridDetailSection
createHybridDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1513 HybridDetailSection section
= new HybridDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1514 addAndAdaptSection(parentElement
, section
);
1518 public UserDetailSection
createUserDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1519 UserDetailSection section
= new UserDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1520 addAndAdaptSection(parentElement
, section
);
1524 public GroupDetailSection
createGroupDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1525 GroupDetailSection section
= new GroupDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1526 addAndAdaptSection(parentElement
, section
);
1530 public DeterminationDetailSection
createDeterminationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1531 DeterminationDetailSection section
= new DeterminationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1532 addAndAdaptSection(parentElement
, section
);
1536 public TaxonRelationshipDetailSection
createTaxonRelationshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1537 TaxonRelationshipDetailSection section
= new TaxonRelationshipDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1538 addAndAdaptSection(parentElement
, section
);
1542 public ReferencedEntityDetailSection
createReferencedEntityDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1543 ReferencedEntityDetailSection section
= new ReferencedEntityDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1544 addAndAdaptSection(parentElement
, section
);
1548 public TermVocabularyDetailSection
createTermVocabularyDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1549 TermVocabularyDetailSection section
= new TermVocabularyDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1550 addAndAdaptSection(parentElement
, section
);
1555 public NamedAreaDetailSection
createNamedAreaDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1556 NamedAreaDetailSection section
= new NamedAreaDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1557 addAndAdaptSection(parentElement
, section
);
1561 public UseRecordDetailSection
createUseRecordDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1562 UseRecordDetailSection section
= new UseRecordDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1563 addAndAdaptSection(parentElement
, section
);
1567 private void addAndAdaptSection(ICdmFormElement parentElement
, AbstractFormSection
<?
> section
) {
1568 parentElement
.addElement(section
);
1572 //--------DetailElements------------
1574 public UseRecordDetailElement
createUseRecordDetailElement(ICdmFormElement parentElement
){
1575 UseRecordDetailElement element
= new UseRecordDetailElement(this, parentElement
);
1576 addAndAdaptElement(parentElement
, element
);
1580 public DefinedTermDetailElement
<NamedAreaLevel
> createNamedAreaLevelElement(ICdmFormElement parentElement
){
1581 DefinedTermDetailElement
<NamedAreaLevel
> element
= new DefinedTermDetailElement
<NamedAreaLevel
>(this, parentElement
);
1582 addAndAdaptElement(parentElement
, element
);
1586 public eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement
createNamedAreaDetailElement(ICdmFormElement parentElement
){
1587 eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement element
= new eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement(this, parentElement
);
1588 addAndAdaptElement(parentElement
, element
);
1592 public TermVocabularyDetailElement
createTermVocabularyDetailElement(ICdmFormElement parentElement
){
1593 TermVocabularyDetailElement element
= new TermVocabularyDetailElement(this, parentElement
);
1594 addAndAdaptElement(parentElement
, element
);
1598 public ReferenceEntityDetailElement
createReferenceEntityDetailElement(ICdmFormElement parentElement
){
1599 ReferenceEntityDetailElement element
= new ReferenceEntityDetailElement(this, parentElement
);
1600 addAndAdaptElement(parentElement
, element
);
1604 public TaxonRelationshipDetailElement
createTaxonRelationshipDetailElement(ICdmFormElement parentElement
){
1605 TaxonRelationshipDetailElement element
= new TaxonRelationshipDetailElement(this, parentElement
);
1606 addAndAdaptElement(parentElement
, element
);
1610 public GrantedAuthorityDetailElement
createGrantedAuthorityDetailElement(ICdmFormElement parentElement
){
1611 GrantedAuthorityDetailElement element
= new GrantedAuthorityDetailElement(this, parentElement
);
1612 addAndAdaptElement(parentElement
, element
);
1616 public GroupDetailElement
createGroupDetailElement(ICdmFormElement parentElement
){
1617 GroupDetailElement element
= new GroupDetailElement(this, parentElement
);
1618 addAndAdaptElement(parentElement
, element
);
1622 public UserDetailElement
createUserDetailElement(ICdmFormElement parentElement
){
1623 UserDetailElement element
= new UserDetailElement(this, parentElement
);
1624 addAndAdaptElement(parentElement
, element
);
1628 public HybridDetailElement
createHybridDetailElement(ICdmFormElement parentElement
){
1629 HybridDetailElement element
= new HybridDetailElement(this, parentElement
);
1630 addAndAdaptElement(parentElement
, element
);
1634 public InstitutionDetailElement
createInstitutionDetailElement(ICdmFormElement parentElement
){
1635 InstitutionDetailElement element
= new InstitutionDetailElement(this, parentElement
);
1636 addAndAdaptElement(parentElement
, element
);
1640 public PolytomousKeyNodeDetailElement
createPolytomousKeyNodeDetailElement(ICdmFormElement parentElement
){
1641 PolytomousKeyNodeDetailElement element
= new PolytomousKeyNodeDetailElement(this, parentElement
);
1642 addAndAdaptElement(parentElement
, element
);
1646 public PolytomousKeyDetailElement
createPolytomousKeyDetailElement(ICdmFormElement parentElement
){
1647 PolytomousKeyDetailElement element
= new PolytomousKeyDetailElement(this, parentElement
);
1648 addAndAdaptElement(parentElement
, element
);
1652 public CollectionDetailElement
createCollectionDetailElement(ICdmFormElement parentElement
){
1653 CollectionDetailElement element
= new CollectionDetailElement(this, parentElement
);
1654 addAndAdaptElement(parentElement
, element
);
1658 public TaxonNodeDetailElement
createTaxonNodeDetailElement(ICdmFormElement parentElement
){
1659 TaxonNodeDetailElement element
= new TaxonNodeDetailElement(this, parentElement
);
1660 addAndAdaptElement(parentElement
, element
);
1664 public ClassificationDetailElement
createClassificationDetailElement(ICdmFormElement parentElement
){
1665 ClassificationDetailElement element
= new ClassificationDetailElement(this, parentElement
);
1666 addAndAdaptElement(parentElement
, element
);
1670 public FeatureDistributionDetailElement
createFeatureDistributionDetailElement(ICdmFormElement parentElement
){
1671 FeatureDistributionDetailElement element
= new FeatureDistributionDetailElement(this, parentElement
);
1672 addAndAdaptElement(parentElement
, element
);
1676 public NaturalLanguageDetailElement
createNaturalLanguageDetailElement(ICdmFormElement parentElement
){
1677 NaturalLanguageDetailElement element
= new NaturalLanguageDetailElement(this, parentElement
);
1678 addAndAdaptElement(parentElement
, element
);
1682 public DerivedUnitFacadeDetailElement
createDerivedUnitFacadeDetailElement(ICdmFormElement parentElement
){
1683 DerivedUnitFacadeDetailElement element
= new DerivedUnitFacadeDetailElement(this, parentElement
);
1684 addAndAdaptElement(parentElement
, element
);
1688 public NonViralNameDetailElement
createNonViralNameDetailElement(ICdmFormElement parentElement
){
1689 NonViralNameDetailElement element
= new NonViralNameDetailElement(this, parentElement
);
1690 addAndAdaptElement(parentElement
, element
);
1694 public DescriptionElementDetailElement
createDescriptionElementDetailElement(ICdmFormElement parentElement
, int style
){
1695 DescriptionElementDetailElement element
= new DescriptionElementDetailElement(this, parentElement
, style
);
1696 addAndAdaptElement(parentElement
, element
);
1700 public DescriptionDetailElement
createDescriptionDetailElement(ICdmFormElement parentElement
, int style
){
1701 DescriptionDetailElement element
= new DescriptionDetailElement(this, parentElement
, style
);
1702 addAndAdaptElement(parentElement
, element
);
1706 public PersonDetailElement
createPersonDetailElement(ICdmFormElement parentElement
, int style
){
1707 PersonDetailElement element
= new PersonDetailElement(this, parentElement
, style
);
1708 addAndAdaptElement(parentElement
, element
);
1712 public TeamDetailElement
createTeamDetailElement(ICdmFormElement parentElement
, int style
){
1713 TeamDetailElement element
= new TeamDetailElement(this, parentElement
, style
);
1714 addAndAdaptElement(parentElement
, element
);
1718 public AuthorshipDetailElement
createAuthorshipDetailElement(ICdmFormElement parentElement
, int style
){
1719 AuthorshipDetailElement element
= new AuthorshipDetailElement(this, parentElement
, style
);
1720 addAndAdaptElement(parentElement
, element
);
1724 public TaxonBaseDetailElement
createTaxonBaseDetailElement(ICdmFormElement parentElement
, int style
){
1725 TaxonBaseDetailElement element
= new TaxonBaseDetailElement(this, parentElement
, style
);
1726 addAndAdaptElement(parentElement
, element
);
1730 public NameDetailElement
createNameDetailElement(ICdmFormElement parentElement
, int style
){
1731 NameDetailElement element
= new NameDetailElement(this, parentElement
, style
);
1732 addAndAdaptElement(parentElement
, element
);
1736 public ReferenceDetailElement
createReferenceDetailElement(ICdmFormElement parentElement
, int style
){
1737 ReferenceDetailElement element
= new ReferenceDetailElement(this, parentElement
, style
);
1738 addAndAdaptElement(parentElement
, element
);
1742 public NomenclaturalReferenceDetailElement
createNomenclaturalReferenceDetailElement(ICdmFormElement parentElement
, int style
){
1743 NomenclaturalReferenceDetailElement element
= new NomenclaturalReferenceDetailElement(this, parentElement
, style
);
1744 addAndAdaptElement(parentElement
, element
);
1749 public GeneralDetailElement
createGeneralDetailElement(ICdmFormElement parentElement
){
1750 GeneralDetailElement element
= new GeneralDetailElement(this, parentElement
);
1751 addAndAdaptElement(parentElement
, element
);
1755 public FieldObservationGeneralElementController
createFieldObservationGeneralElement(ICdmFormElement parentElement
){
1756 FieldObservationGeneralElement fieldObservationGeneralElement
= new FieldObservationGeneralElement(parentElement
.getLayoutComposite(), SWT
.NONE
);
1757 fieldObservationGeneralElement
.setLayoutData(LayoutConstants
.FILL_HORIZONTALLY(2,1));
1758 FieldObservationGeneralElementController element
= new FieldObservationGeneralElementController(fieldObservationGeneralElement
, this, parentElement
);
1759 addAndAdaptElement(parentElement
, element
);
1763 public GatheringEventDetailElement
createGatheringEventDetailElement(ICdmFormElement parentElement
) {
1764 GatheringEventDetailElement element
= new GatheringEventDetailElement(this, parentElement
);
1765 addAndAdaptElement(parentElement
, element
);
1769 public GatheringEventDetailsElementController
createGatheringEventDetailsElementController(ICdmFormElement parentElement
) {
1770 GatheringEventDetailsElement gatheringEventDetailsElement
= new GatheringEventDetailsElement(parentElement
.getLayoutComposite(), SWT
.NONE
);
1771 gatheringEventDetailsElement
.setLayoutData(LayoutConstants
.FILL_HORIZONTALLY(2,1));
1772 GatheringEventDetailsElementController element
= new GatheringEventDetailsElementController(gatheringEventDetailsElement
, this, parentElement
);
1774 parentElement
.addElement(element
);
1778 public FieldObservationDetailElement
createFieldObservationDetailElement(ICdmFormElement parentElement
) {
1779 FieldObservationDetailElement element
= new FieldObservationDetailElement(this, parentElement
);
1780 addAndAdaptElement(parentElement
, element
);
1784 public DerivedUnitBaseDetailElement
createDerivedUnitBaseDetailElement(ICdmFormElement parentElement
) {
1785 DerivedUnitBaseDetailElement element
= new DerivedUnitBaseDetailElement(this, parentElement
);
1786 addAndAdaptElement(parentElement
, element
);
1790 public DeterminationDetailElement
createDeterminationDetailElement(ICdmFormElement parentElement
) {
1791 DeterminationDetailElement element
= new DeterminationDetailElement(this, parentElement
);
1792 addAndAdaptElement(parentElement
, element
);
1797 * @param parentElement
1800 private void addAndAdaptElement(ICdmFormElement parentElement
, AbstractCdmDetailElement
<?
> element
) {
1802 parentElement
.addElement(element
);
1805 //--------EntityCollectionSection----------
1806 public TeamMemberSection
createTeamMemberSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1807 TeamMemberSection section
= new TeamMemberSection(this, conversation
, parentElement
, style
);
1808 addAndAdaptSection(parentElement
, section
);
1812 public AnnotationSection
createAnnotationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1813 AnnotationSection section
= new AnnotationSection(this, conversation
, parentElement
, style
);
1814 addAndAdaptSection(parentElement
, section
);
1818 public CreditSection
createCreditSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1819 CreditSection section
= new CreditSection(this, conversation
, parentElement
, style
);
1820 addAndAdaptSection(parentElement
, section
);
1824 public DescriptionElementSourceSection
createDescriptionElementSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1825 DescriptionElementSourceSection section
= new DescriptionElementSourceSection(this, conversation
, parentElement
, style
);
1826 addAndAdaptSection(parentElement
, section
);
1830 public ExtensionSection
createExtensionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1831 ExtensionSection section
= new ExtensionSection(this, conversation
, parentElement
, style
);
1832 addAndAdaptSection(parentElement
, section
);
1836 public MarkerSection
createMarkerSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1837 MarkerSection section
= new MarkerSection(this, conversation
, parentElement
, style
);
1838 addAndAdaptSection(parentElement
, section
);
1842 public MediaSection
createMediaSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1843 MediaSection section
= new MediaSection(this, conversation
, parentElement
, style
);
1844 addAndAdaptSection(parentElement
, section
);
1848 public DescriptionElementMediaSection
createDescriptionElementMediaSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1849 DescriptionElementMediaSection section
= new DescriptionElementMediaSection(this, conversation
, parentElement
, style
);
1850 addAndAdaptSection(parentElement
, section
);
1854 public MediaRepresentationSection
createMediaRepresentationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1855 MediaRepresentationSection section
= new MediaRepresentationSection(this, conversation
, parentElement
, style
);
1856 addAndAdaptSection(parentElement
, section
);
1860 public MediaRepresentationPartSection
createMediaRepresentationPartSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1861 MediaRepresentationPartSection section
= new MediaRepresentationPartSection(this, conversation
, parentElement
, style
);
1862 addAndAdaptSection(parentElement
, section
);
1866 public ModifierSection
createModifierSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1867 ModifierSection section
= new ModifierSection(this, conversation
, parentElement
, style
);
1868 addAndAdaptSection(parentElement
, section
);
1872 public NomenclaturalStatusSection
createNomenclaturalStatusSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1873 NomenclaturalStatusSection section
= new NomenclaturalStatusSection(this, conversation
, parentElement
, style
);
1874 addAndAdaptSection(parentElement
, section
);
1878 public NameRelationshipDetailSection
createNameRelationshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1879 NameRelationshipDetailSection section
= new NameRelationshipDetailSection(this, conversation
, parentElement
, style
);
1880 addAndAdaptSection(parentElement
, section
);
1884 public ProtologueSection
createProtologueSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1885 ProtologueSection section
= new ProtologueSection(this, conversation
, parentElement
, style
);
1886 addAndAdaptSection(parentElement
, section
);
1890 public RightsSection
createRightsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1891 RightsSection section
= new RightsSection(this, conversation
, parentElement
, style
);
1892 addAndAdaptSection(parentElement
, section
);
1896 public SourceSection
createSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1897 SourceSection section
= new SourceSection(this, conversation
, parentElement
, style
);
1898 addAndAdaptSection(parentElement
, section
);
1902 public ScopeSection
createScopeSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1903 ScopeSection section
= new ScopeSection(this, conversation
, parentElement
, style
);
1904 addAndAdaptSection(parentElement
, section
);
1908 public DescriptionSourceSection
createDescriptionSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1909 DescriptionSourceSection section
= new DescriptionSourceSection(this, conversation
, parentElement
, style
);
1910 addAndAdaptSection(parentElement
, section
);
1914 public TypeDesignationSection
createTypeDesignationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1915 TypeDesignationSection section
= new TypeDesignationSection(this, conversation
, parentElement
, style
);
1916 addAndAdaptSection(parentElement
, section
);
1920 public StateDataSection
createStateDataSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1921 StateDataSection section
= new StateDataSection(this, conversation
, parentElement
, style
);
1922 addAndAdaptSection(parentElement
, section
);
1926 public StatisticalMeasurementValueSection
createStatisticalMeasurementValueSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1927 StatisticalMeasurementValueSection section
= new StatisticalMeasurementValueSection(this, conversation
, parentElement
, style
);
1928 addAndAdaptSection(parentElement
, section
);
1932 public DescribedSpecimenSection
createDescribedSpecimenSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1933 DescribedSpecimenSection section
= new DescribedSpecimenSection(this, conversation
, parentElement
, style
);
1934 addAndAdaptSection(parentElement
, section
);
1938 public CollectingAreasDetailSection
createCollectingAreasDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1939 CollectingAreasDetailSection section
= new CollectingAreasDetailSection(this, conversation
, parentElement
, style
);
1940 addAndAdaptSection(parentElement
, section
);
1944 public CurrentDeterminationDetailSection
createCurrentDeterminationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1945 CurrentDeterminationDetailSection section
= new CurrentDeterminationDetailSection(this, conversation
, parentElement
, style
);
1946 addAndAdaptSection(parentElement
, section
);
1950 public DeterminationHistoryDetailSection
createDeterminationHistoryDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1951 DeterminationHistoryDetailSection section
= new DeterminationHistoryDetailSection(this, conversation
, parentElement
, style
);
1952 addAndAdaptSection(parentElement
, section
);
1956 public SpecimenCollectionDetailSection
createSpecimenCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1957 SpecimenCollectionDetailSection section
= new SpecimenCollectionDetailSection(this, conversation
, parentElement
, style
);
1958 addAndAdaptSection(parentElement
, section
);
1962 public SourceCollectionDetailSection
createSourceCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1963 SourceCollectionDetailSection section
= new SourceCollectionDetailSection(this, conversation
, parentElement
, style
);
1964 addAndAdaptSection(parentElement
, section
);
1968 public GeographicalScopeDetailSection
createGeographicalScopeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1969 GeographicalScopeDetailSection section
= new GeographicalScopeDetailSection(this, conversation
, parentElement
, style
);
1970 addAndAdaptSection(parentElement
, section
);
1974 public ScopeRestrictionSection
createScopeRestrictionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1975 ScopeRestrictionSection section
= new ScopeRestrictionSection(this, conversation
, parentElement
, style
);
1976 addAndAdaptSection(parentElement
, section
);
1980 public MemberDetailSection
createMemberDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1981 MemberDetailSection section
= new MemberDetailSection(this, conversation
, parentElement
, style
);
1982 addAndAdaptSection(parentElement
, section
);
1986 public GrantedAuthorityDetailSection
createGrantedAuthorityDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1987 GrantedAuthorityDetailSection section
= new GrantedAuthorityDetailSection(this, conversation
, parentElement
, style
);
1988 addAndAdaptSection(parentElement
, section
);
1992 public GroupsByUserDetailSection
createGroupsByUserDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1993 GroupsByUserDetailSection section
= new GroupsByUserDetailSection(this, conversation
, parentElement
, style
);
1994 addAndAdaptSection(parentElement
, section
);
1998 public TaxonomicScopeSection
createTaxonomicScopeSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1999 TaxonomicScopeSection section
= new TaxonomicScopeSection(this, conversation
, parentElement
, style
);
2000 addAndAdaptSection(parentElement
, section
);
2006 * createEntityCollectionElement
2009 * @param removeListener
2010 * a {@link org.eclipse.swt.events.SelectionListener} object.
2013 * @param parentElement
2015 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
2017 * @param versionableEntity
2018 * a {@link eu.etaxonomy.cdm.model.common.IVersionableEntity}
2020 * @param backgroundColor
2021 * a {@link org.eclipse.swt.graphics.Color} object.
2023 * {@link eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement}
2026 public AbstractEntityCollectionElement
createEntityCollectionElement(AbstractFormSection parentElement
,
2027 Object versionableEntity
, SelectionListener removeListener
, Color backgroundColor
, int style
) {
2028 AbstractEntityCollectionElement element
= null;
2030 Object entity
= HibernateProxyHelper
.deproxy(versionableEntity
);
2032 if (entity
instanceof Annotation
) {
2033 element
= new AnnotationElement(this, parentElement
, (Annotation
) entity
, removeListener
, style
);
2034 } else if (entity
instanceof Person
) {
2035 element
= new TeamMemberElement(this, parentElement
, (Person
) entity
, removeListener
, style
);
2036 } else if (entity
instanceof Credit
) {
2037 element
= new CreditElement(this, parentElement
, (Credit
) entity
, removeListener
, style
);
2038 } else if (entity
instanceof Extension
) {
2039 element
= new ExtensionElement(this, parentElement
, (Extension
) entity
, removeListener
, style
);
2040 } else if (entity
instanceof Marker
) {
2041 element
= new MarkerElement(this, parentElement
, (Marker
) entity
, removeListener
, style
);
2042 } else if (entity
instanceof Media
) {
2043 element
= new MediaElement(this, parentElement
, (Media
) entity
, removeListener
, style
);
2044 } else if (entity
instanceof MediaRepresentation
) {
2045 element
= new MediaRepresentationElement(this, parentElement
, (MediaRepresentation
) entity
, removeListener
,
2047 } else if (entity
instanceof ImageFile
) {
2048 element
= new ImageFileElement(this, parentElement
, (ImageFile
) entity
, removeListener
, style
);
2049 } else if (entity
instanceof MediaRepresentationPart
) {
2050 element
= new MediaRepresentationPartElement(this, parentElement
, (MediaRepresentationPart
) entity
,
2051 removeListener
, style
);
2052 } else if (entity
instanceof NomenclaturalStatus
) {
2053 element
= new NomenclaturalStatusElement(this, parentElement
, (NomenclaturalStatus
) entity
, removeListener
,
2055 } else if (entity
instanceof Rights
) {
2056 element
= new RightsElement(this, parentElement
, (Rights
) entity
, removeListener
, style
);
2057 } else if (entity
instanceof DescriptionElementSource
) {
2058 element
= new DescriptionElementSourceElement(this, parentElement
, (DescriptionElementSource
) entity
,
2059 removeListener
, style
);
2060 } else if (entity
instanceof IdentifiableSource
) {
2061 element
= new IdentifiableSourceElement(this, parentElement
, (IdentifiableSource
) entity
, removeListener
,
2063 } else if (entity
instanceof Scope
) {
2064 element
= new ScopeElement(this, parentElement
, (Scope
) entity
, removeListener
, style
);
2065 } else if (entity
instanceof Modifier
) {
2066 element
= new ModifierElement(this, parentElement
, (Modifier
) entity
, removeListener
, style
);
2067 } else if (entity
instanceof Reference
) {
2068 element
= new DescriptionSourceElement(this, parentElement
, (Reference
) entity
, removeListener
, style
);
2069 } else if (entity
instanceof NameTypeDesignation
) {
2070 element
= new NameTypeDesignationElement(this, parentElement
, (NameTypeDesignation
) entity
, removeListener
,
2072 } else if (entity
instanceof NameRelationship
) {
2073 element
= new NameRelationshipDetailElement(this, parentElement
, (NameRelationship
) entity
, removeListener
,
2075 } else if (entity
instanceof SpecimenTypeDesignation
) {
2076 element
= new SpecimenTypeDesignationElement(this, parentElement
, (SpecimenTypeDesignation
) entity
,
2077 removeListener
, style
);
2078 } else if (entity
instanceof StateData
) {
2079 element
= new StateDataElement(this, parentElement
, (StateData
) entity
, removeListener
, style
);
2080 } else if (entity
instanceof StatisticalMeasurementValue
) {
2081 element
= new StatisticalMeasurementValueElement(this, parentElement
, (StatisticalMeasurementValue
) entity
,
2082 removeListener
, style
);
2083 } else if (entity
instanceof DerivedUnit
) {
2084 element
= new DerivedUnitElement(this, parentElement
, (DerivedUnit
) entity
, removeListener
, style
);
2085 } else if (entity
instanceof NamedArea
) {
2086 element
= new NamedAreaDetailElement(this, parentElement
, (NamedArea
) entity
, removeListener
, style
);
2087 } else if (entity
instanceof DeterminationEvent
) {
2088 element
= new DeterminationEventDetailElement(this, parentElement
, (DeterminationEvent
) entity
, removeListener
, style
);
2089 } else if (entity
instanceof Specimen
) {
2090 element
= new SpecimenCollectionDetailElement(this, parentElement
, (Specimen
) entity
, removeListener
, style
);
2091 } else if (entity
instanceof User
) {
2092 element
= new MemberDetailElement(this, parentElement
, (User
) entity
, removeListener
, style
);
2093 } else if (entity
instanceof GrantedAuthority
) {
2094 element
= new GrantedAuthorityCollectionElement(this, parentElement
, (GrantedAuthorityImpl
) entity
,
2095 removeListener
, style
);
2096 } else if (entity
instanceof Group
) {
2097 element
= new GroupsByUserDetailElement(this, parentElement
, (Group
) entity
, removeListener
, style
);
2098 } else if (entity
instanceof Taxon
) {
2099 element
= new TaxonDetailElement(this, parentElement
, (Taxon
) entity
, removeListener
, style
);
2100 } else if (entity
instanceof DescriptionElementBase
) {
2101 // this is the special case for protologs, maybe we can do this
2102 // differently when API improves
2103 DescriptionElementBase descriptionElement
= (DescriptionElementBase
) entity
;
2104 if (descriptionElement
.getFeature().equals(Feature
.PROTOLOGUE())) {
2105 element
= new ProtologueElement(this, parentElement
, descriptionElement
, removeListener
, style
);
2109 if (element
== null) {
2110 AbstractUtility
.errorDialog("No element for entity", this,
2111 "Could not generate element for entity. Looks like the case is not handled already. Check implementation. Entity: "
2115 else if (backgroundColor
!= null && !backgroundColor
.isDisposed()) {
2116 element
.setPersistentBackground(backgroundColor
);
2118 parentElement
.addElement(element
);
2126 * Creates a selection element for the given type T.
2129 * <strong>Selection elements not handled by this method:</strong>
2131 * <li>{@link TaxonNodeSelectionElement} see
2132 * {@link #createTaxonNodeSelectionElement(ConversationHolder, ICdmFormElement, String, TaxonNode, int, int)}
2134 * <li>{@link NomenclaturalAuthorTeamSelectionElement} see
2135 * {@link #createNomenclaturalAuthorTeamSelectionElement(ConversationHolder, ICdmFormElement, String, Team, int, int)}
2141 * a {@link Class} object of the type that you want the selection
2143 * @param parentElement
2144 * a {@link ICdmFormElement} object.
2145 * @param labelString
2146 * a {@link String} object.
2147 * @param selectionType
2149 * a {@link ICdmBase} object.
2152 * @param conversation
2153 * a {@link ConversationHolder} object.
2154 * @return a {@link EntitySelectionElement} object.
2156 public <T
extends ICdmBase
> EntitySelectionElement
<T
> createSelectionElement(Class
<T
> clazz
,
2157 ConversationHolder conversation
, ICdmFormElement parentElement
, String labelString
, T selection
, int mode
,
2159 EntitySelectionElement
<T
> element
= new EntitySelectionElement
<T
>(this, conversation
, parentElement
, clazz
,
2160 labelString
, selection
, mode
, style
);
2162 parentElement
.addElement(element
);
2166 public TaxonNodeSelectionElement
createTaxonNodeSelectionElement(ConversationHolder conversation
,
2167 ICdmFormElement parentElement
, String labelString
, TaxonNode selection
, int mode
, int style
) {
2168 TaxonNodeSelectionElement element
= new TaxonNodeSelectionElement(this, conversation
, parentElement
,
2169 labelString
, selection
, mode
, style
);
2171 parentElement
.addElement(element
);
2175 public NomenclaturalAuthorTeamSelectionElement
createNomenclaturalAuthorTeamSelectionElement(
2176 ConversationHolder conversation
, ICdmFormElement parentElement
, String labelString
, Team selection
,
2177 int mode
, int style
) {
2178 NomenclaturalAuthorTeamSelectionElement element
= new NomenclaturalAuthorTeamSelectionElement(this,
2179 conversation
, parentElement
, labelString
, selection
, mode
, style
);
2181 parentElement
.addElement(element
);
2185 /** {@inheritDoc} */
2186 public LabelElement
createLabel(ICdmFormElement parentElement
, String text
) {
2187 LabelElement labelElement
= new LabelElement(this, parentElement
, text
);
2188 adapt(labelElement
);
2189 parentElement
.addElement(labelElement
);
2190 return labelElement
;
2195 * Getter for the field <code>selectionProvider</code>.
2198 * @return a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
2200 public ISelectionProvider
getSelectionProvider() {
2201 return selectionProvider
;
2206 * createDetailedDescriptionDetailElement
2209 * @param parentElement
2210 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
2214 * {@link eu.etaxonomy.cdm.model.description.DescriptionElementBase}
2219 * {@link eu.etaxonomy.taxeditor.ui.section.description.detail.AbstractDetailedDescriptionDetailElement}
2222 public AbstractDetailedDescriptionDetailElement
createDetailedDescriptionDetailElement(
2223 ICdmFormElement parentElement
, DescriptionElementBase entity
, int style
) {
2224 AbstractDetailedDescriptionDetailElement detailedDescriptionElement
= null;
2226 if (entity
instanceof CategoricalData
) {
2227 detailedDescriptionElement
= new CategoricalDataDetailElement(this, parentElement
,
2228 (CategoricalData
) entity
, style
);
2229 } else if (entity
instanceof CommonTaxonName
) {
2230 detailedDescriptionElement
= new CommonNameDetailElement(this, parentElement
, (CommonTaxonName
) entity
,
2232 } else if (entity
instanceof Distribution
) {
2233 detailedDescriptionElement
= new DistributionDetailElement(this, parentElement
, (Distribution
) entity
,
2235 } else if (entity
instanceof IndividualsAssociation
) {
2236 detailedDescriptionElement
= new IndividualsAssociationDetailElement(this, parentElement
,
2237 (IndividualsAssociation
) entity
, style
);
2238 } else if (entity
instanceof QuantitativeData
) {
2239 detailedDescriptionElement
= new QuantitativeDataDetailElement(this, parentElement
,
2240 (QuantitativeData
) entity
, style
);
2241 } else if (entity
instanceof TaxonInteraction
) {
2242 detailedDescriptionElement
= new TaxonInteractionDetailElement(this, parentElement
,
2243 (TaxonInteraction
) entity
, style
);
2244 } else if (entity
instanceof TextData
) {
2245 detailedDescriptionElement
= new TextDataDetailElement(this, parentElement
, (TextData
) entity
, style
);
2247 throw new IllegalStateException("There is no interface for the given description element");
2249 adapt(detailedDescriptionElement
);
2250 parentElement
.addElement(detailedDescriptionElement
);
2251 return detailedDescriptionElement
;
2256 * Creates a styled text as a part of the form.
2261 * the text initial value
2264 * @return the text widget
2266 public StyledText
createStyledText(Composite parent
, String value
, int style
) {
2267 StyledText text
= new StyledText(parent
, getBorderStyle() | style
| getOrientation());
2268 if (value
!= null) {
2269 text
.setText(value
);
2271 text
.setForeground(getColors().getForeground());
2272 text
.setBackground(getColors().getBackground());
2273 // text.addFocusListener(visibilityHandler);