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
.combo
.EnumComboElement
;
99 import eu
.etaxonomy
.taxeditor
.ui
.combo
.TermComboElement
;
100 import eu
.etaxonomy
.taxeditor
.ui
.openurl
.IOpenUrlEnabled
;
101 import eu
.etaxonomy
.taxeditor
.ui
.openurl
.OpenUrlSelectorElement
;
102 import eu
.etaxonomy
.taxeditor
.ui
.password
.EditPasswordElement
;
103 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailElement
;
104 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailSection
;
105 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionElement
;
106 import eu
.etaxonomy
.taxeditor
.ui
.section
.EmptyElement
;
107 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.InstitutionDetailElement
;
108 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.InstitutionDetailSection
;
109 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailElement
;
110 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailSection
;
111 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailElement
;
112 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailSection
;
113 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamMemberElement
;
114 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamMemberSection
;
115 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamOrPersonBaseDetailSection
;
116 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.ClassificationDetailElement
;
117 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.ClassificationDetailSection
;
118 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.TaxonNodeDetailElement
;
119 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.TaxonNodeDetailSection
;
120 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferenceEntityDetailElement
;
121 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferencedEntityDetailSection
;
122 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DerivedUnitElement
;
123 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescribedSpecimenSection
;
124 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailElement
;
125 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailSection
;
126 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailElement
;
127 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailSection
;
128 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementMediaSection
;
129 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceElement
;
130 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceSection
;
131 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceElement
;
132 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceSection
;
133 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.MediaDetailsSection
;
134 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ModifierElement
;
135 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ModifierSection
;
136 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageDetailElement
;
137 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageSection
;
138 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeElement
;
139 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeSection
;
140 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StateDataElement
;
141 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StateDataSection
;
142 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StatisticalMeasurementValueElement
;
143 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StatisticalMeasurementValueSection
;
144 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.AbstractDetailedDescriptionDetailElement
;
145 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.CategoricalDataDetailElement
;
146 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.CommonNameDetailElement
;
147 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.DistributionDetailElement
;
148 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.IndividualsAssociationDetailElement
;
149 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.QuantitativeDataDetailElement
;
150 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.TaxonInteractionDetailElement
;
151 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.TextDataDetailElement
;
152 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailElement
;
153 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailSection
;
154 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityCollectionElement
;
155 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailElement
;
156 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailSection
;
157 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailElement
;
158 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailSection
;
159 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailElement
;
160 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailSection
;
161 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.GeographicalScopeDetailSection
;
162 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailElement
;
163 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailSection
;
164 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailElement
;
165 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailSection
;
166 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.ScopeRestrictionSection
;
167 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.TaxonomicScopeSection
;
168 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.ImageFileElement
;
169 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaElement
;
170 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationElement
;
171 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationPartElement
;
172 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationPartSection
;
173 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationSection
;
174 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaSection
;
175 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.AuthorshipDetailElement
;
176 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.AuthorshipDetailSection
;
177 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.HybridDetailElement
;
178 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.HybridDetailSection
;
179 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameDetailElement
;
180 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameDetailSection
;
181 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailElement
;
182 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailSection
;
183 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameTypeDesignationElement
;
184 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusElement
;
185 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusSection
;
186 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailElement
;
187 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailSection
;
188 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.ProtologueElement
;
189 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.ProtologueSection
;
190 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.SpecimenTypeDesignationElement
;
191 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.TypeDesignationSection
;
192 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CollectingAreasDetailSection
;
193 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CollectionDetailElement
;
194 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CurrentDeterminationDetailSection
;
195 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitBaseDetailElement
;
196 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitBaseDetailSection
;
197 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitFacadeDetailElement
;
198 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitFacadeDetailSection
;
199 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailElement
;
200 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailSection
;
201 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationEventDetailElement
;
202 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationHistoryDetailSection
;
203 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldObservationDetailElement
;
204 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldObservationDetailSection
;
205 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailElement
;
206 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailSection
;
207 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GeneralDetailElement
;
208 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GeneralDetailSection
;
209 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.NamedAreaDetailElement
;
210 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SourceCollectionDetailSection
;
211 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SpecimenCollectionDetailElement
;
212 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SpecimenCollectionDetailSection
;
213 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailElement
;
214 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailSection
;
215 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailElement
;
216 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailSection
;
217 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.AnnotationElement
;
218 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.AnnotationSection
;
219 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CdmBaseElement
;
220 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CdmBaseSection
;
221 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CreditElement
;
222 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CreditSection
;
223 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.ExtensionElement
;
224 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.ExtensionSection
;
225 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.HeadlineSection
;
226 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.IdentifiableSourceElement
;
227 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.MarkerElement
;
228 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.MarkerSection
;
229 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.RightsElement
;
230 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.RightsSection
;
231 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.SourceSection
;
232 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.VersionElement
;
233 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.VersionSection
;
234 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessageElement
;
235 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessagesSection
;
236 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailElement
;
237 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailSection
;
238 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonDetailElement
;
239 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailElement
;
240 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailSection
;
241 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailElement
;
242 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailSection
;
243 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailElement
;
244 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailSection
;
245 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailElement
;
246 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailSection
;
247 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.DefinedTermDetailElement
;
248 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.DefinedTermDetailSection
;
249 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailSection
;
250 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailElement
;
251 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailSection
;
252 import eu
.etaxonomy
.taxeditor
.ui
.selection
.EntitySelectionElement
;
253 import eu
.etaxonomy
.taxeditor
.ui
.selection
.NomenclaturalAuthorTeamSelectionElement
;
254 import eu
.etaxonomy
.taxeditor
.ui
.selection
.TaxonNodeSelectionElement
;
258 * CdmFormFactory class.
262 * @created Feb 24, 2010
265 public class CdmFormFactory
extends FormToolkit
{
267 private BoldFontHolder2 boldFontHolder2
;
268 private MouseListener selectionMouseHandler
;
269 private FocusListener selectionFocusHandler
;
271 private final Set
<SelectionListener
> selectionListenerList
= new HashSet
<SelectionListener
>();
273 private final List
<IPropertyChangeListener
> propertyChangeListeners
= new ArrayList
<IPropertyChangeListener
>();
275 private final int orientation
= Window
.getDefaultOrientation();
276 private ISelectionProvider selectionProvider
;
278 /** Constant <code>EMPTY_SELECTION</code> */
279 public static ISelection EMPTY_SELECTION
= new ISelection() {
281 public boolean isEmpty() {
292 private class SelectionMouseHandler
extends MouseAdapter
{
294 public void mouseDown(MouseEvent e
) {
295 notifySelectionListeners(e
);
305 private class SelectionFocusHandler
extends FocusAdapter
{
307 public void focusGained(FocusEvent e
) {
308 notifySelectionListeners(e
);
312 private void notifySelectionListeners(TypedEvent e
) {
313 Event event
= new Event();
314 event
.widget
= e
.widget
;
315 SelectionEvent selectionEvent
= new SelectionEvent(event
);
317 for (SelectionListener listener
: selectionListenerList
) {
318 listener
.widgetSelected(selectionEvent
);
324 * Constructor for CdmFormFactory.
328 * a {@link org.eclipse.swt.widgets.Display} object.
329 * @param selectionProvider
330 * a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
332 public CdmFormFactory(Display display
, ISelectionProvider selectionProvider
) {
334 this.selectionProvider
= selectionProvider
;
340 * Constructor for CdmFormFactory.
344 * a {@link org.eclipse.swt.widgets.Display} object.
346 public CdmFormFactory(Display display
) {
354 private void init() {
355 boldFontHolder2
= new BoldFontHolder2();
356 selectionMouseHandler
= new SelectionMouseHandler();
357 selectionFocusHandler
= new SelectionFocusHandler();
361 * Creates an instance initialized with the correct selectionProvider
363 * Make sure to remove the instance when the entityComposite disposes via
364 * destroySelectionArbitrator(..)
366 * @param entityElement
367 * a {@link eu.etaxonomy.taxeditor.ui.element.IEntityElement}
369 * @return a {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator}
372 public SelectionArbitrator
createSelectionArbitrator(IEntityElement entityElement
) {
373 SelectionArbitrator selectionArbitrator
= new SelectionArbitrator(entityElement
);
374 selectionArbitrator
.addSelectionProvider(selectionProvider
);
375 selectionProvider
.addSelectionChangedListener(selectionArbitrator
);
376 addSelectionListener(selectionArbitrator
);
377 return selectionArbitrator
;
382 * destroySelectionArbitrator
385 * @param selectionArbitrator
387 * {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator}
390 public void destroySelectionArbitrator(SelectionArbitrator selectionArbitrator
) {
391 removeSelectionListener(selectionArbitrator
);
392 if (selectionProvider
!= null) {
393 selectionProvider
.removeSelectionChangedListener(selectionArbitrator
);
395 AbstractUtility
.error(this.getClass(),
396 "Tried to destroy a selection listener from this factories listeners but was null", null);
402 public void adapt(Composite composite
) {
403 composite
.addMouseListener(selectionMouseHandler
);
404 super.adapt(composite
);
409 * Adapts the {@link AbstractCdmFormElement}:<br>
410 * - sets the {@link IPropertyChangeListener}s handled by this class
415 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement}
418 public void adapt(AbstractCdmFormElement formElement
) {
419 formElement
.setPropertyChangeListeners(propertyChangeListeners
);
424 public void adapt(Control control
, boolean trackFocus
, boolean trackKeyboard
) {
426 control
.addFocusListener(selectionFocusHandler
);
428 super.adapt(control
, trackFocus
, trackKeyboard
);
437 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
440 public void destroyElement(ICdmFormElement formElement
) {
441 // return if element was not initialized
442 if (formElement
== null) {
445 // destroy selection arbitrator, if any
446 if (formElement
instanceof ISelectableElement
) {
447 destroySelectionArbitrator(((ISelectableElement
) formElement
).getSelectionArbitrator());
449 // remove this element form its parents list of elements
450 // ICdmFormElement parentElement = formElement.getParentElement();
451 // if(parentElement != null){
452 // parentElement.removeElement(formElement);
454 // call destroy on child elements recursively
455 for (ICdmFormElement childElement
: formElement
.getElements()) {
456 destroyElement(childElement
);
458 // dispose of the controls
459 for (Control control
: formElement
.getControls()) {
460 // we added the layoutComposite of the parental element as the
461 // layout composite to this formElement
462 // but we do not want to destroy it.
463 if (control
.equals(formElement
.getLayoutComposite())) {
478 * a {@link org.eclipse.swt.widgets.Composite} object.
479 * @return a {@link org.eclipse.swt.widgets.Label} object.
481 public Label
createEmptyCell(Composite parent
) {
482 return this.createLabel(parent
, null);
487 * createMultilineTextWithLabel
491 * a {@link java.lang.String} object.
496 * @param parentElement
497 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
499 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
502 public TextWithLabelElement
createMultilineTextWithLabel(ICdmFormElement parentElement
, String labelString
,
503 int textHeight
, int style
) {
504 TextWithLabelElement element
= new TextWithLabelElement(this, parentElement
, labelString
, "", textHeight
, style
);
506 parentElement
.addElement(element
);
512 * createMultiLanguageTextElement
515 * @param parentElement
516 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
519 * a {@link java.lang.String} object.
520 * @param multilanguageText
521 * a {@link java.util.Map} object.
527 * {@link eu.etaxonomy.taxeditor.ui.element.MultilanguageTextElement}
530 public MultilanguageTextElement
createMultiLanguageTextElement(ICdmFormElement parentElement
, String labelString
,
531 Map
<Language
, LanguageString
> multilanguageText
, int textHeight
, int style
) {
532 MultilanguageTextElement element
= new MultilanguageTextElement(this, parentElement
, labelString
,
533 multilanguageText
, textHeight
, style
);
535 parentElement
.addElement(element
);
539 public KeyStatementElement
createKeyStatementElement(ICdmFormElement parentElement
, String labelString
,
540 KeyStatement keyStatement
, int textHeight
, int style
) {
541 KeyStatementElement element
= new KeyStatementElement(this, parentElement
, labelString
, keyStatement
,
544 parentElement
.addElement(element
);
550 * createTextWithLabelElement
554 * a {@link java.lang.String} object.
556 * a {@link java.lang.String} object.
559 * @param parentElement
560 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
562 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
565 public TextWithLabelElement
createTextWithLabelElement(ICdmFormElement parentElement
, String labelString
,
566 String initialText
, int style
) {
567 TextWithLabelElement element
= new TextWithLabelElement(this, parentElement
, labelString
, initialText
, null,
570 parentElement
.addElement(element
);
574 public UriWithLabelElement
createUriWithLabelElement(ICdmFormElement parentElement
, String labelString
,
575 URI initialUri
, int style
) {
576 UriWithLabelElement element
= new UriWithLabelElement(this, parentElement
, labelString
, initialUri
, null, style
);
578 parentElement
.addElement(element
);
589 public OpenUrlSelectorElement
createOpenUrlSelectorElement(ICdmFormElement parentElement
, String labelString
,
590 IOpenUrlEnabled openUrlEnabled
, int style
) {
591 OpenUrlSelectorElement element
= new OpenUrlSelectorElement(this, parentElement
, labelString
, openUrlEnabled
,
594 parentElement
.addElement(element
);
600 * @param parentElement
602 * @param conversationEnabled
607 public EditPasswordElement
createEditPasswordElement(ICdmFormElement parentElement
, String labelString
,
608 ConversationHolder conversation
, User user
, int style
) {
609 EditPasswordElement element
= new EditPasswordElement(this, parentElement
, labelString
, user
, conversation
);
611 parentElement
.addElement(element
);
617 * createIntegerTextWithLabelElement
620 * @param parentElement
621 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
624 * a {@link java.lang.String} object.
625 * @param initialInteger
626 * a {@link java.lang.Integer} object.
630 * {@link eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement}
633 public NumberWithLabelElement
createIntegerTextWithLabelElement(ICdmFormElement parentElement
, String labelString
,
634 Integer initialInteger
, int style
) {
635 NumberWithLabelElement element
= new NumberWithLabelElement(this, parentElement
, labelString
, initialInteger
,
638 parentElement
.addElement(element
);
644 * createFloatTextWithLabelElement
647 * @param parentElement
648 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
651 * a {@link java.lang.String} object.
652 * @param initialFloat
657 * {@link eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement}
660 public NumberWithLabelElement
createFloatTextWithLabelElement(ICdmFormElement parentElement
, String labelString
,
661 float initialFloat
, int style
) {
662 NumberWithLabelElement element
= new NumberWithLabelElement(this, parentElement
, labelString
, initialFloat
,
665 parentElement
.addElement(element
);
671 * createLanguageStringWithLabelElement
674 * @param parentElement
675 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
678 * a {@link java.lang.String} object.
679 * @param languageString
680 * a {@link eu.etaxonomy.cdm.model.common.LanguageString} object.
684 * {@link eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement}
687 public LanguageStringWithLabelElement
createLanguageStringWithLabelElement(ICdmFormElement parentElement
,
688 String labelString
, LanguageString languageString
, int style
) {
689 LanguageStringWithLabelElement element
= new LanguageStringWithLabelElement(this, parentElement
, labelString
,
690 languageString
, style
);
692 parentElement
.addElement(element
);
698 * createLanguageStringWithLabelElement
701 * @param parentElement
702 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
705 * a {@link java.lang.String} object.
706 * @param languageString
707 * a {@link eu.etaxonomy.cdm.model.common.LanguageString} object.
713 * {@link eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement}
716 public LanguageStringWithLabelElement
createLanguageStringWithLabelElement(ICdmFormElement parentElement
,
717 String labelString
, LanguageString languageString
, int height
, int style
) {
718 LanguageStringWithLabelElement element
= new LanguageStringWithLabelElement(this, parentElement
, labelString
,
719 languageString
, height
, style
);
721 parentElement
.addElement(element
);
730 * @param parentElement
731 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
734 * a {@link java.lang.String} object.
737 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
740 public TextWithLabelElement
createTextElement(ICdmFormElement parentElement
, String initialText
, int style
) {
741 TextWithLabelElement element
= new TextWithLabelElement(this, parentElement
, null, initialText
, null, style
);
743 parentElement
.addElement(element
);
749 * createKeyValueViewerElement
752 * @param parentElement
753 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
756 * a {@link java.lang.String} object.
757 * @param valueHeading
758 * a {@link java.lang.String} object.
760 * a {@link java.util.Map} object.
761 * @return a {@link eu.etaxonomy.taxeditor.ui.element.KeyValueViewerElement}
764 public KeyValueViewerElement
createKeyValueViewerElement(ICdmFormElement parentElement
, String keyHeading
,
765 String valueHeading
, Map
<Object
, Object
> map
) {
766 KeyValueViewerElement element
= new KeyValueViewerElement(this, parentElement
, keyHeading
, valueHeading
, map
);
768 parentElement
.addElement(element
);
774 * createTermComboElement
777 * @param termComboType
779 * {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.TermComboType}
781 * @param parentElement
782 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
785 * a {@link java.lang.String} object.
787 * a {@link eu.etaxonomy.cdm.model.common.DefinedTermBase}
791 * @return a {@link eu.etaxonomy.taxeditor.ui.combo.TermComboElement}
795 public <T
extends DefinedTermBase
> TermComboElement
<T
> createTermComboElement(Class
<T
> termComboType
,
796 ICdmFormElement parentElement
, String labelString
, T selection
, int style
) {
797 TermComboElement
<T
> element
= new TermComboElement
<T
>(this, parentElement
, termComboType
, labelString
,
800 parentElement
.addElement(element
);
806 * createEnumComboElement
809 * @param enumComboType
811 * {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EnumComboType}
813 * @param parentElement
814 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
818 * @return a {@link eu.etaxonomy.taxeditor.ui.term.AbstractEnumComboElement}
821 public <T
extends IDefinedTerm
> EnumComboElement
<T
> createEnumComboElement(Class
<T
> enumComboType
,
822 ICdmFormElement parentElement
, int style
) {
823 EnumComboElement
<T
> element
= new EnumComboElement
<T
>(this, parentElement
, enumComboType
, style
);
825 parentElement
.addElement(element
);
831 * createBrowserElement
835 * a {@link java.net.URI} object.
838 * @param parentElement
839 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
841 * @return a {@link eu.etaxonomy.taxeditor.ui.element.BrowserElement}
844 public BrowserElement
createBrowserElement(ICdmFormElement parentElement
, URI imageUri
, int style
) {
845 BrowserElement element
= new BrowserElement(this, parentElement
, imageUri
, style
);
847 parentElement
.addElement(element
);
856 * @param parentElement
857 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
860 * a {@link java.net.URI} object.
863 * @return a {@link eu.etaxonomy.taxeditor.ui.element.ImageElement} object.
865 public ImageElement
createImageElement(ICdmFormElement parentElement
, URI imageUri
, int style
) {
866 ImageElement element
= new ImageElement(this, parentElement
, imageUri
, style
);
868 parentElement
.addElement(element
);
874 * createTextActionElement
878 * a {@link java.lang.String} object.
880 * a {@link java.lang.String} object.
883 * @param parentElement
884 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
887 * a {@link java.lang.String} object.
888 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextActionElement}
891 public TextActionElement
createTextActionElement(ICdmFormElement parentElement
, String labelString
,
892 String buttonLabel
, String initialText
, int style
) {
893 TextActionElement element
= new TextActionElement(this, parentElement
, labelString
, buttonLabel
, initialText
,
896 parentElement
.addElement(element
);
905 * @param parentElement
906 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
909 * a {@link java.lang.String} object.
910 * @param initialState
914 * @return a {@link eu.etaxonomy.taxeditor.ui.element.CheckboxElement}
917 public CheckboxElement
createCheckbox(ICdmFormElement parentElement
, String label
, boolean initialState
, int style
) {
918 CheckboxElement element
= new CheckboxElement(this, parentElement
, label
, initialState
, style
| orientation
);
920 parentElement
.addElement(element
);
925 * Creates a section as a part of the form.
927 * @return the section widget
930 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
933 public Section
adapt(AbstractFormSection section
) {
934 section
.setMenu(section
.getLayoutComposite().getMenu());
935 adapt(section
, true, true);
937 // handle focus and property change events for cdm use
938 section
.addFocusListener(selectionFocusHandler
);
939 section
.setPropertyChangeListeners(propertyChangeListeners
);
941 if (section
.getToggle() != null) {
942 section
.getToggle().setHoverDecorationColor(getColors().getColor(IFormColors
.TB_TOGGLE_HOVER
));
943 section
.getToggle().setDecorationColor(getColors().getColor(IFormColors
.TB_TOGGLE
));
946 section
.setFont(boldFontHolder2
.getBoldFont(section
.getLayoutComposite().getFont()));
948 if ((section
.getStyle() & ExpandableComposite
.TITLE_BAR
) != 0
949 || (section
.getStyle() & ExpandableComposite
.SHORT_TITLE_BAR
) != 0) {
950 getColors().initializeSectionToolBarColors();
951 section
.setTitleBarBackground(getColors().getColor(IFormColors
.TB_BG
));
952 section
.setTitleBarBorderColor(getColors().getColor(IFormColors
.TB_BORDER
));
954 // call setTitleBarForeground regardless as it also sets the label color
955 section
.setTitleBarForeground(getColors().getColor(IFormColors
.TB_TOGGLE
));
959 private class BoldFontHolder2
{
960 private Font normalFont
;
962 private Font boldFont
;
964 public BoldFontHolder2() {
967 public Font
getBoldFont(Font font
) {
968 createBoldFont(font
);
972 private void createBoldFont(Font font
) {
973 if (normalFont
== null || !normalFont
.equals(font
)) {
977 if (boldFont
== null) {
978 boldFont
= FormFonts
.getInstance().getBoldFont(getColors().getDisplay(), normalFont
);
982 public void dispose() {
983 if (boldFont
!= null) {
984 FormFonts
.getInstance().markFinished(boldFont
, getColors().getDisplay());
992 * createToggleableTextField
995 * @param parentElement
996 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
999 * a {@link java.lang.String} object.
1000 * @param initialText
1001 * a {@link java.lang.String} object.
1002 * @param initialState
1006 * @return a {@link eu.etaxonomy.taxeditor.ui.element.ToggleableTextElement}
1009 public ToggleableTextElement
createToggleableTextField(ICdmFormElement parentElement
, String labelString
,
1010 String initialText
, boolean initialState
, int style
) {
1011 ToggleableTextElement element
= new ToggleableTextElement(this, parentElement
, labelString
, initialText
,
1012 initialState
, style
| orientation
);
1014 parentElement
.addElement(element
);
1020 * createTimePeriodElement
1023 * @param parentElement
1024 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1026 * @param labelString
1027 * a {@link java.lang.String} object.
1029 * a {@link eu.etaxonomy.cdm.model.common.TimePeriod} object.
1032 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TimePeriodElement}
1035 public TimePeriodElement
createTimePeriodElement(ICdmFormElement parentElement
, String labelString
,
1036 TimePeriod timePeriod
, int style
) {
1037 TimePeriodElement element
= new TimePeriodElement(this, parentElement
, labelString
, timePeriod
, style
);
1039 parentElement
.addElement(element
);
1045 * createPointElement
1050 * @param parentElement
1051 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1054 * a {@link eu.etaxonomy.cdm.model.location.Point} object.
1055 * @return a {@link eu.etaxonomy.taxeditor.ui.element.PointElement} object.
1057 public PointElement
createPointElement(ICdmFormElement parentElement
, Point point
, int style
) {
1058 PointElement element
= new PointElement(this, parentElement
, point
, style
);
1060 parentElement
.addElement(element
);
1066 * createDateDetailSection
1069 * @param parentElement
1070 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1074 * @return a {@link eu.etaxonomy.taxeditor.ui.element.DateDetailSection}
1077 public DateDetailSection
createDateDetailSection(ICdmFormElement parentElement
, int style
) {
1078 DateDetailSection section
= new DateDetailSection(this, parentElement
, style
);
1079 parentElement
.addElement(section
);
1086 * createPartialElement
1089 * @param parentElement
1090 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1092 * @param labelString
1093 * a {@link java.lang.String} object.
1095 * a {@link org.joda.time.Partial} object.
1098 * @return a {@link eu.etaxonomy.taxeditor.ui.element.PartialElement}
1101 public PartialElement
createPartialElement(ICdmFormElement parentElement
, String labelString
, Partial partial
,
1103 PartialElement element
= new PartialElement(this, parentElement
, labelString
, style
);
1105 parentElement
.addElement(element
);
1111 * addSelectionListener
1115 * a {@link org.eclipse.swt.events.SelectionListener} object.
1117 public void addSelectionListener(SelectionListener listener
) {
1118 selectionListenerList
.add(listener
);
1123 * removeSelectionListener
1127 * a {@link org.eclipse.swt.events.SelectionListener} object.
1129 public void removeSelectionListener(SelectionListener listener
) {
1130 if (listener
== null) {
1131 AbstractUtility
.error(this.getClass(),
1132 "Tried to remove a selection listener from this factories listeners but was null", null);
1134 selectionListenerList
.remove(listener
);
1140 * addPropertyChangeListener
1144 * a {@link org.eclipse.jface.util.IPropertyChangeListener}
1147 public void addPropertyChangeListener(IPropertyChangeListener listener
) {
1148 if (propertyChangeListeners
.contains(listener
)) {
1151 propertyChangeListeners
.add(0, listener
);
1156 * removePropertyChangeListener
1160 * a {@link org.eclipse.jface.util.IPropertyChangeListener}
1163 public void removePropertyChangeListener(IPropertyChangeListener listener
) {
1164 propertyChangeListeners
.remove(listener
);
1169 * createHorizontalSeparator
1172 * @param parentElement
1173 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1177 * @return a {@link org.eclipse.swt.widgets.Label} object.
1179 public Label
createHorizontalSeparator(ICdmFormElement parentElement
, int style
) {
1180 Label separator
= this.createSeparator(parentElement
.getLayoutComposite(), SWT
.HORIZONTAL
| style
);
1181 separator
.setLayoutData(LayoutConstants
.FILL_HORIZONTALLY());
1187 * createVersionElement
1190 * @param parentElement
1191 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1194 * a {@link eu.etaxonomy.cdm.model.common.VersionableEntity}
1199 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.VersionElement}
1202 public VersionElement
createVersionElement(ICdmFormElement parentElement
, VersionableEntity entity
, int style
) {
1203 VersionElement element
= new VersionElement(this, parentElement
, entity
, style
);
1205 parentElement
.addElement(element
);
1210 * @param cdmBaseSection
1215 public CdmBaseElement
createCdmBaseElement(ICdmFormElement parentElement
, CdmBase entity
, int style
) {
1216 CdmBaseElement element
= new CdmBaseElement(this, parentElement
, entity
, style
);
1218 parentElement
.addElement(element
);
1224 * createVersionSection
1227 * @param parentElement
1228 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1233 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.VersionSection}
1236 public VersionSection
createVersionSection(ICdmFormElement parentElement
, int style
) {
1237 VersionSection section
= new VersionSection(this, parentElement
, style
);
1238 parentElement
.addElement(section
);
1248 public CdmBaseSection
createCdmBaseSection(ICdmFormElement parentElement
, int style
) {
1249 CdmBaseSection section
= new CdmBaseSection(this, parentElement
, style
);
1250 parentElement
.addElement(section
);
1257 * createEmptyElement
1260 * @param parentElement
1261 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1263 * @return a {@link eu.etaxonomy.taxeditor.ui.section.EmptyElement} object.
1265 public EmptyElement
createEmptyElement(ICdmFormElement parentElement
) {
1266 EmptyElement element
= new EmptyElement(this, parentElement
, null, SWT
.NULL
);
1268 parentElement
.addElement(element
);
1274 * createHeadlineSection
1277 * @param parentElement
1278 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1281 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.HeadlineSection}
1284 public HeadlineSection
createHeadlineSection(ICdmFormElement parentElement
) {
1285 HeadlineSection section
= new HeadlineSection(this, parentElement
, SWT
.NULL
);
1286 parentElement
.addElement(section
);
1293 * createParsingMessageElement
1296 * @param parentElement
1297 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1299 * @param parserProblem
1300 * a {@link eu.etaxonomy.cdm.strategy.parser.ParserProblem}
1305 * {@link eu.etaxonomy.taxeditor.ui.section.taxon.ParsingMessageElement}
1308 public ParsingMessageElement
createParsingMessageElement(ICdmFormElement parentElement
,
1309 ParserProblem parserProblem
, int style
) {
1310 ParsingMessageElement element
= new ParsingMessageElement(this, parentElement
, parserProblem
, style
);
1312 parentElement
.addElement(element
);
1316 public AbstractFormSection
createDefinedTermDetailSection(Class definedTermClass
, ConversationHolder conversation
,
1317 ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
1319 AbstractFormSection section
= new DefinedTermDetailSection(this, definedTermClass
, conversation
, parentElement
,
1320 selectionProvider
, style
);
1322 parentElement
.addElement(section
);
1329 * @param definedTermClass
1330 * @param formElement
1334 public AbstractCdmDetailElement
createDefinedTermDetailElement(Class definedTermClass
, AbstractCdmDetailSection parentElement
, int style
) {
1335 AbstractCdmDetailElement element
= null;
1337 if (NamedArea
.class.isAssignableFrom(definedTermClass
)) {
1338 element
= new eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement(this, parentElement
);
1340 element
= new DefinedTermDetailElement(this, parentElement
);
1344 parentElement
.addElement(element
);
1349 //--------DetailSections---------
1350 public NameDetailSection
createNameDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1351 NameDetailSection section
= new NameDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1352 addAndAdaptSection(parentElement
, section
);
1356 public ReferenceDetailSection
createReferenceDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1357 ReferenceDetailSection section
= new ReferenceDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1358 addAndAdaptSection(parentElement
, section
);
1362 public NomenclaturalReferenceDetailSection
createNomenclaturalReferenceDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1363 NomenclaturalReferenceDetailSection section
= new NomenclaturalReferenceDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1364 addAndAdaptSection(parentElement
, section
);
1368 public TaxonBaseDetailSection
createTaxonBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1369 TaxonBaseDetailSection section
= new TaxonBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1370 addAndAdaptSection(parentElement
, section
);
1374 public AuthorshipDetailSection
createAuthorshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1375 AuthorshipDetailSection section
= new AuthorshipDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1376 addAndAdaptSection(parentElement
, section
);
1380 public TeamOrPersonBaseDetailSection
createTeamOrPersonBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1381 TeamOrPersonBaseDetailSection section
= new TeamOrPersonBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1382 addAndAdaptSection(parentElement
, section
);
1386 public TeamDetailSection
createTeamDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1387 TeamDetailSection section
= new TeamDetailSection(this, conversation
, parentElement
, null, style
);
1388 addAndAdaptSection(parentElement
, section
);
1392 public PersonDetailSection
createPersonDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1393 PersonDetailSection section
= new PersonDetailSection(this, conversation
, parentElement
, null, style
);
1394 addAndAdaptSection(parentElement
, section
);
1398 public DescriptionDetailSection
createDescriptionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1399 DescriptionDetailSection section
= new DescriptionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1400 addAndAdaptSection(parentElement
, section
);
1404 public DescriptionElementDetailSection
createDescriptionElementDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1405 DescriptionElementDetailSection section
= new DescriptionElementDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1406 addAndAdaptSection(parentElement
, section
);
1410 public ParsingMessagesSection
createParsingMessagesSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1411 ParsingMessagesSection section
= new ParsingMessagesSection(this, conversation
, parentElement
, selectionProvider
, style
);
1412 addAndAdaptSection(parentElement
, section
);
1416 public NonViralNameDetailSection
createNonViralNameDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1417 NonViralNameDetailSection section
= new NonViralNameDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1418 addAndAdaptSection(parentElement
, section
);
1422 public MediaDetailsSection
createMediaDetailsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1423 MediaDetailsSection section
= new MediaDetailsSection(this, conversation
, parentElement
, selectionProvider
, style
);
1424 addAndAdaptSection(parentElement
, section
);
1428 public DerivedUnitFacadeDetailSection
createDerivedUnitFacadeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1429 DerivedUnitFacadeDetailSection section
= new DerivedUnitFacadeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1430 addAndAdaptSection(parentElement
, section
);
1434 public FieldObservationDetailSection
createFieldObservationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1435 FieldObservationDetailSection section
= new FieldObservationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1436 addAndAdaptSection(parentElement
, section
);
1440 public GatheringEventDetailSection
createGatheringEventDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1441 GatheringEventDetailSection section
= new GatheringEventDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1442 addAndAdaptSection(parentElement
, section
);
1446 public DerivedUnitBaseDetailSection
createDerivedUnitBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1447 DerivedUnitBaseDetailSection section
= new DerivedUnitBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1448 addAndAdaptSection(parentElement
, section
);
1452 public NaturalLanguageSection
createNaturalLanguageSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1453 NaturalLanguageSection section
= new NaturalLanguageSection(this, conversation
, parentElement
, selectionProvider
, style
);
1454 addAndAdaptSection(parentElement
, section
);
1458 public FeatureDistributionDetailSection
createFeatureDistributionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1459 FeatureDistributionDetailSection section
= new FeatureDistributionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1460 addAndAdaptSection(parentElement
, section
);
1464 public ClassificationDetailSection
createClassificationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1465 ClassificationDetailSection section
= new ClassificationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1466 addAndAdaptSection(parentElement
, section
);
1470 public TaxonNodeDetailSection
createTaxonNodeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1471 TaxonNodeDetailSection section
= new TaxonNodeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1472 addAndAdaptSection(parentElement
, section
);
1476 public PolytomousKeyDetailSection
createPolytomousKeyDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1477 PolytomousKeyDetailSection section
= new PolytomousKeyDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1478 addAndAdaptSection(parentElement
, section
);
1482 public PolytomousKeyNodeDetailSection
createPolytomousKeyNodeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1483 PolytomousKeyNodeDetailSection section
= new PolytomousKeyNodeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1484 addAndAdaptSection(parentElement
, section
);
1488 public InstitutionDetailSection
createInstitutionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1489 InstitutionDetailSection section
= new InstitutionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1490 addAndAdaptSection(parentElement
, section
);
1494 public GeneralDetailSection
createGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1495 GeneralDetailSection section
= new GeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1496 addAndAdaptSection(parentElement
, section
);
1500 public HybridDetailSection
createHybridDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1501 HybridDetailSection section
= new HybridDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1502 addAndAdaptSection(parentElement
, section
);
1506 public UserDetailSection
createUserDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1507 UserDetailSection section
= new UserDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1508 addAndAdaptSection(parentElement
, section
);
1512 public GroupDetailSection
createGroupDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1513 GroupDetailSection section
= new GroupDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1514 addAndAdaptSection(parentElement
, section
);
1518 public DeterminationDetailSection
createDeterminationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1519 DeterminationDetailSection section
= new DeterminationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1520 addAndAdaptSection(parentElement
, section
);
1524 public TaxonRelationshipDetailSection
createTaxonRelationshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1525 TaxonRelationshipDetailSection section
= new TaxonRelationshipDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1526 addAndAdaptSection(parentElement
, section
);
1530 public ReferencedEntityDetailSection
createReferencedEntityDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1531 ReferencedEntityDetailSection section
= new ReferencedEntityDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1532 addAndAdaptSection(parentElement
, section
);
1536 public TermVocabularyDetailSection
createTermVocabularyDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1537 TermVocabularyDetailSection section
= new TermVocabularyDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1538 addAndAdaptSection(parentElement
, section
);
1543 public NamedAreaDetailSection
createNamedAreaDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1544 NamedAreaDetailSection section
= new NamedAreaDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1545 addAndAdaptSection(parentElement
, section
);
1549 public UseRecordDetailSection
createUseRecordDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1550 UseRecordDetailSection section
= new UseRecordDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1551 addAndAdaptSection(parentElement
, section
);
1555 public GeneralDetailSection
createFOSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1556 GeneralDetailSection section
= new GeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1557 addAndAdaptSection(parentElement
, section
);
1561 public GatheringEventDetailSection
createGatheringSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1562 GatheringEventDetailSection section
= new GatheringEventDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1563 addAndAdaptSection(parentElement
, section
);
1567 public FieldObservationDetailSection
createFODetailsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1568 FieldObservationDetailSection section
= new FieldObservationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1569 addAndAdaptSection(parentElement
, section
);
1573 private void addAndAdaptSection(ICdmFormElement parentElement
, AbstractFormSection
<?
> section
) {
1574 parentElement
.addElement(section
);
1578 //--------DetailElements------------
1580 public UseRecordDetailElement
createUseRecordDetailElement(ICdmFormElement parentElement
){
1581 UseRecordDetailElement element
= new UseRecordDetailElement(this, parentElement
);
1582 addAndAdaptElement(parentElement
, element
);
1586 public DefinedTermDetailElement
<NamedAreaLevel
> createNamedAreaLevelElement(ICdmFormElement parentElement
){
1587 DefinedTermDetailElement
<NamedAreaLevel
> element
= new DefinedTermDetailElement
<NamedAreaLevel
>(this, parentElement
);
1588 addAndAdaptElement(parentElement
, element
);
1592 public eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement
createNamedAreaDetailElement(ICdmFormElement parentElement
){
1593 eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement element
= new eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement(this, parentElement
);
1594 addAndAdaptElement(parentElement
, element
);
1598 public TermVocabularyDetailElement
createTermVocabularyDetailElement(ICdmFormElement parentElement
){
1599 TermVocabularyDetailElement element
= new TermVocabularyDetailElement(this, parentElement
);
1600 addAndAdaptElement(parentElement
, element
);
1604 public ReferenceEntityDetailElement
createReferenceEntityDetailElement(ICdmFormElement parentElement
){
1605 ReferenceEntityDetailElement element
= new ReferenceEntityDetailElement(this, parentElement
);
1606 addAndAdaptElement(parentElement
, element
);
1610 public TaxonRelationshipDetailElement
createTaxonRelationshipDetailElement(ICdmFormElement parentElement
){
1611 TaxonRelationshipDetailElement element
= new TaxonRelationshipDetailElement(this, parentElement
);
1612 addAndAdaptElement(parentElement
, element
);
1616 public GrantedAuthorityDetailElement
createGrantedAuthorityDetailElement(ICdmFormElement parentElement
){
1617 GrantedAuthorityDetailElement element
= new GrantedAuthorityDetailElement(this, parentElement
);
1618 addAndAdaptElement(parentElement
, element
);
1622 public GroupDetailElement
createGroupDetailElement(ICdmFormElement parentElement
){
1623 GroupDetailElement element
= new GroupDetailElement(this, parentElement
);
1624 addAndAdaptElement(parentElement
, element
);
1628 public UserDetailElement
createUserDetailElement(ICdmFormElement parentElement
){
1629 UserDetailElement element
= new UserDetailElement(this, parentElement
);
1630 addAndAdaptElement(parentElement
, element
);
1634 public HybridDetailElement
createHybridDetailElement(ICdmFormElement parentElement
){
1635 HybridDetailElement element
= new HybridDetailElement(this, parentElement
);
1636 addAndAdaptElement(parentElement
, element
);
1640 public InstitutionDetailElement
createInstitutionDetailElement(ICdmFormElement parentElement
){
1641 InstitutionDetailElement element
= new InstitutionDetailElement(this, parentElement
);
1642 addAndAdaptElement(parentElement
, element
);
1646 public PolytomousKeyNodeDetailElement
createPolytomousKeyNodeDetailElement(ICdmFormElement parentElement
){
1647 PolytomousKeyNodeDetailElement element
= new PolytomousKeyNodeDetailElement(this, parentElement
);
1648 addAndAdaptElement(parentElement
, element
);
1652 public PolytomousKeyDetailElement
createPolytomousKeyDetailElement(ICdmFormElement parentElement
){
1653 PolytomousKeyDetailElement element
= new PolytomousKeyDetailElement(this, parentElement
);
1654 addAndAdaptElement(parentElement
, element
);
1658 public CollectionDetailElement
createCollectionDetailElement(ICdmFormElement parentElement
){
1659 CollectionDetailElement element
= new CollectionDetailElement(this, parentElement
);
1660 addAndAdaptElement(parentElement
, element
);
1664 public TaxonNodeDetailElement
createTaxonNodeDetailElement(ICdmFormElement parentElement
){
1665 TaxonNodeDetailElement element
= new TaxonNodeDetailElement(this, parentElement
);
1666 addAndAdaptElement(parentElement
, element
);
1670 public ClassificationDetailElement
createClassificationDetailElement(ICdmFormElement parentElement
){
1671 ClassificationDetailElement element
= new ClassificationDetailElement(this, parentElement
);
1672 addAndAdaptElement(parentElement
, element
);
1676 public FeatureDistributionDetailElement
createFeatureDistributionDetailElement(ICdmFormElement parentElement
){
1677 FeatureDistributionDetailElement element
= new FeatureDistributionDetailElement(this, parentElement
);
1678 addAndAdaptElement(parentElement
, element
);
1682 public NaturalLanguageDetailElement
createNaturalLanguageDetailElement(ICdmFormElement parentElement
){
1683 NaturalLanguageDetailElement element
= new NaturalLanguageDetailElement(this, parentElement
);
1684 addAndAdaptElement(parentElement
, element
);
1688 public DerivedUnitFacadeDetailElement
createDerivedUnitFacadeDetailElement(ICdmFormElement parentElement
){
1689 DerivedUnitFacadeDetailElement element
= new DerivedUnitFacadeDetailElement(this, parentElement
);
1690 addAndAdaptElement(parentElement
, element
);
1694 public NonViralNameDetailElement
createNonViralNameDetailElement(ICdmFormElement parentElement
){
1695 NonViralNameDetailElement element
= new NonViralNameDetailElement(this, parentElement
);
1696 addAndAdaptElement(parentElement
, element
);
1700 public DescriptionElementDetailElement
createDescriptionElementDetailElement(ICdmFormElement parentElement
, int style
){
1701 DescriptionElementDetailElement element
= new DescriptionElementDetailElement(this, parentElement
, style
);
1702 addAndAdaptElement(parentElement
, element
);
1706 public DescriptionDetailElement
createDescriptionDetailElement(ICdmFormElement parentElement
, int style
){
1707 DescriptionDetailElement element
= new DescriptionDetailElement(this, parentElement
, style
);
1708 addAndAdaptElement(parentElement
, element
);
1712 public PersonDetailElement
createPersonDetailElement(ICdmFormElement parentElement
, int style
){
1713 PersonDetailElement element
= new PersonDetailElement(this, parentElement
, style
);
1714 addAndAdaptElement(parentElement
, element
);
1718 public TeamDetailElement
createTeamDetailElement(ICdmFormElement parentElement
, int style
){
1719 TeamDetailElement element
= new TeamDetailElement(this, parentElement
, style
);
1720 addAndAdaptElement(parentElement
, element
);
1724 public AuthorshipDetailElement
createAuthorshipDetailElement(ICdmFormElement parentElement
, int style
){
1725 AuthorshipDetailElement element
= new AuthorshipDetailElement(this, parentElement
, style
);
1726 addAndAdaptElement(parentElement
, element
);
1730 public TaxonBaseDetailElement
createTaxonBaseDetailElement(ICdmFormElement parentElement
, int style
){
1731 TaxonBaseDetailElement element
= new TaxonBaseDetailElement(this, parentElement
, style
);
1732 addAndAdaptElement(parentElement
, element
);
1736 public NameDetailElement
createNameDetailElement(ICdmFormElement parentElement
, int style
){
1737 NameDetailElement element
= new NameDetailElement(this, parentElement
, style
);
1738 addAndAdaptElement(parentElement
, element
);
1742 public ReferenceDetailElement
createReferenceDetailElement(ICdmFormElement parentElement
, int style
){
1743 ReferenceDetailElement element
= new ReferenceDetailElement(this, parentElement
, style
);
1744 addAndAdaptElement(parentElement
, element
);
1748 public NomenclaturalReferenceDetailElement
createNomenclaturalReferenceDetailElement(ICdmFormElement parentElement
, int style
){
1749 NomenclaturalReferenceDetailElement element
= new NomenclaturalReferenceDetailElement(this, parentElement
, style
);
1750 addAndAdaptElement(parentElement
, element
);
1755 public GeneralDetailElement
createGeneralDetailElement(ICdmFormElement parentElement
){
1756 GeneralDetailElement element
= new GeneralDetailElement(this, parentElement
);
1757 addAndAdaptElement(parentElement
, element
);
1761 public GatheringEventDetailElement
createGatheringEventDetailElement(ICdmFormElement parentElement
) {
1762 GatheringEventDetailElement element
= new GatheringEventDetailElement(this, parentElement
);
1763 addAndAdaptElement(parentElement
, element
);
1767 public FieldObservationDetailElement
createFieldObservationDetailElement(ICdmFormElement parentElement
) {
1768 FieldObservationDetailElement element
= new FieldObservationDetailElement(this, parentElement
);
1769 addAndAdaptElement(parentElement
, element
);
1773 public DerivedUnitBaseDetailElement
createDerivedUnitBaseDetailElement(ICdmFormElement parentElement
) {
1774 DerivedUnitBaseDetailElement element
= new DerivedUnitBaseDetailElement(this, parentElement
);
1775 addAndAdaptElement(parentElement
, element
);
1779 public DeterminationDetailElement
createDeterminationDetailElement(ICdmFormElement parentElement
) {
1780 DeterminationDetailElement element
= new DeterminationDetailElement(this, parentElement
);
1781 addAndAdaptElement(parentElement
, element
);
1786 * @param parentElement
1789 private void addAndAdaptElement(ICdmFormElement parentElement
, AbstractCdmDetailElement
<?
> element
) {
1791 parentElement
.addElement(element
);
1794 //--------EntityCollectionSection----------
1795 public TeamMemberSection
createTeamMemberSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1796 TeamMemberSection section
= new TeamMemberSection(this, conversation
, parentElement
, style
);
1797 addAndAdaptSection(parentElement
, section
);
1801 public AnnotationSection
createAnnotationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1802 AnnotationSection section
= new AnnotationSection(this, conversation
, parentElement
, style
);
1803 addAndAdaptSection(parentElement
, section
);
1807 public CreditSection
createCreditSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1808 CreditSection section
= new CreditSection(this, conversation
, parentElement
, style
);
1809 addAndAdaptSection(parentElement
, section
);
1813 public DescriptionElementSourceSection
createDescriptionElementSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1814 DescriptionElementSourceSection section
= new DescriptionElementSourceSection(this, conversation
, parentElement
, style
);
1815 addAndAdaptSection(parentElement
, section
);
1819 public ExtensionSection
createExtensionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1820 ExtensionSection section
= new ExtensionSection(this, conversation
, parentElement
, style
);
1821 addAndAdaptSection(parentElement
, section
);
1825 public MarkerSection
createMarkerSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1826 MarkerSection section
= new MarkerSection(this, conversation
, parentElement
, style
);
1827 addAndAdaptSection(parentElement
, section
);
1831 public MediaSection
createMediaSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1832 MediaSection section
= new MediaSection(this, conversation
, parentElement
, style
);
1833 addAndAdaptSection(parentElement
, section
);
1837 public DescriptionElementMediaSection
createDescriptionElementMediaSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1838 DescriptionElementMediaSection section
= new DescriptionElementMediaSection(this, conversation
, parentElement
, style
);
1839 addAndAdaptSection(parentElement
, section
);
1843 public MediaRepresentationSection
createMediaRepresentationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1844 MediaRepresentationSection section
= new MediaRepresentationSection(this, conversation
, parentElement
, style
);
1845 addAndAdaptSection(parentElement
, section
);
1849 public MediaRepresentationPartSection
createMediaRepresentationPartSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1850 MediaRepresentationPartSection section
= new MediaRepresentationPartSection(this, conversation
, parentElement
, style
);
1851 addAndAdaptSection(parentElement
, section
);
1855 public ModifierSection
createModifierSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1856 ModifierSection section
= new ModifierSection(this, conversation
, parentElement
, style
);
1857 addAndAdaptSection(parentElement
, section
);
1861 public NomenclaturalStatusSection
createNomenclaturalStatusSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1862 NomenclaturalStatusSection section
= new NomenclaturalStatusSection(this, conversation
, parentElement
, style
);
1863 addAndAdaptSection(parentElement
, section
);
1867 public NameRelationshipDetailSection
createNameRelationshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1868 NameRelationshipDetailSection section
= new NameRelationshipDetailSection(this, conversation
, parentElement
, style
);
1869 addAndAdaptSection(parentElement
, section
);
1873 public ProtologueSection
createProtologueSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1874 ProtologueSection section
= new ProtologueSection(this, conversation
, parentElement
, style
);
1875 addAndAdaptSection(parentElement
, section
);
1879 public RightsSection
createRightsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1880 RightsSection section
= new RightsSection(this, conversation
, parentElement
, style
);
1881 addAndAdaptSection(parentElement
, section
);
1885 public SourceSection
createSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1886 SourceSection section
= new SourceSection(this, conversation
, parentElement
, style
);
1887 addAndAdaptSection(parentElement
, section
);
1891 public ScopeSection
createScopeSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1892 ScopeSection section
= new ScopeSection(this, conversation
, parentElement
, style
);
1893 addAndAdaptSection(parentElement
, section
);
1897 public DescriptionSourceSection
createDescriptionSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1898 DescriptionSourceSection section
= new DescriptionSourceSection(this, conversation
, parentElement
, style
);
1899 addAndAdaptSection(parentElement
, section
);
1903 public TypeDesignationSection
createTypeDesignationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1904 TypeDesignationSection section
= new TypeDesignationSection(this, conversation
, parentElement
, style
);
1905 addAndAdaptSection(parentElement
, section
);
1909 public StateDataSection
createStateDataSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1910 StateDataSection section
= new StateDataSection(this, conversation
, parentElement
, style
);
1911 addAndAdaptSection(parentElement
, section
);
1915 public StatisticalMeasurementValueSection
createStatisticalMeasurementValueSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1916 StatisticalMeasurementValueSection section
= new StatisticalMeasurementValueSection(this, conversation
, parentElement
, style
);
1917 addAndAdaptSection(parentElement
, section
);
1921 public DescribedSpecimenSection
createDescribedSpecimenSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1922 DescribedSpecimenSection section
= new DescribedSpecimenSection(this, conversation
, parentElement
, style
);
1923 addAndAdaptSection(parentElement
, section
);
1927 public CollectingAreasDetailSection
createCollectingAreasDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1928 CollectingAreasDetailSection section
= new CollectingAreasDetailSection(this, conversation
, parentElement
, style
);
1929 addAndAdaptSection(parentElement
, section
);
1933 public CurrentDeterminationDetailSection
createCurrentDeterminationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1934 CurrentDeterminationDetailSection section
= new CurrentDeterminationDetailSection(this, conversation
, parentElement
, style
);
1935 addAndAdaptSection(parentElement
, section
);
1939 public DeterminationHistoryDetailSection
createDeterminationHistoryDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1940 DeterminationHistoryDetailSection section
= new DeterminationHistoryDetailSection(this, conversation
, parentElement
, style
);
1941 addAndAdaptSection(parentElement
, section
);
1945 public SpecimenCollectionDetailSection
createSpecimenCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1946 SpecimenCollectionDetailSection section
= new SpecimenCollectionDetailSection(this, conversation
, parentElement
, style
);
1947 addAndAdaptSection(parentElement
, section
);
1951 public SourceCollectionDetailSection
createSourceCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1952 SourceCollectionDetailSection section
= new SourceCollectionDetailSection(this, conversation
, parentElement
, style
);
1953 addAndAdaptSection(parentElement
, section
);
1957 public GeographicalScopeDetailSection
createGeographicalScopeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1958 GeographicalScopeDetailSection section
= new GeographicalScopeDetailSection(this, conversation
, parentElement
, style
);
1959 addAndAdaptSection(parentElement
, section
);
1963 public ScopeRestrictionSection
createScopeRestrictionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1964 ScopeRestrictionSection section
= new ScopeRestrictionSection(this, conversation
, parentElement
, style
);
1965 addAndAdaptSection(parentElement
, section
);
1969 public MemberDetailSection
createMemberDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1970 MemberDetailSection section
= new MemberDetailSection(this, conversation
, parentElement
, style
);
1971 addAndAdaptSection(parentElement
, section
);
1975 public GrantedAuthorityDetailSection
createGrantedAuthorityDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1976 GrantedAuthorityDetailSection section
= new GrantedAuthorityDetailSection(this, conversation
, parentElement
, style
);
1977 addAndAdaptSection(parentElement
, section
);
1981 public GroupsByUserDetailSection
createGroupsByUserDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1982 GroupsByUserDetailSection section
= new GroupsByUserDetailSection(this, conversation
, parentElement
, style
);
1983 addAndAdaptSection(parentElement
, section
);
1987 public TaxonomicScopeSection
createTaxonomicScopeSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1988 TaxonomicScopeSection section
= new TaxonomicScopeSection(this, conversation
, parentElement
, style
);
1989 addAndAdaptSection(parentElement
, section
);
1995 * createEntityCollectionElement
1998 * @param removeListener
1999 * a {@link org.eclipse.swt.events.SelectionListener} object.
2002 * @param parentElement
2004 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
2006 * @param versionableEntity
2007 * a {@link eu.etaxonomy.cdm.model.common.IVersionableEntity}
2009 * @param backgroundColor
2010 * a {@link org.eclipse.swt.graphics.Color} object.
2012 * {@link eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement}
2015 public AbstractEntityCollectionElement
createEntityCollectionElement(AbstractFormSection parentElement
,
2016 Object versionableEntity
, SelectionListener removeListener
, Color backgroundColor
, int style
) {
2017 AbstractEntityCollectionElement element
= null;
2019 Object entity
= HibernateProxyHelper
.deproxy(versionableEntity
);
2021 if (entity
instanceof Annotation
) {
2022 element
= new AnnotationElement(this, parentElement
, (Annotation
) entity
, removeListener
, style
);
2023 } else if (entity
instanceof Person
) {
2024 element
= new TeamMemberElement(this, parentElement
, (Person
) entity
, removeListener
, style
);
2025 } else if (entity
instanceof Credit
) {
2026 element
= new CreditElement(this, parentElement
, (Credit
) entity
, removeListener
, style
);
2027 } else if (entity
instanceof Extension
) {
2028 element
= new ExtensionElement(this, parentElement
, (Extension
) entity
, removeListener
, style
);
2029 } else if (entity
instanceof Marker
) {
2030 element
= new MarkerElement(this, parentElement
, (Marker
) entity
, removeListener
, style
);
2031 } else if (entity
instanceof Media
) {
2032 element
= new MediaElement(this, parentElement
, (Media
) entity
, removeListener
, style
);
2033 } else if (entity
instanceof MediaRepresentation
) {
2034 element
= new MediaRepresentationElement(this, parentElement
, (MediaRepresentation
) entity
, removeListener
,
2036 } else if (entity
instanceof ImageFile
) {
2037 element
= new ImageFileElement(this, parentElement
, (ImageFile
) entity
, removeListener
, style
);
2038 } else if (entity
instanceof MediaRepresentationPart
) {
2039 element
= new MediaRepresentationPartElement(this, parentElement
, (MediaRepresentationPart
) entity
,
2040 removeListener
, style
);
2041 } else if (entity
instanceof NomenclaturalStatus
) {
2042 element
= new NomenclaturalStatusElement(this, parentElement
, (NomenclaturalStatus
) entity
, removeListener
,
2044 } else if (entity
instanceof Rights
) {
2045 element
= new RightsElement(this, parentElement
, (Rights
) entity
, removeListener
, style
);
2046 } else if (entity
instanceof DescriptionElementSource
) {
2047 element
= new DescriptionElementSourceElement(this, parentElement
, (DescriptionElementSource
) entity
,
2048 removeListener
, style
);
2049 } else if (entity
instanceof IdentifiableSource
) {
2050 element
= new IdentifiableSourceElement(this, parentElement
, (IdentifiableSource
) entity
, removeListener
,
2052 } else if (entity
instanceof Scope
) {
2053 element
= new ScopeElement(this, parentElement
, (Scope
) entity
, removeListener
, style
);
2054 } else if (entity
instanceof Modifier
) {
2055 element
= new ModifierElement(this, parentElement
, (Modifier
) entity
, removeListener
, style
);
2056 } else if (entity
instanceof Reference
) {
2057 element
= new DescriptionSourceElement(this, parentElement
, (Reference
) entity
, removeListener
, style
);
2058 } else if (entity
instanceof NameTypeDesignation
) {
2059 element
= new NameTypeDesignationElement(this, parentElement
, (NameTypeDesignation
) entity
, removeListener
,
2061 } else if (entity
instanceof NameRelationship
) {
2062 element
= new NameRelationshipDetailElement(this, parentElement
, (NameRelationship
) entity
, removeListener
,
2064 } else if (entity
instanceof SpecimenTypeDesignation
) {
2065 element
= new SpecimenTypeDesignationElement(this, parentElement
, (SpecimenTypeDesignation
) entity
,
2066 removeListener
, style
);
2067 } else if (entity
instanceof StateData
) {
2068 element
= new StateDataElement(this, parentElement
, (StateData
) entity
, removeListener
, style
);
2069 } else if (entity
instanceof StatisticalMeasurementValue
) {
2070 element
= new StatisticalMeasurementValueElement(this, parentElement
, (StatisticalMeasurementValue
) entity
,
2071 removeListener
, style
);
2072 } else if (entity
instanceof DerivedUnit
) {
2073 element
= new DerivedUnitElement(this, parentElement
, (DerivedUnit
) entity
, removeListener
, style
);
2074 } else if (entity
instanceof NamedArea
) {
2075 element
= new NamedAreaDetailElement(this, parentElement
, (NamedArea
) entity
, removeListener
, style
);
2076 } else if (entity
instanceof DeterminationEvent
) {
2077 element
= new DeterminationEventDetailElement(this, parentElement
, (DeterminationEvent
) entity
,
2078 removeListener
, style
);
2079 } else if (entity
instanceof Specimen
) {
2080 element
= new SpecimenCollectionDetailElement(this, parentElement
, (Specimen
) entity
, removeListener
, style
);
2081 } else if (entity
instanceof User
) {
2082 element
= new MemberDetailElement(this, parentElement
, (User
) entity
, removeListener
, style
);
2083 } else if (entity
instanceof GrantedAuthority
) {
2084 element
= new GrantedAuthorityCollectionElement(this, parentElement
, (GrantedAuthorityImpl
) entity
,
2085 removeListener
, style
);
2086 } else if (entity
instanceof Group
) {
2087 element
= new GroupsByUserDetailElement(this, parentElement
, (Group
) entity
, removeListener
, style
);
2088 } else if (entity
instanceof Taxon
) {
2089 element
= new TaxonDetailElement(this, parentElement
, (Taxon
) entity
, removeListener
, style
);
2090 } else if (entity
instanceof DescriptionElementBase
) {
2091 // this is the special case for protologs, maybe we can do this
2092 // differently when API improves
2093 DescriptionElementBase descriptionElement
= (DescriptionElementBase
) entity
;
2094 if (descriptionElement
.getFeature().equals(Feature
.PROTOLOGUE())) {
2095 element
= new ProtologueElement(this, parentElement
, descriptionElement
, removeListener
, style
);
2099 if (element
== null) {
2100 AbstractUtility
.errorDialog("No element for entity", this,
2101 "Could not generate element for entity. Looks like the case is not handled already. Check implementation. Entity: "
2105 else if (backgroundColor
!= null && !backgroundColor
.isDisposed()) {
2106 element
.setPersistentBackground(backgroundColor
);
2110 parentElement
.addElement(element
);
2116 * Creates a selection element for the given type T.
2119 * <strong>Selection elements not handled by this method:</strong>
2121 * <li>{@link TaxonNodeSelectionElement} see
2122 * {@link #createTaxonNodeSelectionElement(ConversationHolder, ICdmFormElement, String, TaxonNode, int, int)}
2124 * <li>{@link NomenclaturalAuthorTeamSelectionElement} see
2125 * {@link #createNomenclaturalAuthorTeamSelectionElement(ConversationHolder, ICdmFormElement, String, Team, int, int)}
2131 * a {@link Class} object of the type that you want the selection
2133 * @param parentElement
2134 * a {@link ICdmFormElement} object.
2135 * @param labelString
2136 * a {@link String} object.
2137 * @param selectionType
2139 * a {@link ICdmBase} object.
2142 * @param conversation
2143 * a {@link ConversationHolder} object.
2144 * @return a {@link EntitySelectionElement} object.
2146 public <T
extends ICdmBase
> EntitySelectionElement
<T
> createSelectionElement(Class
<T
> clazz
,
2147 ConversationHolder conversation
, ICdmFormElement parentElement
, String labelString
, T selection
, int mode
,
2149 EntitySelectionElement
<T
> element
= new EntitySelectionElement
<T
>(this, conversation
, parentElement
, clazz
,
2150 labelString
, selection
, mode
, style
);
2152 parentElement
.addElement(element
);
2156 public TaxonNodeSelectionElement
createTaxonNodeSelectionElement(ConversationHolder conversation
,
2157 ICdmFormElement parentElement
, String labelString
, TaxonNode selection
, int mode
, int style
) {
2158 TaxonNodeSelectionElement element
= new TaxonNodeSelectionElement(this, conversation
, parentElement
,
2159 labelString
, selection
, mode
, style
);
2161 parentElement
.addElement(element
);
2165 public NomenclaturalAuthorTeamSelectionElement
createNomenclaturalAuthorTeamSelectionElement(
2166 ConversationHolder conversation
, ICdmFormElement parentElement
, String labelString
, Team selection
,
2167 int mode
, int style
) {
2168 NomenclaturalAuthorTeamSelectionElement element
= new NomenclaturalAuthorTeamSelectionElement(this,
2169 conversation
, parentElement
, labelString
, selection
, mode
, style
);
2171 parentElement
.addElement(element
);
2175 /** {@inheritDoc} */
2176 public LabelElement
createLabel(ICdmFormElement parentElement
, String text
) {
2177 LabelElement labelElement
= new LabelElement(this, parentElement
, text
);
2178 adapt(labelElement
);
2179 parentElement
.addElement(labelElement
);
2180 return labelElement
;
2185 * Getter for the field <code>selectionProvider</code>.
2188 * @return a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
2190 public ISelectionProvider
getSelectionProvider() {
2191 return selectionProvider
;
2196 * createDetailedDescriptionDetailElement
2199 * @param parentElement
2200 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
2204 * {@link eu.etaxonomy.cdm.model.description.DescriptionElementBase}
2209 * {@link eu.etaxonomy.taxeditor.ui.section.description.detail.AbstractDetailedDescriptionDetailElement}
2212 public AbstractDetailedDescriptionDetailElement
createDetailedDescriptionDetailElement(
2213 ICdmFormElement parentElement
, DescriptionElementBase entity
, int style
) {
2214 AbstractDetailedDescriptionDetailElement detailedDescriptionElement
= null;
2216 if (entity
instanceof CategoricalData
) {
2217 detailedDescriptionElement
= new CategoricalDataDetailElement(this, parentElement
,
2218 (CategoricalData
) entity
, style
);
2219 } else if (entity
instanceof CommonTaxonName
) {
2220 detailedDescriptionElement
= new CommonNameDetailElement(this, parentElement
, (CommonTaxonName
) entity
,
2222 } else if (entity
instanceof Distribution
) {
2223 detailedDescriptionElement
= new DistributionDetailElement(this, parentElement
, (Distribution
) entity
,
2225 } else if (entity
instanceof IndividualsAssociation
) {
2226 detailedDescriptionElement
= new IndividualsAssociationDetailElement(this, parentElement
,
2227 (IndividualsAssociation
) entity
, style
);
2228 } else if (entity
instanceof QuantitativeData
) {
2229 detailedDescriptionElement
= new QuantitativeDataDetailElement(this, parentElement
,
2230 (QuantitativeData
) entity
, style
);
2231 } else if (entity
instanceof TaxonInteraction
) {
2232 detailedDescriptionElement
= new TaxonInteractionDetailElement(this, parentElement
,
2233 (TaxonInteraction
) entity
, style
);
2234 } else if (entity
instanceof TextData
) {
2235 detailedDescriptionElement
= new TextDataDetailElement(this, parentElement
, (TextData
) entity
, style
);
2237 throw new IllegalStateException("There is no interface for the given description element");
2239 adapt(detailedDescriptionElement
);
2240 parentElement
.addElement(detailedDescriptionElement
);
2241 return detailedDescriptionElement
;
2246 * Creates a styled text as a part of the form.
2251 * the text initial value
2254 * @return the text widget
2256 public StyledText
createStyledText(Composite parent
, String value
, int style
) {
2257 StyledText text
= new StyledText(parent
, getBorderStyle() | style
| getOrientation());
2258 if (value
!= null) {
2259 text
.setText(value
);
2261 text
.setForeground(getColors().getForeground());
2262 text
.setBackground(getColors().getBackground());
2263 // text.addFocusListener(visibilityHandler);