bab79edf591d122258b21a1343003e31cdba6dc3
[taxeditor.git] / taxeditor-editor / src / main / java / eu / etaxonomy / taxeditor / editor / view / detail / DetailsViewer.java
1 // $Id$
2 /**
3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
6 *
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
9 */
10
11 package eu.etaxonomy.taxeditor.editor.view.detail;
12
13 import org.eclipse.jface.viewers.ISelection;
14 import org.eclipse.jface.viewers.SelectionChangedEvent;
15 import org.eclipse.swt.SWT;
16 import org.eclipse.swt.widgets.Composite;
17 import org.eclipse.ui.forms.widgets.Section;
18
19 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
20 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeNotSupportedException;
21 import eu.etaxonomy.cdm.model.agent.Person;
22 import eu.etaxonomy.cdm.model.agent.Team;
23 import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
24 import eu.etaxonomy.cdm.model.description.DescriptionBase;
25 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
26 import eu.etaxonomy.cdm.model.description.PolytomousKey;
27 import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
28 import eu.etaxonomy.cdm.model.media.Media;
29 import eu.etaxonomy.cdm.model.name.NonViralName;
30 import eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase;
31 import eu.etaxonomy.cdm.model.reference.Reference;
32 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
33 import eu.etaxonomy.taxeditor.editor.EditorUtil;
34 import eu.etaxonomy.taxeditor.editor.view.AbstractCdmDataViewer;
35 import eu.etaxonomy.taxeditor.forms.CdmFormFactory.DetailType;
36 import eu.etaxonomy.taxeditor.forms.CdmFormFactory.EntityDetailType;
37 import eu.etaxonomy.taxeditor.forms.RootElement;
38 import eu.etaxonomy.taxeditor.model.AbstractCdmViewPart;
39 import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
40 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
41 import eu.etaxonomy.taxeditor.section.agent.PersonDetailSection;
42 import eu.etaxonomy.taxeditor.section.agent.TeamDetailSection;
43 import eu.etaxonomy.taxeditor.section.agent.TeamOrPersonBaseDetailSection;
44 import eu.etaxonomy.taxeditor.section.description.DescribedSpecimenSection;
45 import eu.etaxonomy.taxeditor.section.description.DescriptionDetailSection;
46 import eu.etaxonomy.taxeditor.section.description.DescriptionElementDetailSection;
47 import eu.etaxonomy.taxeditor.section.description.DescriptionElementMediaSection;
48 import eu.etaxonomy.taxeditor.section.description.DescriptionElementSourceSection;
49 import eu.etaxonomy.taxeditor.section.description.DescriptionSourceSection;
50 import eu.etaxonomy.taxeditor.section.description.MediaDetailsSection;
51 import eu.etaxonomy.taxeditor.section.description.NaturalLanguageSection;
52 import eu.etaxonomy.taxeditor.section.description.ScopeSection;
53 import eu.etaxonomy.taxeditor.section.feature.FeatureDistributionDetailSection;
54 import eu.etaxonomy.taxeditor.section.key.GeographicalScopeDetailSection;
55 import eu.etaxonomy.taxeditor.section.key.PolytomousKeyDetailSection;
56 import eu.etaxonomy.taxeditor.section.key.PolytomousKeyNodeDetailSection;
57 import eu.etaxonomy.taxeditor.section.key.ScopeRestrictionSection;
58 import eu.etaxonomy.taxeditor.section.name.HybridDetailSection;
59 import eu.etaxonomy.taxeditor.section.name.NameRelationshipDetailSection;
60 import eu.etaxonomy.taxeditor.section.name.NomenclaturalStatusSection;
61 import eu.etaxonomy.taxeditor.section.name.NonViralNameDetailSection;
62 import eu.etaxonomy.taxeditor.section.name.ProtologueSection;
63 import eu.etaxonomy.taxeditor.section.name.TypeDesignationSection;
64 import eu.etaxonomy.taxeditor.section.occurrence.DerivedUnitBaseDetailSection;
65 import eu.etaxonomy.taxeditor.section.occurrence.FieldObservationDetailSection;
66 import eu.etaxonomy.taxeditor.section.occurrence.GatheringEventDetailSection;
67 import eu.etaxonomy.taxeditor.section.occurrence.GeneralDetailSection;
68 import eu.etaxonomy.taxeditor.section.reference.NomenclaturalReferenceDetailSection;
69 import eu.etaxonomy.taxeditor.section.reference.ReferenceDetailSection;
70 import eu.etaxonomy.taxeditor.section.taxon.ParsingMessagesSection;
71 import eu.etaxonomy.taxeditor.section.taxon.TaxonBaseDetailSection;
72
73 /**
74 * <p>DetailsViewer class.</p>
75 *
76 * @author n.hoffmann
77 * @created Feb 12, 2010
78 * @version 1.0
79 */
80 public class DetailsViewer extends AbstractCdmDataViewer {
81
82 private enum VIEW_PART{
83 TAXON,
84 NAME,
85 REFEERENCE,
86 TEAM,
87 PERSON,
88 DESCRIPTION,
89 DESCRIPTION_ELEMENT,
90 EMPTY,
91 MEDIA,
92 TEAM_OR_PERSON_BASE,
93 DERIVED_UNIT,
94 FEATURE_DISTRIBUTION,
95 POLYTOMOUS_KEY,
96 POLYTOMOUS_KEY_NODE
97 }
98
99 private VIEW_PART currentViewPart;
100
101 private ISelection selection;
102
103 /**
104 * <p>Constructor for DetailsViewer.</p>
105 *
106 * @param parent a {@link org.eclipse.swt.widgets.Composite} object.
107 * @param viewPart a {@link eu.etaxonomy.taxeditor.model.AbstractCdmViewPart} object.
108 */
109 public DetailsViewer(Composite parent, AbstractCdmViewPart viewPart) {
110 super(parent, viewPart);
111 }
112
113 // START HACK TO MAKE THE DERIVED UNIT FACADE WORKING
114 // since we are getting implementations of DerivedUnitBase from the bulk editor
115 // and not derived unit base objects,
116
117 /* (non-Javadoc)
118 * @see eu.etaxonomy.taxeditor.editor.view.AbstractCdmDataViewer#setInput(java.lang.Object)
119 */
120 @Override
121 public void setInput(Object input) {
122 if(input instanceof DerivedUnitBase){
123 try {
124 input = DerivedUnitFacade.NewInstance((DerivedUnitBase) input, PreferencesUtil.getDerivedUnitConfigurator());
125 } catch (DerivedUnitFacadeNotSupportedException e) {
126 EditorUtil.error(getClass(), e);
127 }
128 }
129 super.setInput(input);
130 }
131
132 @Override
133 protected void markViewPartDirty(){
134 if(getInput() instanceof DerivedUnitFacade){
135 getViewPart().changed(((DerivedUnitFacade) getInput()).innerDerivedUnit());
136 }
137
138 super.markViewPartDirty();
139 }
140
141 // END HACK TO MAKE THE DERIVED UNIT FACADE WORKING
142
143 /* (non-Javadoc)
144 * @see org.eclipse.jface.viewers.Viewer#refresh()
145 */
146 /** {@inheritDoc} */
147 @Override
148 protected void showParts() {
149 if(getInput() instanceof TaxonBase){
150 if(currentViewPart != VIEW_PART.TAXON){
151 createTaxonSections(rootElement);
152 currentViewPart = VIEW_PART.TAXON;
153
154 // preserve a pointer to the AbstractNameComposite
155 // MultiPageTaxonEditor editor = EditorUtil.getActiveMultiPageTaxonEditor();
156 // if(editor != null){
157 // TaxonNameEditor page = (TaxonNameEditor) editor.getPage(Page.NAME);
158 // for(AbstractGroupedContainer container : page.getGroupedContainers()){
159 // if(container.getData() == getInput()){
160 // sourceContainer = container;
161 // }
162 // }
163 // }
164 }
165 }else if(getInput() instanceof NonViralName){
166 if(currentViewPart != VIEW_PART.NAME){
167 createNameSections(rootElement);
168 currentViewPart = VIEW_PART.NAME;
169 }
170 }else if(getInput() instanceof Reference){
171 if(currentViewPart != VIEW_PART.REFEERENCE){
172 createReferenceSections(rootElement);
173 currentViewPart = VIEW_PART.REFEERENCE;
174 }
175 }else if(getInput() instanceof Team){
176 if(currentViewPart != VIEW_PART.TEAM){
177 createTeamDetailSection(rootElement);
178 currentViewPart = VIEW_PART.TEAM;
179 }
180 }else if(getInput() instanceof Person){
181 if(currentViewPart != VIEW_PART.PERSON){
182 createPersonDetailSection(rootElement);
183 currentViewPart = VIEW_PART.PERSON;
184 }
185 }else if(getInput() instanceof TeamOrPersonBase){
186 // fallback
187 if(currentViewPart != VIEW_PART.TEAM_OR_PERSON_BASE){
188 createTeamOrPersonBaseDetailSection(rootElement);
189 currentViewPart = VIEW_PART.TEAM_OR_PERSON_BASE;
190 }
191 }else if(getInput() instanceof DescriptionBase){
192 if(currentViewPart != VIEW_PART.DESCRIPTION){
193 createDescriptionSection(rootElement);
194 currentViewPart = VIEW_PART.DESCRIPTION;
195 }
196 }else if(getInput() instanceof DescriptionElementBase){
197 if(currentViewPart != VIEW_PART.DESCRIPTION_ELEMENT){
198 createDescriptionElementSection(rootElement);
199 currentViewPart = VIEW_PART.DESCRIPTION_ELEMENT;
200 }
201 }else if(getInput() instanceof Media){
202 if(currentViewPart != VIEW_PART.MEDIA){
203 createMediaElementSection(rootElement);
204 currentViewPart = VIEW_PART.MEDIA;
205 }
206 }else if(getInput() instanceof DerivedUnitFacade){
207 if(currentViewPart != VIEW_PART.DERIVED_UNIT){
208 createDerivedUnitBaseElementSection(rootElement);
209 currentViewPart = VIEW_PART.DERIVED_UNIT;
210 }
211 }else if(getInput() instanceof FeatureNodeContainer) {
212 if(currentViewPart != VIEW_PART.FEATURE_DISTRIBUTION){
213 createFeatureDistributionSection(rootElement);
214 currentViewPart = VIEW_PART.FEATURE_DISTRIBUTION;
215 }
216 }else if(getInput() instanceof PolytomousKey) {
217 if(currentViewPart != VIEW_PART.POLYTOMOUS_KEY){
218 createPolytomousKeySection(rootElement);
219 currentViewPart = VIEW_PART.POLYTOMOUS_KEY;
220 }
221 }else if(getInput() instanceof PolytomousKeyNode) {
222 if(currentViewPart != VIEW_PART.POLYTOMOUS_KEY_NODE){
223 createPolytomousKeyNodeSection(rootElement);
224 currentViewPart = VIEW_PART.POLYTOMOUS_KEY_NODE;
225 }
226 }else{
227 destroySections();
228 currentViewPart = VIEW_PART.EMPTY;
229 }
230
231 layout();
232 }
233
234 /* (non-Javadoc)
235 * @see org.eclipse.jface.viewers.Viewer#getSelection()
236 */
237 /** {@inheritDoc} */
238 @Override
239 public ISelection getSelection() {
240 return selection;
241 }
242
243 /* (non-Javadoc)
244 * @see org.eclipse.jface.viewers.Viewer#setSelection(org.eclipse.jface.viewers.ISelection, boolean)
245 */
246 /** {@inheritDoc} */
247 @Override
248 public void setSelection(ISelection selection, boolean reveal) {
249 this.selection = selection;
250 SelectionChangedEvent selectionChangedEvent = new SelectionChangedEvent(this, selection);
251 fireSelectionChanged(selectionChangedEvent);
252 }
253
254
255 private void createTaxonSections(RootElement parent) {
256 destroySections();
257
258 TaxonBaseDetailSection taxonBaseDetailSection = (TaxonBaseDetailSection)
259 formFactory.createCdmDetailSection(DetailType.TAXONBASE, getConversationHolder(), parent, this, Section.TWISTIE);
260
261 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
262
263 NonViralNameDetailSection nonViralNameSection = (NonViralNameDetailSection)
264 formFactory.createCdmDetailSection(DetailType.NONVIRALNAME, getConversationHolder(), parent, this, Section.TWISTIE | Section.EXPANDED);
265
266 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
267
268 NomenclaturalReferenceDetailSection referenceDetailSection = (NomenclaturalReferenceDetailSection)
269 formFactory.createCdmDetailSection(DetailType.NOMENCLATURALREFERENCE, getConversationHolder(), parent, this, Section.TWISTIE);
270
271 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
272
273 NomenclaturalStatusSection nomenclaturalStatusSection = (NomenclaturalStatusSection)
274 formFactory.createEntityDetailSection(EntityDetailType.NOMENCLATURALSTATUS, getConversationHolder(), parent, Section.TWISTIE);
275
276 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
277
278 ProtologueSection protologSection = (ProtologueSection)
279 formFactory.createEntityDetailSection(EntityDetailType.PROTOLOG, getConversationHolder(), parent, Section.TWISTIE);
280
281 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
282
283 TypeDesignationSection typeDesignationSection = (TypeDesignationSection)
284 formFactory.createEntityDetailSection(EntityDetailType.TYPEDESIGNATION, getConversationHolder(), parent, Section.TWISTIE);
285
286 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
287
288 NameRelationshipDetailSection nameRelationshipSection = (NameRelationshipDetailSection)
289 formFactory.createEntityDetailSection(EntityDetailType.NAME_RELATIONSHIP, getConversationHolder(), parent, Section.TWISTIE);
290
291 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
292
293 HybridDetailSection hybridDetailSection = (HybridDetailSection)
294 formFactory.createCdmDetailSection(DetailType.HYBRID, getConversationHolder(), parent, this, Section.TWISTIE);
295
296 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
297
298 ParsingMessagesSection parsingMessagesSection = (ParsingMessagesSection)
299 formFactory.createCdmDetailSection(DetailType.PARSINGMESSAGE, getConversationHolder(), parent, this, Section.EXPANDED);
300
301
302
303 addPart(taxonBaseDetailSection);
304 addPart(nonViralNameSection);
305 addPart(nomenclaturalStatusSection);
306 addPart(protologSection);
307 addPart(referenceDetailSection);
308 addPart(typeDesignationSection);
309 addPart(nameRelationshipSection);
310 addPart(hybridDetailSection);
311 addPart(parsingMessagesSection);
312 }
313
314 private void createNameSections(RootElement parent) {
315 destroySections();
316 NonViralNameDetailSection nonViralNameSection = (NonViralNameDetailSection)
317 formFactory.createCdmDetailSection(DetailType.NONVIRALNAME, getConversationHolder(), parent, this, Section.TWISTIE | Section.EXPANDED);
318
319 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
320
321 NomenclaturalReferenceDetailSection referenceDetailSection = (NomenclaturalReferenceDetailSection)
322 formFactory.createCdmDetailSection(DetailType.NOMENCLATURALREFERENCE, getConversationHolder(), parent, this, Section.TWISTIE);
323
324 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
325
326 NomenclaturalStatusSection nomenclaturalStatusSection = (NomenclaturalStatusSection)
327 formFactory.createEntityDetailSection(EntityDetailType.NOMENCLATURALSTATUS, getConversationHolder(), parent, Section.TWISTIE);
328
329 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
330
331 ProtologueSection protologSection = (ProtologueSection)
332 formFactory.createEntityDetailSection(EntityDetailType.PROTOLOG, getConversationHolder(), parent, Section.TWISTIE);
333
334 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
335
336 TypeDesignationSection typeDesignationSection = (TypeDesignationSection)
337 formFactory.createEntityDetailSection(EntityDetailType.TYPEDESIGNATION, getConversationHolder(), parent, Section.TWISTIE);
338
339 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
340
341 NameRelationshipDetailSection nameRelationshipSection = (NameRelationshipDetailSection)
342 formFactory.createEntityDetailSection(EntityDetailType.NAME_RELATIONSHIP, getConversationHolder(), parent, Section.TWISTIE);
343
344 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
345
346 HybridDetailSection hybridDetailSection = (HybridDetailSection)
347 formFactory.createCdmDetailSection(DetailType.HYBRID, getConversationHolder(), parent, this, Section.TWISTIE);
348
349 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
350
351 addPart(nonViralNameSection);
352 addPart(nomenclaturalStatusSection);
353 addPart(protologSection);
354 addPart(referenceDetailSection);
355 addPart(typeDesignationSection);
356 addPart(nameRelationshipSection);
357 addPart(hybridDetailSection);
358 }
359
360 private void createReferenceSections(RootElement parent) {
361 destroySections();
362
363 ReferenceDetailSection referenceDetailSection = (ReferenceDetailSection)
364 formFactory.createCdmDetailSection(DetailType.REFERENCEBASE, getConversationHolder(), parent, this, Section.TWISTIE | Section.EXPANDED);
365
366 addPart(referenceDetailSection);
367 }
368
369 private void createTeamOrPersonBaseDetailSection(RootElement parent) {
370 destroySections();
371 TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection = (TeamOrPersonBaseDetailSection)
372 formFactory.createCdmDetailSection(DetailType.TEAMORPERSONBASE, getConversationHolder(), parent, this, Section.TWISTIE | Section.EXPANDED);
373
374 addPart(teamOrPersonBaseDetailSection);
375 }
376
377 private void createTeamDetailSection(RootElement parent){
378 destroySections();
379 TeamDetailSection teamDetailSection = (TeamDetailSection)
380 formFactory.createCdmDetailSection(DetailType.TEAM, getConversationHolder(), parent, this, Section.TWISTIE | Section.EXPANDED);
381
382 addPart(teamDetailSection);
383 }
384
385
386 private void createPersonDetailSection(RootElement parent) {
387 destroySections();
388 PersonDetailSection personDetailSection = (PersonDetailSection)
389 formFactory.createCdmDetailSection(DetailType.PERSON, getConversationHolder(), parent, this, Section.TWISTIE | Section.EXPANDED);
390 addPart(personDetailSection);
391 }
392
393 private void createDescriptionElementSection(RootElement parent) {
394 destroySections();
395
396 DescriptionElementDetailSection descriptionElementDetailSection = (DescriptionElementDetailSection)
397 formFactory.createCdmDetailSection(DetailType.DESCRIPTIONELEMENT, getConversationHolder(), parent, this, Section.TWISTIE | Section.EXPANDED);
398
399 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
400
401 DescriptionElementSourceSection descriptionElementSourceSection = (DescriptionElementSourceSection)
402 formFactory.createEntityDetailSection(EntityDetailType.DESCRIPTIONELEMENTSOURCE, getConversationHolder(), parent, Section.TWISTIE);
403
404 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
405
406 DescriptionElementMediaSection descriptionElementMediaSection = (DescriptionElementMediaSection)
407 formFactory.createEntityDetailSection(EntityDetailType.DESCRIPTIONELEMENTMEDIA, getConversationHolder(), parent, Section.TWISTIE);
408
409 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
410
411 addPart(descriptionElementDetailSection);
412 addPart(descriptionElementSourceSection);
413 addPart(descriptionElementMediaSection);
414 }
415
416 private void createDescriptionSection(RootElement parent) {
417 destroySections();
418 DescriptionDetailSection descriptionDetailSection = (DescriptionDetailSection)
419 formFactory.createCdmDetailSection(DetailType.DESCRIPTION, getConversationHolder(), parent, this, Section.TWISTIE | Section.EXPANDED);
420
421 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
422
423 NaturalLanguageSection naturalLanguageSection = (NaturalLanguageSection)
424 formFactory.createCdmDetailSection(DetailType.NATURAL_LANGUAGE, getConversationHolder(), parent, this,Section.TWISTIE | Section.EXPANDED);
425
426 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
427
428 DescribedSpecimenSection describedSpecimenSection = (DescribedSpecimenSection)
429 formFactory.createEntityDetailSection(EntityDetailType.DESCRIBED_SPECIMEN, getConversationHolder(), parent, Section.TWISTIE);
430
431 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
432
433 DescriptionSourceSection descriptionSourceSection = (DescriptionSourceSection)
434 formFactory.createEntityDetailSection(EntityDetailType.DESCRIPTIONSOURCE, getConversationHolder(), parent, Section.TWISTIE);
435
436 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
437
438 ScopeSection scopeSection = (ScopeSection)
439 formFactory.createEntityDetailSection(EntityDetailType.SCOPE, getConversationHolder(), parent, Section.TWISTIE);
440
441 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
442
443 addPart(descriptionDetailSection);
444 addPart(naturalLanguageSection);
445 addPart(describedSpecimenSection);
446 addPart(descriptionSourceSection);
447 addPart(scopeSection);
448 }
449
450
451 private void createMediaElementSection(RootElement parent) {
452 destroySections();
453 MediaDetailsSection mediaDetailSection = (MediaDetailsSection)
454 formFactory.createCdmDetailSection(DetailType.MEDIA, getConversationHolder(), parent, this, Section.TWISTIE | Section.EXPANDED);
455
456 addPart(mediaDetailSection);
457 }
458
459 private void createDerivedUnitBaseElementSection(RootElement parent){
460 destroySections();
461
462 GeneralDetailSection generalDetailSection = (GeneralDetailSection)
463 formFactory.createCdmDetailSection(DetailType.DERIVED_UNIT_GENERAL, getConversationHolder(), parent, this, Section.TWISTIE | Section.EXPANDED);
464
465 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
466
467 GatheringEventDetailSection gatheringEventDetailSection = (GatheringEventDetailSection)
468 formFactory.createCdmDetailSection(DetailType.GATHERING_EVENT, getConversationHolder(), parent, this, Section.TWISTIE);
469
470 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
471
472 FieldObservationDetailSection fieldObservationDetailSection = (FieldObservationDetailSection)
473 formFactory.createCdmDetailSection(DetailType.FIELD_OBSERVATION, getConversationHolder(), parent, this, Section.TWISTIE);
474
475 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
476
477 DerivedUnitBaseDetailSection derivedUnitBaseDetailSection = (DerivedUnitBaseDetailSection)
478 formFactory.createCdmDetailSection(DetailType.DERIVED_UNIT, getConversationHolder(), parent, this, Section.TWISTIE);
479
480 addPart(generalDetailSection);
481 addPart(gatheringEventDetailSection);
482 addPart(fieldObservationDetailSection);
483 addPart(derivedUnitBaseDetailSection);
484 }
485
486 /**
487 * @param rootElement
488 */
489 private void createFeatureDistributionSection(RootElement parent) {
490 destroySections();
491
492 FeatureDistributionDetailSection featureDistributionSection = (FeatureDistributionDetailSection)
493 formFactory.createCdmDetailSection(DetailType.FEATURE_DISTRIBUTION, getConversationHolder(), parent, this, Section.TWISTIE | Section.EXPANDED);
494
495 addPart(featureDistributionSection);
496 }
497
498
499
500 private void createPolytomousKeySection(RootElement parent) {
501 destroySections();
502
503 PolytomousKeyDetailSection polytomousKeyDetailSection = (PolytomousKeyDetailSection)
504 formFactory.createCdmDetailSection(DetailType.POLYTOMOUS_KEY, getConversationHolder(), parent, this, Section.TWISTIE | Section.EXPANDED);
505
506 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
507
508 GeographicalScopeDetailSection geographicalScopeDetailSection = (GeographicalScopeDetailSection)
509 formFactory.createEntityDetailSection(EntityDetailType.GEOGRAPHICAL_SCOPE, getConversationHolder(), parent, Section.TWISTIE);
510
511 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
512
513 ScopeRestrictionSection scopeRestrictionSection = (ScopeRestrictionSection)
514 formFactory.createEntityDetailSection(EntityDetailType.SCOPE_RESTRICTION, getConversationHolder(), parent, Section.TWISTIE);
515
516 addPart(polytomousKeyDetailSection);
517 addPart(geographicalScopeDetailSection);
518 addPart(scopeRestrictionSection);
519 }
520
521 private void createPolytomousKeyNodeSection(RootElement parent) {
522 destroySections();
523
524 PolytomousKeyNodeDetailSection polytomousKeyNodeDetailSection = (PolytomousKeyNodeDetailSection)
525 formFactory.createCdmDetailSection(DetailType.POLYTOMOUS_KEY_NODE, getConversationHolder(), parent, this, Section.TWISTIE | Section.EXPANDED);
526
527 addPart(polytomousKeyNodeDetailSection);
528 }
529 }