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
.campanula
.GatheringEventDetailsElement
;
117 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.ClassificationDetailElement
;
118 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.ClassificationDetailSection
;
119 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.TaxonNodeDetailElement
;
120 import eu
.etaxonomy
.taxeditor
.ui
.section
.classification
.TaxonNodeDetailSection
;
121 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferenceEntityDetailElement
;
122 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferencedEntityDetailSection
;
123 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DerivedUnitElement
;
124 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescribedSpecimenSection
;
125 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailElement
;
126 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailSection
;
127 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailElement
;
128 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailSection
;
129 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementMediaSection
;
130 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceElement
;
131 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceSection
;
132 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceElement
;
133 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceSection
;
134 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.MediaDetailsSection
;
135 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ModifierElement
;
136 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ModifierSection
;
137 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageDetailElement
;
138 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageSection
;
139 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeElement
;
140 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeSection
;
141 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StateDataElement
;
142 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StateDataSection
;
143 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StatisticalMeasurementValueElement
;
144 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.StatisticalMeasurementValueSection
;
145 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.AbstractDetailedDescriptionDetailElement
;
146 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.CategoricalDataDetailElement
;
147 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.CommonNameDetailElement
;
148 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.DistributionDetailElement
;
149 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.IndividualsAssociationDetailElement
;
150 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.QuantitativeDataDetailElement
;
151 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.TaxonInteractionDetailElement
;
152 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.TextDataDetailElement
;
153 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailElement
;
154 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailSection
;
155 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityCollectionElement
;
156 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailElement
;
157 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailSection
;
158 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailElement
;
159 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailSection
;
160 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailElement
;
161 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailSection
;
162 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.GeographicalScopeDetailSection
;
163 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailElement
;
164 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailSection
;
165 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailElement
;
166 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailSection
;
167 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.ScopeRestrictionSection
;
168 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.TaxonomicScopeSection
;
169 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.ImageFileElement
;
170 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaElement
;
171 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationElement
;
172 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationPartElement
;
173 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationPartSection
;
174 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaRepresentationSection
;
175 import eu
.etaxonomy
.taxeditor
.ui
.section
.media
.MediaSection
;
176 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.AuthorshipDetailElement
;
177 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.AuthorshipDetailSection
;
178 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.HybridDetailElement
;
179 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.HybridDetailSection
;
180 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameDetailElement
;
181 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameDetailSection
;
182 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailElement
;
183 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailSection
;
184 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameTypeDesignationElement
;
185 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusElement
;
186 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusSection
;
187 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailElement
;
188 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailSection
;
189 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.ProtologueElement
;
190 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.ProtologueSection
;
191 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.SpecimenTypeDesignationElement
;
192 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.TypeDesignationSection
;
193 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CollectingAreasDetailSection
;
194 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CollectionDetailElement
;
195 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.CurrentDeterminationDetailSection
;
196 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitBaseDetailElement
;
197 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitBaseDetailSection
;
198 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitFacadeDetailElement
;
199 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitFacadeDetailSection
;
200 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailElement
;
201 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailSection
;
202 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationEventDetailElement
;
203 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationEventDetailElementComposite
;
204 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationHistoryDetailSection
;
205 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldObservationDetailElement
;
206 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldObservationDetailSection
;
207 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailElement
;
208 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailElementComposite
;
209 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailSection
;
210 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GeneralDetailElement
;
211 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GeneralDetailSection
;
212 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.NamedAreaDetailElement
;
213 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SourceCollectionDetailSection
;
214 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SpecimenCollectionDetailElement
;
215 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.SpecimenCollectionDetailSection
;
216 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailElement
;
217 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailSection
;
218 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailElement
;
219 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailSection
;
220 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.AnnotationElement
;
221 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.AnnotationSection
;
222 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CdmBaseElement
;
223 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CdmBaseSection
;
224 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CreditElement
;
225 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.CreditSection
;
226 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.ExtensionElement
;
227 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.ExtensionSection
;
228 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.HeadlineSection
;
229 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.IdentifiableSourceElement
;
230 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.MarkerElement
;
231 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.MarkerSection
;
232 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.RightsElement
;
233 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.RightsSection
;
234 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.SourceSection
;
235 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.VersionElement
;
236 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.VersionSection
;
237 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessageElement
;
238 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessagesSection
;
239 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailElement
;
240 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailSection
;
241 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonDetailElement
;
242 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailElement
;
243 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailSection
;
244 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailElement
;
245 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailSection
;
246 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailElement
;
247 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailSection
;
248 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailElement
;
249 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailSection
;
250 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.DefinedTermDetailElement
;
251 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.DefinedTermDetailSection
;
252 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailSection
;
253 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailElement
;
254 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailSection
;
255 import eu
.etaxonomy
.taxeditor
.ui
.selection
.EntitySelectionElement
;
256 import eu
.etaxonomy
.taxeditor
.ui
.selection
.NomenclaturalAuthorTeamSelectionElement
;
257 import eu
.etaxonomy
.taxeditor
.ui
.selection
.TaxonNodeSelectionElement
;
261 * CdmFormFactory class.
265 * @created Feb 24, 2010
268 public class CdmFormFactory
extends FormToolkit
{
270 private BoldFontHolder2 boldFontHolder2
;
271 private MouseListener selectionMouseHandler
;
272 private FocusListener selectionFocusHandler
;
274 private final Set
<SelectionListener
> selectionListenerList
= new HashSet
<SelectionListener
>();
276 private final List
<IPropertyChangeListener
> propertyChangeListeners
= new ArrayList
<IPropertyChangeListener
>();
278 private final int orientation
= Window
.getDefaultOrientation();
279 private ISelectionProvider selectionProvider
;
281 /** Constant <code>EMPTY_SELECTION</code> */
282 public static ISelection EMPTY_SELECTION
= new ISelection() {
284 public boolean isEmpty() {
295 private class SelectionMouseHandler
extends MouseAdapter
{
297 public void mouseDown(MouseEvent e
) {
298 notifySelectionListeners(e
);
308 private class SelectionFocusHandler
extends FocusAdapter
{
310 public void focusGained(FocusEvent e
) {
311 notifySelectionListeners(e
);
315 private void notifySelectionListeners(TypedEvent e
) {
316 Event event
= new Event();
317 event
.widget
= e
.widget
;
318 SelectionEvent selectionEvent
= new SelectionEvent(event
);
320 for (SelectionListener listener
: selectionListenerList
) {
321 listener
.widgetSelected(selectionEvent
);
327 * Constructor for CdmFormFactory.
331 * a {@link org.eclipse.swt.widgets.Display} object.
332 * @param selectionProvider
333 * a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
335 public CdmFormFactory(Display display
, ISelectionProvider selectionProvider
) {
337 this.selectionProvider
= selectionProvider
;
343 * Constructor for CdmFormFactory.
347 * a {@link org.eclipse.swt.widgets.Display} object.
349 public CdmFormFactory(Display display
) {
357 private void init() {
358 boldFontHolder2
= new BoldFontHolder2();
359 selectionMouseHandler
= new SelectionMouseHandler();
360 selectionFocusHandler
= new SelectionFocusHandler();
364 * Creates an instance initialized with the correct selectionProvider
366 * Make sure to remove the instance when the entityComposite disposes via
367 * destroySelectionArbitrator(..)
369 * @param entityElement
370 * a {@link eu.etaxonomy.taxeditor.ui.element.IEntityElement}
372 * @return a {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator}
375 public SelectionArbitrator
createSelectionArbitrator(IEntityElement entityElement
) {
376 SelectionArbitrator selectionArbitrator
= new SelectionArbitrator(entityElement
);
377 selectionArbitrator
.addSelectionProvider(selectionProvider
);
378 selectionProvider
.addSelectionChangedListener(selectionArbitrator
);
379 addSelectionListener(selectionArbitrator
);
380 return selectionArbitrator
;
385 * destroySelectionArbitrator
388 * @param selectionArbitrator
390 * {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator}
393 public void destroySelectionArbitrator(SelectionArbitrator selectionArbitrator
) {
394 removeSelectionListener(selectionArbitrator
);
395 if (selectionProvider
!= null) {
396 selectionProvider
.removeSelectionChangedListener(selectionArbitrator
);
398 AbstractUtility
.error(this.getClass(),
399 "Tried to destroy a selection listener from this factories listeners but was null", null);
405 * Adapts the {@link AbstractCdmFormElement}:<br>
406 * - sets the {@link IPropertyChangeListener}s handled by this class
411 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement}
414 public void adapt(AbstractCdmFormElement formElement
) {
415 formElement
.setPropertyChangeListeners(propertyChangeListeners
);
418 public void adapt(AbstractCdmFormElementComposite formElement
) {
419 formElement
.setPropertyChangeListeners(propertyChangeListeners
);
426 public void adapt(Control control
, boolean trackFocus
, boolean trackKeyboard
) {
428 control
.addFocusListener(selectionFocusHandler
);
430 super.adapt(control
, trackFocus
, trackKeyboard
);
435 public void adapt(Composite composite
) {
436 composite
.addMouseListener(selectionMouseHandler
);
437 super.adapt(composite
);
446 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
449 public void destroyElement(ICdmFormElement formElement
) {
450 // return if element was not initialized
451 if (formElement
== null) {
454 // destroy selection arbitrator, if any
455 if (formElement
instanceof ISelectableElement
) {
456 destroySelectionArbitrator(((ISelectableElement
) formElement
).getSelectionArbitrator());
458 // remove this element form its parents list of elements
459 // ICdmFormElement parentElement = formElement.getParentElement();
460 // if(parentElement != null){
461 // parentElement.removeElement(formElement);
463 // call destroy on child elements recursively
464 for (ICdmFormElement childElement
: formElement
.getElements()) {
465 destroyElement(childElement
);
467 // dispose of the controls
468 for (Control control
: formElement
.getControls()) {
469 // we added the layoutComposite of the parental element as the
470 // layout composite to this formElement
471 // but we do not want to destroy it.
472 if (control
.equals(formElement
.getLayoutComposite())) {
487 * a {@link org.eclipse.swt.widgets.Composite} object.
488 * @return a {@link org.eclipse.swt.widgets.Label} object.
490 public Label
createEmptyCell(Composite parent
) {
491 return this.createLabel(parent
, null);
496 * createMultilineTextWithLabel
500 * a {@link java.lang.String} object.
505 * @param parentElement
506 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
508 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
511 public TextWithLabelElement
createMultilineTextWithLabel(ICdmFormElement parentElement
, String labelString
,
512 int textHeight
, int style
) {
513 TextWithLabelElement element
= new TextWithLabelElement(this, parentElement
, labelString
, "", textHeight
, style
);
515 parentElement
.addElement(element
);
521 * createMultiLanguageTextElement
524 * @param parentElement
525 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
528 * a {@link java.lang.String} object.
529 * @param multilanguageText
530 * a {@link java.util.Map} object.
536 * {@link eu.etaxonomy.taxeditor.ui.element.MultilanguageTextElement}
539 public MultilanguageTextElement
createMultiLanguageTextElement(ICdmFormElement parentElement
, String labelString
,
540 Map
<Language
, LanguageString
> multilanguageText
, int textHeight
, int style
) {
541 MultilanguageTextElement element
= new MultilanguageTextElement(this, parentElement
, labelString
,
542 multilanguageText
, textHeight
, style
);
544 parentElement
.addElement(element
);
548 public KeyStatementElement
createKeyStatementElement(ICdmFormElement parentElement
, String labelString
,
549 KeyStatement keyStatement
, int textHeight
, int style
) {
550 KeyStatementElement element
= new KeyStatementElement(this, parentElement
, labelString
, keyStatement
,
553 parentElement
.addElement(element
);
559 * createTextWithLabelElement
563 * a {@link java.lang.String} object.
565 * a {@link java.lang.String} object.
568 * @param parentElement
569 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
571 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
574 public TextWithLabelElement
createTextWithLabelElement(ICdmFormElement parentElement
, String labelString
,
575 String initialText
, int style
) {
576 TextWithLabelElement element
= new TextWithLabelElement(this, parentElement
, labelString
, initialText
, null,
579 parentElement
.addElement(element
);
583 public UriWithLabelElement
createUriWithLabelElement(ICdmFormElement parentElement
, String labelString
,
584 URI initialUri
, int style
) {
585 UriWithLabelElement element
= new UriWithLabelElement(this, parentElement
, labelString
, initialUri
, null, style
);
587 parentElement
.addElement(element
);
598 public OpenUrlSelectorElement
createOpenUrlSelectorElement(ICdmFormElement parentElement
, String labelString
,
599 IOpenUrlEnabled openUrlEnabled
, int style
) {
600 OpenUrlSelectorElement element
= new OpenUrlSelectorElement(this, parentElement
, labelString
, openUrlEnabled
,
603 parentElement
.addElement(element
);
609 * @param parentElement
611 * @param conversationEnabled
616 public EditPasswordElement
createEditPasswordElement(ICdmFormElement parentElement
, String labelString
,
617 ConversationHolder conversation
, User user
, int style
) {
618 EditPasswordElement element
= new EditPasswordElement(this, parentElement
, labelString
, user
, conversation
);
620 parentElement
.addElement(element
);
626 * createIntegerTextWithLabelElement
629 * @param parentElement
630 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
633 * a {@link java.lang.String} object.
634 * @param initialInteger
635 * a {@link java.lang.Integer} object.
639 * {@link eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement}
642 public NumberWithLabelElement
createIntegerTextWithLabelElement(ICdmFormElement parentElement
, String labelString
,
643 Integer initialInteger
, int style
) {
644 NumberWithLabelElement element
= new NumberWithLabelElement(this, parentElement
, labelString
, initialInteger
,
647 parentElement
.addElement(element
);
653 * createFloatTextWithLabelElement
656 * @param parentElement
657 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
660 * a {@link java.lang.String} object.
661 * @param initialFloat
666 * {@link eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement}
669 public NumberWithLabelElement
createFloatTextWithLabelElement(ICdmFormElement parentElement
, String labelString
,
670 float initialFloat
, int style
) {
671 NumberWithLabelElement element
= new NumberWithLabelElement(this, parentElement
, labelString
, initialFloat
,
674 parentElement
.addElement(element
);
680 * createLanguageStringWithLabelElement
683 * @param parentElement
684 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
687 * a {@link java.lang.String} object.
688 * @param languageString
689 * a {@link eu.etaxonomy.cdm.model.common.LanguageString} object.
693 * {@link eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement}
696 public LanguageStringWithLabelElement
createLanguageStringWithLabelElement(ICdmFormElement parentElement
,
697 String labelString
, LanguageString languageString
, int style
) {
698 LanguageStringWithLabelElement element
= new LanguageStringWithLabelElement(this, parentElement
, labelString
,
699 languageString
, style
);
701 parentElement
.addElement(element
);
707 * createLanguageStringWithLabelElement
710 * @param parentElement
711 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
714 * a {@link java.lang.String} object.
715 * @param languageString
716 * a {@link eu.etaxonomy.cdm.model.common.LanguageString} object.
722 * {@link eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement}
725 public LanguageStringWithLabelElement
createLanguageStringWithLabelElement(ICdmFormElement parentElement
,
726 String labelString
, LanguageString languageString
, int height
, int style
) {
727 LanguageStringWithLabelElement element
= new LanguageStringWithLabelElement(this, parentElement
, labelString
,
728 languageString
, height
, style
);
730 parentElement
.addElement(element
);
739 * @param parentElement
740 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
743 * a {@link java.lang.String} object.
746 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
749 public TextWithLabelElement
createTextElement(ICdmFormElement parentElement
, String initialText
, int style
) {
750 TextWithLabelElement element
= new TextWithLabelElement(this, parentElement
, null, initialText
, null, style
);
752 parentElement
.addElement(element
);
758 * createKeyValueViewerElement
761 * @param parentElement
762 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
765 * a {@link java.lang.String} object.
766 * @param valueHeading
767 * a {@link java.lang.String} object.
769 * a {@link java.util.Map} object.
770 * @return a {@link eu.etaxonomy.taxeditor.ui.element.KeyValueViewerElement}
773 public KeyValueViewerElement
createKeyValueViewerElement(ICdmFormElement parentElement
, String keyHeading
,
774 String valueHeading
, Map
<Object
, Object
> map
) {
775 KeyValueViewerElement element
= new KeyValueViewerElement(this, parentElement
, keyHeading
, valueHeading
, map
);
777 parentElement
.addElement(element
);
783 * createTermComboElement
786 * @param termComboType
788 * {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.TermComboType}
790 * @param parentElement
791 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
794 * a {@link java.lang.String} object.
796 * a {@link eu.etaxonomy.cdm.model.common.DefinedTermBase}
800 * @return a {@link eu.etaxonomy.taxeditor.ui.combo.TermComboElement}
804 public <T
extends DefinedTermBase
> TermComboElement
<T
> createTermComboElement(Class
<T
> termComboType
,
805 ICdmFormElement parentElement
, String labelString
, T selection
, int style
) {
806 TermComboElement
<T
> element
= new TermComboElement
<T
>(this, parentElement
, termComboType
, labelString
,
809 parentElement
.addElement(element
);
815 * createEnumComboElement
818 * @param enumComboType
820 * {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EnumComboType}
822 * @param parentElement
823 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
827 * @return a {@link eu.etaxonomy.taxeditor.ui.term.AbstractEnumComboElement}
830 public <T
extends IDefinedTerm
> EnumComboElement
<T
> createEnumComboElement(Class
<T
> enumComboType
,
831 ICdmFormElement parentElement
, int style
) {
832 EnumComboElement
<T
> element
= new EnumComboElement
<T
>(this, parentElement
, enumComboType
, style
);
834 parentElement
.addElement(element
);
840 * createBrowserElement
844 * a {@link java.net.URI} object.
847 * @param parentElement
848 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
850 * @return a {@link eu.etaxonomy.taxeditor.ui.element.BrowserElement}
853 public BrowserElement
createBrowserElement(ICdmFormElement parentElement
, URI imageUri
, int style
) {
854 BrowserElement element
= new BrowserElement(this, parentElement
, imageUri
, style
);
856 parentElement
.addElement(element
);
865 * @param parentElement
866 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
869 * a {@link java.net.URI} object.
872 * @return a {@link eu.etaxonomy.taxeditor.ui.element.ImageElement} object.
874 public ImageElement
createImageElement(ICdmFormElement parentElement
, URI imageUri
, int style
) {
875 ImageElement element
= new ImageElement(this, parentElement
, imageUri
, style
);
877 parentElement
.addElement(element
);
883 * createTextActionElement
887 * a {@link java.lang.String} object.
889 * a {@link java.lang.String} object.
892 * @param parentElement
893 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
896 * a {@link java.lang.String} object.
897 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextActionElement}
900 public TextActionElement
createTextActionElement(ICdmFormElement parentElement
, String labelString
,
901 String buttonLabel
, String initialText
, int style
) {
902 TextActionElement element
= new TextActionElement(this, parentElement
, labelString
, buttonLabel
, initialText
,
905 parentElement
.addElement(element
);
914 * @param parentElement
915 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
918 * a {@link java.lang.String} object.
919 * @param initialState
923 * @return a {@link eu.etaxonomy.taxeditor.ui.element.CheckboxElement}
926 public CheckboxElement
createCheckbox(ICdmFormElement parentElement
, String label
, boolean initialState
, int style
) {
927 CheckboxElement element
= new CheckboxElement(this, parentElement
, label
, initialState
, style
| orientation
);
929 parentElement
.addElement(element
);
934 * Creates a section as a part of the form.
936 * @return the section widget
939 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
942 public Section
adapt(AbstractFormSection section
) {
943 section
.setMenu(section
.getLayoutComposite().getMenu());
944 adapt(section
, true, true);
946 // handle focus and property change events for cdm use
947 section
.addFocusListener(selectionFocusHandler
);
948 section
.setPropertyChangeListeners(propertyChangeListeners
);
950 if (section
.getToggle() != null) {
951 section
.getToggle().setHoverDecorationColor(getColors().getColor(IFormColors
.TB_TOGGLE_HOVER
));
952 section
.getToggle().setDecorationColor(getColors().getColor(IFormColors
.TB_TOGGLE
));
955 section
.setFont(boldFontHolder2
.getBoldFont(section
.getLayoutComposite().getFont()));
957 if ((section
.getStyle() & ExpandableComposite
.TITLE_BAR
) != 0
958 || (section
.getStyle() & ExpandableComposite
.SHORT_TITLE_BAR
) != 0) {
959 getColors().initializeSectionToolBarColors();
960 section
.setTitleBarBackground(getColors().getColor(IFormColors
.TB_BG
));
961 section
.setTitleBarBorderColor(getColors().getColor(IFormColors
.TB_BORDER
));
963 // call setTitleBarForeground regardless as it also sets the label color
964 section
.setTitleBarForeground(getColors().getColor(IFormColors
.TB_TOGGLE
));
968 private class BoldFontHolder2
{
969 private Font normalFont
;
971 private Font boldFont
;
973 public BoldFontHolder2() {
976 public Font
getBoldFont(Font font
) {
977 createBoldFont(font
);
981 private void createBoldFont(Font font
) {
982 if (normalFont
== null || !normalFont
.equals(font
)) {
986 if (boldFont
== null) {
987 boldFont
= FormFonts
.getInstance().getBoldFont(getColors().getDisplay(), normalFont
);
991 public void dispose() {
992 if (boldFont
!= null) {
993 FormFonts
.getInstance().markFinished(boldFont
, getColors().getDisplay());
1001 * createToggleableTextField
1004 * @param parentElement
1005 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1007 * @param labelString
1008 * a {@link java.lang.String} object.
1009 * @param initialText
1010 * a {@link java.lang.String} object.
1011 * @param initialState
1015 * @return a {@link eu.etaxonomy.taxeditor.ui.element.ToggleableTextElement}
1018 public ToggleableTextElement
createToggleableTextField(ICdmFormElement parentElement
, String labelString
,
1019 String initialText
, boolean initialState
, int style
) {
1020 ToggleableTextElement element
= new ToggleableTextElement(this, parentElement
, labelString
, initialText
,
1021 initialState
, style
| orientation
);
1023 parentElement
.addElement(element
);
1029 * createTimePeriodElement
1032 * @param parentElement
1033 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1035 * @param labelString
1036 * a {@link java.lang.String} object.
1038 * a {@link eu.etaxonomy.cdm.model.common.TimePeriod} object.
1041 * @return a {@link eu.etaxonomy.taxeditor.ui.element.TimePeriodElement}
1044 public TimePeriodElement
createTimePeriodElement(ICdmFormElement parentElement
, String labelString
,
1045 TimePeriod timePeriod
, int style
) {
1046 TimePeriodElement element
= new TimePeriodElement(this, parentElement
, labelString
, timePeriod
, style
);
1048 parentElement
.addElement(element
);
1054 * createPointElement
1059 * @param parentElement
1060 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1063 * a {@link eu.etaxonomy.cdm.model.location.Point} object.
1064 * @return a {@link eu.etaxonomy.taxeditor.ui.element.PointElement} object.
1066 public PointElement
createPointElement(ICdmFormElement parentElement
, Point point
, int style
) {
1067 PointElement element
= new PointElement(this, parentElement
, point
, style
);
1069 parentElement
.addElement(element
);
1075 * createDateDetailSection
1078 * @param parentElement
1079 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1083 * @return a {@link eu.etaxonomy.taxeditor.ui.element.DateDetailSection}
1086 public DateDetailSection
createDateDetailSection(ICdmFormElement parentElement
, int style
) {
1087 DateDetailSection section
= new DateDetailSection(this, parentElement
, style
);
1088 parentElement
.addElement(section
);
1095 * createPartialElement
1098 * @param parentElement
1099 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1101 * @param labelString
1102 * a {@link java.lang.String} object.
1104 * a {@link org.joda.time.Partial} object.
1107 * @return a {@link eu.etaxonomy.taxeditor.ui.element.PartialElement}
1110 public PartialElement
createPartialElement(ICdmFormElement parentElement
, String labelString
, Partial partial
,
1112 PartialElement element
= new PartialElement(this, parentElement
, labelString
, style
);
1114 parentElement
.addElement(element
);
1120 * addSelectionListener
1124 * a {@link org.eclipse.swt.events.SelectionListener} object.
1126 public void addSelectionListener(SelectionListener listener
) {
1127 selectionListenerList
.add(listener
);
1132 * removeSelectionListener
1136 * a {@link org.eclipse.swt.events.SelectionListener} object.
1138 public void removeSelectionListener(SelectionListener listener
) {
1139 if (listener
== null) {
1140 AbstractUtility
.error(this.getClass(),
1141 "Tried to remove a selection listener from this factories listeners but was null", null);
1143 selectionListenerList
.remove(listener
);
1149 * addPropertyChangeListener
1153 * a {@link org.eclipse.jface.util.IPropertyChangeListener}
1156 public void addPropertyChangeListener(IPropertyChangeListener listener
) {
1157 if (propertyChangeListeners
.contains(listener
)) {
1160 propertyChangeListeners
.add(0, listener
);
1165 * removePropertyChangeListener
1169 * a {@link org.eclipse.jface.util.IPropertyChangeListener}
1172 public void removePropertyChangeListener(IPropertyChangeListener listener
) {
1173 propertyChangeListeners
.remove(listener
);
1177 * @return the propertyChangeListeners
1179 public List
<IPropertyChangeListener
> getPropertyChangeListeners() {
1180 return propertyChangeListeners
;
1185 * createHorizontalSeparator
1188 * @param parentElement
1189 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1193 * @return a {@link org.eclipse.swt.widgets.Label} object.
1195 public Label
createHorizontalSeparator(ICdmFormElement parentElement
, int style
) {
1196 Label separator
= this.createSeparator(parentElement
.getLayoutComposite(), SWT
.HORIZONTAL
| style
);
1197 separator
.setLayoutData(LayoutConstants
.FILL_HORIZONTALLY());
1203 * createVersionElement
1206 * @param parentElement
1207 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1210 * a {@link eu.etaxonomy.cdm.model.common.VersionableEntity}
1215 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.VersionElement}
1218 public VersionElement
createVersionElement(ICdmFormElement parentElement
, VersionableEntity entity
, int style
) {
1219 VersionElement element
= new VersionElement(this, parentElement
, entity
, style
);
1221 parentElement
.addElement(element
);
1226 * @param cdmBaseSection
1231 public CdmBaseElement
createCdmBaseElement(ICdmFormElement parentElement
, CdmBase entity
, int style
) {
1232 CdmBaseElement element
= new CdmBaseElement(this, parentElement
, entity
, style
);
1234 parentElement
.addElement(element
);
1240 * createVersionSection
1243 * @param parentElement
1244 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1249 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.VersionSection}
1252 public VersionSection
createVersionSection(ICdmFormElement parentElement
, int style
) {
1253 VersionSection section
= new VersionSection(this, parentElement
, style
);
1254 parentElement
.addElement(section
);
1264 public CdmBaseSection
createCdmBaseSection(ICdmFormElement parentElement
, int style
) {
1265 CdmBaseSection section
= new CdmBaseSection(this, parentElement
, style
);
1266 parentElement
.addElement(section
);
1273 * createEmptyElement
1276 * @param parentElement
1277 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1279 * @return a {@link eu.etaxonomy.taxeditor.ui.section.EmptyElement} object.
1281 public EmptyElement
createEmptyElement(ICdmFormElement parentElement
) {
1282 EmptyElement element
= new EmptyElement(this, parentElement
, null, SWT
.NULL
);
1284 parentElement
.addElement(element
);
1290 * createHeadlineSection
1293 * @param parentElement
1294 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1297 * {@link eu.etaxonomy.taxeditor.ui.section.supplemental.HeadlineSection}
1300 public HeadlineSection
createHeadlineSection(ICdmFormElement parentElement
) {
1301 HeadlineSection section
= new HeadlineSection(this, parentElement
, SWT
.NULL
);
1302 parentElement
.addElement(section
);
1309 * createParsingMessageElement
1312 * @param parentElement
1313 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
1315 * @param parserProblem
1316 * a {@link eu.etaxonomy.cdm.strategy.parser.ParserProblem}
1321 * {@link eu.etaxonomy.taxeditor.ui.section.taxon.ParsingMessageElement}
1324 public ParsingMessageElement
createParsingMessageElement(ICdmFormElement parentElement
,
1325 ParserProblem parserProblem
, int style
) {
1326 ParsingMessageElement element
= new ParsingMessageElement(this, parentElement
, parserProblem
, style
);
1328 parentElement
.addElement(element
);
1332 public AbstractFormSection
createDefinedTermDetailSection(Class definedTermClass
, ConversationHolder conversation
,
1333 ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
1335 AbstractFormSection section
= new DefinedTermDetailSection(this, definedTermClass
, conversation
, parentElement
,
1336 selectionProvider
, style
);
1338 parentElement
.addElement(section
);
1345 * @param definedTermClass
1346 * @param formElement
1350 public AbstractCdmDetailElement
createDefinedTermDetailElement(Class definedTermClass
, AbstractCdmDetailSection parentElement
, int style
) {
1351 AbstractCdmDetailElement element
= null;
1353 if (NamedArea
.class.isAssignableFrom(definedTermClass
)) {
1354 element
= new eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement(this, parentElement
);
1356 element
= new DefinedTermDetailElement(this, parentElement
);
1360 parentElement
.addElement(element
);
1365 //--------DetailSections---------
1366 public NameDetailSection
createNameDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1367 NameDetailSection section
= new NameDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1368 addAndAdaptSection(parentElement
, section
);
1372 public ReferenceDetailSection
createReferenceDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1373 ReferenceDetailSection section
= new ReferenceDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1374 addAndAdaptSection(parentElement
, section
);
1378 public NomenclaturalReferenceDetailSection
createNomenclaturalReferenceDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1379 NomenclaturalReferenceDetailSection section
= new NomenclaturalReferenceDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1380 addAndAdaptSection(parentElement
, section
);
1384 public TaxonBaseDetailSection
createTaxonBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1385 TaxonBaseDetailSection section
= new TaxonBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1386 addAndAdaptSection(parentElement
, section
);
1390 public AuthorshipDetailSection
createAuthorshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1391 AuthorshipDetailSection section
= new AuthorshipDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1392 addAndAdaptSection(parentElement
, section
);
1396 public TeamOrPersonBaseDetailSection
createTeamOrPersonBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1397 TeamOrPersonBaseDetailSection section
= new TeamOrPersonBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1398 addAndAdaptSection(parentElement
, section
);
1402 public TeamDetailSection
createTeamDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1403 TeamDetailSection section
= new TeamDetailSection(this, conversation
, parentElement
, null, style
);
1404 addAndAdaptSection(parentElement
, section
);
1408 public PersonDetailSection
createPersonDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1409 PersonDetailSection section
= new PersonDetailSection(this, conversation
, parentElement
, null, style
);
1410 addAndAdaptSection(parentElement
, section
);
1414 public DescriptionDetailSection
createDescriptionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1415 DescriptionDetailSection section
= new DescriptionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1416 addAndAdaptSection(parentElement
, section
);
1420 public DescriptionElementDetailSection
createDescriptionElementDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1421 DescriptionElementDetailSection section
= new DescriptionElementDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1422 addAndAdaptSection(parentElement
, section
);
1426 public ParsingMessagesSection
createParsingMessagesSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1427 ParsingMessagesSection section
= new ParsingMessagesSection(this, conversation
, parentElement
, selectionProvider
, style
);
1428 addAndAdaptSection(parentElement
, section
);
1432 public NonViralNameDetailSection
createNonViralNameDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1433 NonViralNameDetailSection section
= new NonViralNameDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1434 addAndAdaptSection(parentElement
, section
);
1438 public MediaDetailsSection
createMediaDetailsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1439 MediaDetailsSection section
= new MediaDetailsSection(this, conversation
, parentElement
, selectionProvider
, style
);
1440 addAndAdaptSection(parentElement
, section
);
1444 public DerivedUnitFacadeDetailSection
createDerivedUnitFacadeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1445 DerivedUnitFacadeDetailSection section
= new DerivedUnitFacadeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1446 addAndAdaptSection(parentElement
, section
);
1450 public FieldObservationDetailSection
createFieldObservationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1451 FieldObservationDetailSection section
= new FieldObservationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1452 addAndAdaptSection(parentElement
, section
);
1456 public GatheringEventDetailSection
createGatheringEventDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1457 GatheringEventDetailSection section
= new GatheringEventDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1458 addAndAdaptSection(parentElement
, section
);
1462 public DerivedUnitBaseDetailSection
createDerivedUnitBaseDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1463 DerivedUnitBaseDetailSection section
= new DerivedUnitBaseDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1464 addAndAdaptSection(parentElement
, section
);
1468 public NaturalLanguageSection
createNaturalLanguageSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1469 NaturalLanguageSection section
= new NaturalLanguageSection(this, conversation
, parentElement
, selectionProvider
, style
);
1470 addAndAdaptSection(parentElement
, section
);
1474 public FeatureDistributionDetailSection
createFeatureDistributionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1475 FeatureDistributionDetailSection section
= new FeatureDistributionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1476 addAndAdaptSection(parentElement
, section
);
1480 public ClassificationDetailSection
createClassificationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1481 ClassificationDetailSection section
= new ClassificationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1482 addAndAdaptSection(parentElement
, section
);
1486 public TaxonNodeDetailSection
createTaxonNodeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1487 TaxonNodeDetailSection section
= new TaxonNodeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1488 addAndAdaptSection(parentElement
, section
);
1492 public PolytomousKeyDetailSection
createPolytomousKeyDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1493 PolytomousKeyDetailSection section
= new PolytomousKeyDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1494 addAndAdaptSection(parentElement
, section
);
1498 public PolytomousKeyNodeDetailSection
createPolytomousKeyNodeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1499 PolytomousKeyNodeDetailSection section
= new PolytomousKeyNodeDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1500 addAndAdaptSection(parentElement
, section
);
1504 public InstitutionDetailSection
createInstitutionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1505 InstitutionDetailSection section
= new InstitutionDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1506 addAndAdaptSection(parentElement
, section
);
1510 public GeneralDetailSection
createGeneralDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1511 GeneralDetailSection section
= new GeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1512 addAndAdaptSection(parentElement
, section
);
1516 public HybridDetailSection
createHybridDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1517 HybridDetailSection section
= new HybridDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1518 addAndAdaptSection(parentElement
, section
);
1522 public UserDetailSection
createUserDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1523 UserDetailSection section
= new UserDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1524 addAndAdaptSection(parentElement
, section
);
1528 public GroupDetailSection
createGroupDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1529 GroupDetailSection section
= new GroupDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1530 addAndAdaptSection(parentElement
, section
);
1534 public DeterminationDetailSection
createDeterminationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1535 DeterminationDetailSection section
= new DeterminationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1536 addAndAdaptSection(parentElement
, section
);
1540 public TaxonRelationshipDetailSection
createTaxonRelationshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1541 TaxonRelationshipDetailSection section
= new TaxonRelationshipDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1542 addAndAdaptSection(parentElement
, section
);
1546 public ReferencedEntityDetailSection
createReferencedEntityDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1547 ReferencedEntityDetailSection section
= new ReferencedEntityDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1548 addAndAdaptSection(parentElement
, section
);
1552 public TermVocabularyDetailSection
createTermVocabularyDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1553 TermVocabularyDetailSection section
= new TermVocabularyDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1554 addAndAdaptSection(parentElement
, section
);
1559 public NamedAreaDetailSection
createNamedAreaDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1560 NamedAreaDetailSection section
= new NamedAreaDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1561 addAndAdaptSection(parentElement
, section
);
1565 public UseRecordDetailSection
createUseRecordDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1566 UseRecordDetailSection section
= new UseRecordDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1567 addAndAdaptSection(parentElement
, section
);
1571 public GeneralDetailSection
createFOSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1572 GeneralDetailSection section
= new GeneralDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1573 addAndAdaptSection(parentElement
, section
);
1577 public GatheringEventDetailSection
createGatheringSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1578 GatheringEventDetailSection section
= new GatheringEventDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1579 addAndAdaptSection(parentElement
, section
);
1583 public FieldObservationDetailSection
createFODetailsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
){
1584 FieldObservationDetailSection section
= new FieldObservationDetailSection(this, conversation
, parentElement
, selectionProvider
, style
);
1585 addAndAdaptSection(parentElement
, section
);
1589 private void addAndAdaptSection(ICdmFormElement parentElement
, AbstractFormSection
<?
> section
) {
1590 parentElement
.addElement(section
);
1594 //--------DetailElements------------
1596 public UseRecordDetailElement
createUseRecordDetailElement(ICdmFormElement parentElement
){
1597 UseRecordDetailElement element
= new UseRecordDetailElement(this, parentElement
);
1598 addAndAdaptElement(parentElement
, element
);
1602 public DefinedTermDetailElement
<NamedAreaLevel
> createNamedAreaLevelElement(ICdmFormElement parentElement
){
1603 DefinedTermDetailElement
<NamedAreaLevel
> element
= new DefinedTermDetailElement
<NamedAreaLevel
>(this, parentElement
);
1604 addAndAdaptElement(parentElement
, element
);
1608 public eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement
createNamedAreaDetailElement(ICdmFormElement parentElement
){
1609 eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement element
= new eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.NamedAreaDetailElement(this, parentElement
);
1610 addAndAdaptElement(parentElement
, element
);
1614 public TermVocabularyDetailElement
createTermVocabularyDetailElement(ICdmFormElement parentElement
){
1615 TermVocabularyDetailElement element
= new TermVocabularyDetailElement(this, parentElement
);
1616 addAndAdaptElement(parentElement
, element
);
1620 public ReferenceEntityDetailElement
createReferenceEntityDetailElement(ICdmFormElement parentElement
){
1621 ReferenceEntityDetailElement element
= new ReferenceEntityDetailElement(this, parentElement
);
1622 addAndAdaptElement(parentElement
, element
);
1626 public TaxonRelationshipDetailElement
createTaxonRelationshipDetailElement(ICdmFormElement parentElement
){
1627 TaxonRelationshipDetailElement element
= new TaxonRelationshipDetailElement(this, parentElement
);
1628 addAndAdaptElement(parentElement
, element
);
1632 public GrantedAuthorityDetailElement
createGrantedAuthorityDetailElement(ICdmFormElement parentElement
){
1633 GrantedAuthorityDetailElement element
= new GrantedAuthorityDetailElement(this, parentElement
);
1634 addAndAdaptElement(parentElement
, element
);
1638 public GroupDetailElement
createGroupDetailElement(ICdmFormElement parentElement
){
1639 GroupDetailElement element
= new GroupDetailElement(this, parentElement
);
1640 addAndAdaptElement(parentElement
, element
);
1644 public UserDetailElement
createUserDetailElement(ICdmFormElement parentElement
){
1645 UserDetailElement element
= new UserDetailElement(this, parentElement
);
1646 addAndAdaptElement(parentElement
, element
);
1650 public HybridDetailElement
createHybridDetailElement(ICdmFormElement parentElement
){
1651 HybridDetailElement element
= new HybridDetailElement(this, parentElement
);
1652 addAndAdaptElement(parentElement
, element
);
1656 public InstitutionDetailElement
createInstitutionDetailElement(ICdmFormElement parentElement
){
1657 InstitutionDetailElement element
= new InstitutionDetailElement(this, parentElement
);
1658 addAndAdaptElement(parentElement
, element
);
1662 public PolytomousKeyNodeDetailElement
createPolytomousKeyNodeDetailElement(ICdmFormElement parentElement
){
1663 PolytomousKeyNodeDetailElement element
= new PolytomousKeyNodeDetailElement(this, parentElement
);
1664 addAndAdaptElement(parentElement
, element
);
1668 public PolytomousKeyDetailElement
createPolytomousKeyDetailElement(ICdmFormElement parentElement
){
1669 PolytomousKeyDetailElement element
= new PolytomousKeyDetailElement(this, parentElement
);
1670 addAndAdaptElement(parentElement
, element
);
1674 public CollectionDetailElement
createCollectionDetailElement(ICdmFormElement parentElement
){
1675 CollectionDetailElement element
= new CollectionDetailElement(this, parentElement
);
1676 addAndAdaptElement(parentElement
, element
);
1680 public TaxonNodeDetailElement
createTaxonNodeDetailElement(ICdmFormElement parentElement
){
1681 TaxonNodeDetailElement element
= new TaxonNodeDetailElement(this, parentElement
);
1682 addAndAdaptElement(parentElement
, element
);
1686 public ClassificationDetailElement
createClassificationDetailElement(ICdmFormElement parentElement
){
1687 ClassificationDetailElement element
= new ClassificationDetailElement(this, parentElement
);
1688 addAndAdaptElement(parentElement
, element
);
1692 public FeatureDistributionDetailElement
createFeatureDistributionDetailElement(ICdmFormElement parentElement
){
1693 FeatureDistributionDetailElement element
= new FeatureDistributionDetailElement(this, parentElement
);
1694 addAndAdaptElement(parentElement
, element
);
1698 public NaturalLanguageDetailElement
createNaturalLanguageDetailElement(ICdmFormElement parentElement
){
1699 NaturalLanguageDetailElement element
= new NaturalLanguageDetailElement(this, parentElement
);
1700 addAndAdaptElement(parentElement
, element
);
1704 public DerivedUnitFacadeDetailElement
createDerivedUnitFacadeDetailElement(ICdmFormElement parentElement
){
1705 DerivedUnitFacadeDetailElement element
= new DerivedUnitFacadeDetailElement(this, parentElement
);
1706 addAndAdaptElement(parentElement
, element
);
1710 public NonViralNameDetailElement
createNonViralNameDetailElement(ICdmFormElement parentElement
){
1711 NonViralNameDetailElement element
= new NonViralNameDetailElement(this, parentElement
);
1712 addAndAdaptElement(parentElement
, element
);
1716 public DescriptionElementDetailElement
createDescriptionElementDetailElement(ICdmFormElement parentElement
, int style
){
1717 DescriptionElementDetailElement element
= new DescriptionElementDetailElement(this, parentElement
, style
);
1718 addAndAdaptElement(parentElement
, element
);
1722 public DescriptionDetailElement
createDescriptionDetailElement(ICdmFormElement parentElement
, int style
){
1723 DescriptionDetailElement element
= new DescriptionDetailElement(this, parentElement
, style
);
1724 addAndAdaptElement(parentElement
, element
);
1728 public PersonDetailElement
createPersonDetailElement(ICdmFormElement parentElement
, int style
){
1729 PersonDetailElement element
= new PersonDetailElement(this, parentElement
, style
);
1730 addAndAdaptElement(parentElement
, element
);
1734 public TeamDetailElement
createTeamDetailElement(ICdmFormElement parentElement
, int style
){
1735 TeamDetailElement element
= new TeamDetailElement(this, parentElement
, style
);
1736 addAndAdaptElement(parentElement
, element
);
1740 public AuthorshipDetailElement
createAuthorshipDetailElement(ICdmFormElement parentElement
, int style
){
1741 AuthorshipDetailElement element
= new AuthorshipDetailElement(this, parentElement
, style
);
1742 addAndAdaptElement(parentElement
, element
);
1746 public TaxonBaseDetailElement
createTaxonBaseDetailElement(ICdmFormElement parentElement
, int style
){
1747 TaxonBaseDetailElement element
= new TaxonBaseDetailElement(this, parentElement
, style
);
1748 addAndAdaptElement(parentElement
, element
);
1752 public NameDetailElement
createNameDetailElement(ICdmFormElement parentElement
, int style
){
1753 NameDetailElement element
= new NameDetailElement(this, parentElement
, style
);
1754 addAndAdaptElement(parentElement
, element
);
1758 public ReferenceDetailElement
createReferenceDetailElement(ICdmFormElement parentElement
, int style
){
1759 ReferenceDetailElement element
= new ReferenceDetailElement(this, parentElement
, style
);
1760 addAndAdaptElement(parentElement
, element
);
1764 public NomenclaturalReferenceDetailElement
createNomenclaturalReferenceDetailElement(ICdmFormElement parentElement
, int style
){
1765 NomenclaturalReferenceDetailElement element
= new NomenclaturalReferenceDetailElement(this, parentElement
, style
);
1766 addAndAdaptElement(parentElement
, element
);
1771 public GeneralDetailElement
createGeneralDetailElement(ICdmFormElement parentElement
){
1772 GeneralDetailElement element
= new GeneralDetailElement(this, parentElement
);
1773 addAndAdaptElement(parentElement
, element
);
1777 public GatheringEventDetailElement
createGatheringEventDetailElement(ICdmFormElement parentElement
) {
1778 GatheringEventDetailElement element
= new GatheringEventDetailElement(this, parentElement
);
1779 addAndAdaptElement(parentElement
, element
);
1783 public GatheringEventDetailElementComposite
createGatheringEventDetailElementComposite(ICdmFormElement parentElement
) {
1784 GatheringEventDetailElementComposite element
= new GatheringEventDetailElementComposite(parentElement
.getLayoutComposite(), new GatheringEventDetailsElement(parentElement
.getLayoutComposite(), SWT
.NONE
), this, parentElement
, SWT
.NONE
);
1786 parentElement
.addElement(element
);
1790 public FieldObservationDetailElement
createFieldObservationDetailElement(ICdmFormElement parentElement
) {
1791 FieldObservationDetailElement element
= new FieldObservationDetailElement(this, parentElement
);
1792 addAndAdaptElement(parentElement
, element
);
1796 public DerivedUnitBaseDetailElement
createDerivedUnitBaseDetailElement(ICdmFormElement parentElement
) {
1797 DerivedUnitBaseDetailElement element
= new DerivedUnitBaseDetailElement(this, parentElement
);
1798 addAndAdaptElement(parentElement
, element
);
1802 public DeterminationDetailElement
createDeterminationDetailElement(ICdmFormElement parentElement
) {
1803 DeterminationDetailElement element
= new DeterminationDetailElement(this, parentElement
);
1804 addAndAdaptElement(parentElement
, element
);
1809 * @param parentElement
1812 private void addAndAdaptElement(ICdmFormElement parentElement
, AbstractCdmDetailElement
<?
> element
) {
1814 parentElement
.addElement(element
);
1817 //--------EntityCollectionSection----------
1818 public TeamMemberSection
createTeamMemberSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1819 TeamMemberSection section
= new TeamMemberSection(this, conversation
, parentElement
, style
);
1820 addAndAdaptSection(parentElement
, section
);
1824 public AnnotationSection
createAnnotationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1825 AnnotationSection section
= new AnnotationSection(this, conversation
, parentElement
, style
);
1826 addAndAdaptSection(parentElement
, section
);
1830 public CreditSection
createCreditSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1831 CreditSection section
= new CreditSection(this, conversation
, parentElement
, style
);
1832 addAndAdaptSection(parentElement
, section
);
1836 public DescriptionElementSourceSection
createDescriptionElementSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1837 DescriptionElementSourceSection section
= new DescriptionElementSourceSection(this, conversation
, parentElement
, style
);
1838 addAndAdaptSection(parentElement
, section
);
1842 public ExtensionSection
createExtensionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1843 ExtensionSection section
= new ExtensionSection(this, conversation
, parentElement
, style
);
1844 addAndAdaptSection(parentElement
, section
);
1848 public MarkerSection
createMarkerSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1849 MarkerSection section
= new MarkerSection(this, conversation
, parentElement
, style
);
1850 addAndAdaptSection(parentElement
, section
);
1854 public MediaSection
createMediaSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1855 MediaSection section
= new MediaSection(this, conversation
, parentElement
, style
);
1856 addAndAdaptSection(parentElement
, section
);
1860 public DescriptionElementMediaSection
createDescriptionElementMediaSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1861 DescriptionElementMediaSection section
= new DescriptionElementMediaSection(this, conversation
, parentElement
, style
);
1862 addAndAdaptSection(parentElement
, section
);
1866 public MediaRepresentationSection
createMediaRepresentationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1867 MediaRepresentationSection section
= new MediaRepresentationSection(this, conversation
, parentElement
, style
);
1868 addAndAdaptSection(parentElement
, section
);
1872 public MediaRepresentationPartSection
createMediaRepresentationPartSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1873 MediaRepresentationPartSection section
= new MediaRepresentationPartSection(this, conversation
, parentElement
, style
);
1874 addAndAdaptSection(parentElement
, section
);
1878 public ModifierSection
createModifierSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1879 ModifierSection section
= new ModifierSection(this, conversation
, parentElement
, style
);
1880 addAndAdaptSection(parentElement
, section
);
1884 public NomenclaturalStatusSection
createNomenclaturalStatusSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1885 NomenclaturalStatusSection section
= new NomenclaturalStatusSection(this, conversation
, parentElement
, style
);
1886 addAndAdaptSection(parentElement
, section
);
1890 public NameRelationshipDetailSection
createNameRelationshipDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1891 NameRelationshipDetailSection section
= new NameRelationshipDetailSection(this, conversation
, parentElement
, style
);
1892 addAndAdaptSection(parentElement
, section
);
1896 public ProtologueSection
createProtologueSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1897 ProtologueSection section
= new ProtologueSection(this, conversation
, parentElement
, style
);
1898 addAndAdaptSection(parentElement
, section
);
1902 public RightsSection
createRightsSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1903 RightsSection section
= new RightsSection(this, conversation
, parentElement
, style
);
1904 addAndAdaptSection(parentElement
, section
);
1908 public SourceSection
createSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1909 SourceSection section
= new SourceSection(this, conversation
, parentElement
, style
);
1910 addAndAdaptSection(parentElement
, section
);
1914 public ScopeSection
createScopeSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1915 ScopeSection section
= new ScopeSection(this, conversation
, parentElement
, style
);
1916 addAndAdaptSection(parentElement
, section
);
1920 public DescriptionSourceSection
createDescriptionSourceSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1921 DescriptionSourceSection section
= new DescriptionSourceSection(this, conversation
, parentElement
, style
);
1922 addAndAdaptSection(parentElement
, section
);
1926 public TypeDesignationSection
createTypeDesignationSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1927 TypeDesignationSection section
= new TypeDesignationSection(this, conversation
, parentElement
, style
);
1928 addAndAdaptSection(parentElement
, section
);
1932 public StateDataSection
createStateDataSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1933 StateDataSection section
= new StateDataSection(this, conversation
, parentElement
, style
);
1934 addAndAdaptSection(parentElement
, section
);
1938 public StatisticalMeasurementValueSection
createStatisticalMeasurementValueSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1939 StatisticalMeasurementValueSection section
= new StatisticalMeasurementValueSection(this, conversation
, parentElement
, style
);
1940 addAndAdaptSection(parentElement
, section
);
1944 public DescribedSpecimenSection
createDescribedSpecimenSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1945 DescribedSpecimenSection section
= new DescribedSpecimenSection(this, conversation
, parentElement
, style
);
1946 addAndAdaptSection(parentElement
, section
);
1950 public CollectingAreasDetailSection
createCollectingAreasDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1951 CollectingAreasDetailSection section
= new CollectingAreasDetailSection(this, conversation
, parentElement
, style
);
1952 addAndAdaptSection(parentElement
, section
);
1956 public CurrentDeterminationDetailSection
createCurrentDeterminationDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1957 CurrentDeterminationDetailSection section
= new CurrentDeterminationDetailSection(this, conversation
, parentElement
, style
);
1958 addAndAdaptSection(parentElement
, section
);
1962 public DeterminationHistoryDetailSection
createDeterminationHistoryDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1963 DeterminationHistoryDetailSection section
= new DeterminationHistoryDetailSection(this, conversation
, parentElement
, style
);
1964 addAndAdaptSection(parentElement
, section
);
1968 public SpecimenCollectionDetailSection
createSpecimenCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1969 SpecimenCollectionDetailSection section
= new SpecimenCollectionDetailSection(this, conversation
, parentElement
, style
);
1970 addAndAdaptSection(parentElement
, section
);
1974 public SourceCollectionDetailSection
createSourceCollectionDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1975 SourceCollectionDetailSection section
= new SourceCollectionDetailSection(this, conversation
, parentElement
, style
);
1976 addAndAdaptSection(parentElement
, section
);
1980 public GeographicalScopeDetailSection
createGeographicalScopeDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1981 GeographicalScopeDetailSection section
= new GeographicalScopeDetailSection(this, conversation
, parentElement
, style
);
1982 addAndAdaptSection(parentElement
, section
);
1986 public ScopeRestrictionSection
createScopeRestrictionSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1987 ScopeRestrictionSection section
= new ScopeRestrictionSection(this, conversation
, parentElement
, style
);
1988 addAndAdaptSection(parentElement
, section
);
1992 public MemberDetailSection
createMemberDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1993 MemberDetailSection section
= new MemberDetailSection(this, conversation
, parentElement
, style
);
1994 addAndAdaptSection(parentElement
, section
);
1998 public GrantedAuthorityDetailSection
createGrantedAuthorityDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
1999 GrantedAuthorityDetailSection section
= new GrantedAuthorityDetailSection(this, conversation
, parentElement
, style
);
2000 addAndAdaptSection(parentElement
, section
);
2004 public GroupsByUserDetailSection
createGroupsByUserDetailSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2005 GroupsByUserDetailSection section
= new GroupsByUserDetailSection(this, conversation
, parentElement
, style
);
2006 addAndAdaptSection(parentElement
, section
);
2010 public TaxonomicScopeSection
createTaxonomicScopeSection(ConversationHolder conversation
, ICdmFormElement parentElement
, int style
){
2011 TaxonomicScopeSection section
= new TaxonomicScopeSection(this, conversation
, parentElement
, style
);
2012 addAndAdaptSection(parentElement
, section
);
2018 * createEntityCollectionElement
2021 * @param removeListener
2022 * a {@link org.eclipse.swt.events.SelectionListener} object.
2025 * @param parentElement
2027 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
2029 * @param versionableEntity
2030 * a {@link eu.etaxonomy.cdm.model.common.IVersionableEntity}
2032 * @param backgroundColor
2033 * a {@link org.eclipse.swt.graphics.Color} object.
2035 * {@link eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement}
2038 public AbstractEntityCollectionElement
createEntityCollectionElement(AbstractFormSection parentElement
,
2039 Object versionableEntity
, SelectionListener removeListener
, Color backgroundColor
, int style
) {
2040 AbstractEntityCollectionElement element
= null;
2042 Object entity
= HibernateProxyHelper
.deproxy(versionableEntity
);
2044 if (entity
instanceof Annotation
) {
2045 element
= new AnnotationElement(this, parentElement
, (Annotation
) entity
, removeListener
, style
);
2046 } else if (entity
instanceof Person
) {
2047 element
= new TeamMemberElement(this, parentElement
, (Person
) entity
, removeListener
, style
);
2048 } else if (entity
instanceof Credit
) {
2049 element
= new CreditElement(this, parentElement
, (Credit
) entity
, removeListener
, style
);
2050 } else if (entity
instanceof Extension
) {
2051 element
= new ExtensionElement(this, parentElement
, (Extension
) entity
, removeListener
, style
);
2052 } else if (entity
instanceof Marker
) {
2053 element
= new MarkerElement(this, parentElement
, (Marker
) entity
, removeListener
, style
);
2054 } else if (entity
instanceof Media
) {
2055 element
= new MediaElement(this, parentElement
, (Media
) entity
, removeListener
, style
);
2056 } else if (entity
instanceof MediaRepresentation
) {
2057 element
= new MediaRepresentationElement(this, parentElement
, (MediaRepresentation
) entity
, removeListener
,
2059 } else if (entity
instanceof ImageFile
) {
2060 element
= new ImageFileElement(this, parentElement
, (ImageFile
) entity
, removeListener
, style
);
2061 } else if (entity
instanceof MediaRepresentationPart
) {
2062 element
= new MediaRepresentationPartElement(this, parentElement
, (MediaRepresentationPart
) entity
,
2063 removeListener
, style
);
2064 } else if (entity
instanceof NomenclaturalStatus
) {
2065 element
= new NomenclaturalStatusElement(this, parentElement
, (NomenclaturalStatus
) entity
, removeListener
,
2067 } else if (entity
instanceof Rights
) {
2068 element
= new RightsElement(this, parentElement
, (Rights
) entity
, removeListener
, style
);
2069 } else if (entity
instanceof DescriptionElementSource
) {
2070 element
= new DescriptionElementSourceElement(this, parentElement
, (DescriptionElementSource
) entity
,
2071 removeListener
, style
);
2072 } else if (entity
instanceof IdentifiableSource
) {
2073 element
= new IdentifiableSourceElement(this, parentElement
, (IdentifiableSource
) entity
, removeListener
,
2075 } else if (entity
instanceof Scope
) {
2076 element
= new ScopeElement(this, parentElement
, (Scope
) entity
, removeListener
, style
);
2077 } else if (entity
instanceof Modifier
) {
2078 element
= new ModifierElement(this, parentElement
, (Modifier
) entity
, removeListener
, style
);
2079 } else if (entity
instanceof Reference
) {
2080 element
= new DescriptionSourceElement(this, parentElement
, (Reference
) entity
, removeListener
, style
);
2081 } else if (entity
instanceof NameTypeDesignation
) {
2082 element
= new NameTypeDesignationElement(this, parentElement
, (NameTypeDesignation
) entity
, removeListener
,
2084 } else if (entity
instanceof NameRelationship
) {
2085 element
= new NameRelationshipDetailElement(this, parentElement
, (NameRelationship
) entity
, removeListener
,
2087 } else if (entity
instanceof SpecimenTypeDesignation
) {
2088 element
= new SpecimenTypeDesignationElement(this, parentElement
, (SpecimenTypeDesignation
) entity
,
2089 removeListener
, style
);
2090 } else if (entity
instanceof StateData
) {
2091 element
= new StateDataElement(this, parentElement
, (StateData
) entity
, removeListener
, style
);
2092 } else if (entity
instanceof StatisticalMeasurementValue
) {
2093 element
= new StatisticalMeasurementValueElement(this, parentElement
, (StatisticalMeasurementValue
) entity
,
2094 removeListener
, style
);
2095 } else if (entity
instanceof DerivedUnit
) {
2096 element
= new DerivedUnitElement(this, parentElement
, (DerivedUnit
) entity
, removeListener
, style
);
2097 } else if (entity
instanceof NamedArea
) {
2098 element
= new NamedAreaDetailElement(this, parentElement
, (NamedArea
) entity
, removeListener
, style
);
2099 } else if (entity
instanceof DeterminationEvent
) {
2100 element
= new DeterminationEventDetailElement(this, parentElement
, (DeterminationEvent
) entity
, removeListener
, style
);
2101 } else if (entity
instanceof Specimen
) {
2102 element
= new SpecimenCollectionDetailElement(this, parentElement
, (Specimen
) entity
, removeListener
, style
);
2103 } else if (entity
instanceof User
) {
2104 element
= new MemberDetailElement(this, parentElement
, (User
) entity
, removeListener
, style
);
2105 } else if (entity
instanceof GrantedAuthority
) {
2106 element
= new GrantedAuthorityCollectionElement(this, parentElement
, (GrantedAuthorityImpl
) entity
,
2107 removeListener
, style
);
2108 } else if (entity
instanceof Group
) {
2109 element
= new GroupsByUserDetailElement(this, parentElement
, (Group
) entity
, removeListener
, style
);
2110 } else if (entity
instanceof Taxon
) {
2111 element
= new TaxonDetailElement(this, parentElement
, (Taxon
) entity
, removeListener
, style
);
2112 } else if (entity
instanceof DescriptionElementBase
) {
2113 // this is the special case for protologs, maybe we can do this
2114 // differently when API improves
2115 DescriptionElementBase descriptionElement
= (DescriptionElementBase
) entity
;
2116 if (descriptionElement
.getFeature().equals(Feature
.PROTOLOGUE())) {
2117 element
= new ProtologueElement(this, parentElement
, descriptionElement
, removeListener
, style
);
2121 if (element
== null) {
2122 AbstractUtility
.errorDialog("No element for entity", this,
2123 "Could not generate element for entity. Looks like the case is not handled already. Check implementation. Entity: "
2127 else if (backgroundColor
!= null && !backgroundColor
.isDisposed()) {
2128 element
.setPersistentBackground(backgroundColor
);
2130 parentElement
.addElement(element
);
2136 public DeterminationEventDetailElementComposite
createDeterminationEventDetailElementComposite(AbstractFormSection parentElement
,
2137 Object versionableEntity
, SelectionListener removeListener
, Color backgroundColor
, int style
){
2138 Object entity
= HibernateProxyHelper
.deproxy(versionableEntity
);
2139 DeterminationEventDetailElementComposite element
= new DeterminationEventDetailElementComposite(parentElement
.getLayoutComposite(), this, parentElement
, (DeterminationEvent
) entity
,
2140 removeListener
, style
);
2142 parentElement
.addElement(element
);
2148 * Creates a selection element for the given type T.
2151 * <strong>Selection elements not handled by this method:</strong>
2153 * <li>{@link TaxonNodeSelectionElement} see
2154 * {@link #createTaxonNodeSelectionElement(ConversationHolder, ICdmFormElement, String, TaxonNode, int, int)}
2156 * <li>{@link NomenclaturalAuthorTeamSelectionElement} see
2157 * {@link #createNomenclaturalAuthorTeamSelectionElement(ConversationHolder, ICdmFormElement, String, Team, int, int)}
2163 * a {@link Class} object of the type that you want the selection
2165 * @param parentElement
2166 * a {@link ICdmFormElement} object.
2167 * @param labelString
2168 * a {@link String} object.
2169 * @param selectionType
2171 * a {@link ICdmBase} object.
2174 * @param conversation
2175 * a {@link ConversationHolder} object.
2176 * @return a {@link EntitySelectionElement} object.
2178 public <T
extends ICdmBase
> EntitySelectionElement
<T
> createSelectionElement(Class
<T
> clazz
,
2179 ConversationHolder conversation
, ICdmFormElement parentElement
, String labelString
, T selection
, int mode
,
2181 EntitySelectionElement
<T
> element
= new EntitySelectionElement
<T
>(this, conversation
, parentElement
, clazz
,
2182 labelString
, selection
, mode
, style
);
2184 parentElement
.addElement(element
);
2188 public TaxonNodeSelectionElement
createTaxonNodeSelectionElement(ConversationHolder conversation
,
2189 ICdmFormElement parentElement
, String labelString
, TaxonNode selection
, int mode
, int style
) {
2190 TaxonNodeSelectionElement element
= new TaxonNodeSelectionElement(this, conversation
, parentElement
,
2191 labelString
, selection
, mode
, style
);
2193 parentElement
.addElement(element
);
2197 public NomenclaturalAuthorTeamSelectionElement
createNomenclaturalAuthorTeamSelectionElement(
2198 ConversationHolder conversation
, ICdmFormElement parentElement
, String labelString
, Team selection
,
2199 int mode
, int style
) {
2200 NomenclaturalAuthorTeamSelectionElement element
= new NomenclaturalAuthorTeamSelectionElement(this,
2201 conversation
, parentElement
, labelString
, selection
, mode
, style
);
2203 parentElement
.addElement(element
);
2207 /** {@inheritDoc} */
2208 public LabelElement
createLabel(ICdmFormElement parentElement
, String text
) {
2209 LabelElement labelElement
= new LabelElement(this, parentElement
, text
);
2210 adapt(labelElement
);
2211 parentElement
.addElement(labelElement
);
2212 return labelElement
;
2217 * Getter for the field <code>selectionProvider</code>.
2220 * @return a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
2222 public ISelectionProvider
getSelectionProvider() {
2223 return selectionProvider
;
2228 * createDetailedDescriptionDetailElement
2231 * @param parentElement
2232 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
2236 * {@link eu.etaxonomy.cdm.model.description.DescriptionElementBase}
2241 * {@link eu.etaxonomy.taxeditor.ui.section.description.detail.AbstractDetailedDescriptionDetailElement}
2244 public AbstractDetailedDescriptionDetailElement
createDetailedDescriptionDetailElement(
2245 ICdmFormElement parentElement
, DescriptionElementBase entity
, int style
) {
2246 AbstractDetailedDescriptionDetailElement detailedDescriptionElement
= null;
2248 if (entity
instanceof CategoricalData
) {
2249 detailedDescriptionElement
= new CategoricalDataDetailElement(this, parentElement
,
2250 (CategoricalData
) entity
, style
);
2251 } else if (entity
instanceof CommonTaxonName
) {
2252 detailedDescriptionElement
= new CommonNameDetailElement(this, parentElement
, (CommonTaxonName
) entity
,
2254 } else if (entity
instanceof Distribution
) {
2255 detailedDescriptionElement
= new DistributionDetailElement(this, parentElement
, (Distribution
) entity
,
2257 } else if (entity
instanceof IndividualsAssociation
) {
2258 detailedDescriptionElement
= new IndividualsAssociationDetailElement(this, parentElement
,
2259 (IndividualsAssociation
) entity
, style
);
2260 } else if (entity
instanceof QuantitativeData
) {
2261 detailedDescriptionElement
= new QuantitativeDataDetailElement(this, parentElement
,
2262 (QuantitativeData
) entity
, style
);
2263 } else if (entity
instanceof TaxonInteraction
) {
2264 detailedDescriptionElement
= new TaxonInteractionDetailElement(this, parentElement
,
2265 (TaxonInteraction
) entity
, style
);
2266 } else if (entity
instanceof TextData
) {
2267 detailedDescriptionElement
= new TextDataDetailElement(this, parentElement
, (TextData
) entity
, style
);
2269 throw new IllegalStateException("There is no interface for the given description element");
2271 adapt(detailedDescriptionElement
);
2272 parentElement
.addElement(detailedDescriptionElement
);
2273 return detailedDescriptionElement
;
2278 * Creates a styled text as a part of the form.
2283 * the text initial value
2286 * @return the text widget
2288 public StyledText
createStyledText(Composite parent
, String value
, int style
) {
2289 StyledText text
= new StyledText(parent
, getBorderStyle() | style
| getOrientation());
2290 if (value
!= null) {
2291 text
.setText(value
);
2293 text
.setForeground(getColors().getForeground());
2294 text
.setBackground(getColors().getBackground());
2295 // text.addFocusListener(visibilityHandler);