merged/implemented cdm3.3 model adaptations
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / view / detail / DetailsViewer.java
1 // $Id$
2 /**
3 * Copyright (C) 2011 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.view.detail;
12
13 import java.util.Set;
14
15 import org.eclipse.jface.viewers.ISelection;
16 import org.eclipse.jface.viewers.SelectionChangedEvent;
17 import org.eclipse.swt.SWT;
18 import org.eclipse.swt.widgets.Composite;
19 import org.eclipse.ui.forms.widgets.ExpandableComposite;
20
21 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
22 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeNotSupportedException;
23 import eu.etaxonomy.cdm.api.service.ITermService;
24 import eu.etaxonomy.cdm.model.agent.Person;
25 import eu.etaxonomy.cdm.model.agent.Team;
26 import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
27 import eu.etaxonomy.cdm.model.common.DefinedTermBase;
28 import eu.etaxonomy.cdm.model.common.Group;
29 import eu.etaxonomy.cdm.model.common.Marker;
30 import eu.etaxonomy.cdm.model.common.MarkerType;
31 import eu.etaxonomy.cdm.model.common.TermVocabulary;
32 import eu.etaxonomy.cdm.model.common.User;
33 import eu.etaxonomy.cdm.model.description.CategoricalData;
34 import eu.etaxonomy.cdm.model.description.DescriptionBase;
35 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
36 import eu.etaxonomy.cdm.model.description.PolytomousKey;
37 import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
38 import eu.etaxonomy.cdm.model.media.Media;
39 import eu.etaxonomy.cdm.model.name.NonViralName;
40 import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
41 import eu.etaxonomy.cdm.model.reference.Reference;
42 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
43 import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
44 import eu.etaxonomy.taxeditor.editor.UsageTermCollection;
45 import eu.etaxonomy.taxeditor.model.AbstractUtility;
46 import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
47 import eu.etaxonomy.taxeditor.model.PolytomousKeyRelationship;
48 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
49 import eu.etaxonomy.taxeditor.store.CdmStore;
50 import eu.etaxonomy.taxeditor.ui.campanula.detailViews.fieldObservation.FieldObservationSection;
51 import eu.etaxonomy.taxeditor.ui.campanula.detailViews.specimen.SpecimenSection;
52 import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
53 import eu.etaxonomy.taxeditor.ui.element.RootElement;
54 import eu.etaxonomy.taxeditor.ui.section.agent.PersonDetailSection;
55 import eu.etaxonomy.taxeditor.ui.section.agent.TeamDetailSection;
56 import eu.etaxonomy.taxeditor.ui.section.agent.TeamOrPersonBaseDetailSection;
57 import eu.etaxonomy.taxeditor.ui.section.common.ReferencedEntityDetailSection;
58 import eu.etaxonomy.taxeditor.ui.section.description.DescribedSpecimenSection;
59 import eu.etaxonomy.taxeditor.ui.section.description.DescriptionDetailSection;
60 import eu.etaxonomy.taxeditor.ui.section.description.DescriptionElementDetailSection;
61 import eu.etaxonomy.taxeditor.ui.section.description.DescriptionElementMediaSection;
62 import eu.etaxonomy.taxeditor.ui.section.description.DescriptionElementSourceSection;
63 import eu.etaxonomy.taxeditor.ui.section.description.DescriptionSourceSection;
64 import eu.etaxonomy.taxeditor.ui.section.description.MediaDetailsSection;
65 import eu.etaxonomy.taxeditor.ui.section.description.NaturalLanguageSection;
66 import eu.etaxonomy.taxeditor.ui.section.description.ScopeSection;
67 import eu.etaxonomy.taxeditor.ui.section.feature.FeatureDistributionDetailSection;
68 import eu.etaxonomy.taxeditor.ui.section.grantedAuthority.GrantedAuthorityDetailSection;
69 import eu.etaxonomy.taxeditor.ui.section.group.GroupDetailSection;
70 import eu.etaxonomy.taxeditor.ui.section.group.MemberDetailSection;
71 import eu.etaxonomy.taxeditor.ui.section.key.PolytomousKeyDetailSection;
72 import eu.etaxonomy.taxeditor.ui.section.key.PolytomousKeyNodeDetailSection;
73 import eu.etaxonomy.taxeditor.ui.section.key.TaxonomicScopeSection;
74 import eu.etaxonomy.taxeditor.ui.section.name.NameRelationshipDetailSection;
75 import eu.etaxonomy.taxeditor.ui.section.name.NomenclaturalStatusSection;
76 import eu.etaxonomy.taxeditor.ui.section.name.NonViralNameDetailSection;
77 import eu.etaxonomy.taxeditor.ui.section.name.ProtologueSection;
78 import eu.etaxonomy.taxeditor.ui.section.name.TypeDesignationSection;
79 import eu.etaxonomy.taxeditor.ui.section.occurrence.FieldObservationDetailSection;
80 import eu.etaxonomy.taxeditor.ui.section.occurrence.GatheringEventDetailSection;
81 import eu.etaxonomy.taxeditor.ui.section.reference.NomenclaturalReferenceDetailSection;
82 import eu.etaxonomy.taxeditor.ui.section.reference.ReferenceDetailSection;
83 import eu.etaxonomy.taxeditor.ui.section.taxon.ParsingMessagesSection;
84 import eu.etaxonomy.taxeditor.ui.section.taxon.TaxonBaseDetailSection;
85 import eu.etaxonomy.taxeditor.ui.section.taxon.TaxonRelationshipDetailSection;
86 import eu.etaxonomy.taxeditor.ui.section.user.GroupsByUserDetailSection;
87 import eu.etaxonomy.taxeditor.ui.section.user.UserDetailSection;
88 import eu.etaxonomy.taxeditor.ui.section.userecords.UseRecordDetailSection;
89 import eu.etaxonomy.taxeditor.ui.section.vocabulary.TermVocabularyDetailSection;
90 import eu.etaxonomy.taxeditor.view.AbstractCdmDataViewer;
91 import eu.etaxonomy.taxeditor.view.AbstractCdmViewPart;
92
93 /**
94 *
95 * The DetailsViewer handles the content of the details view (
96 * {@link DetailsViewPart}).<br>
97 * Depending on the type of the selected element the section of the details view
98 * are created.
99 *
100 * @author n.hoffmann
101 * @created Feb 12, 2010
102 * @version 1.0
103 */
104 public class DetailsViewer extends AbstractCdmDataViewer {
105
106 private ISelection selection;
107
108 /**
109 * <p>
110 * Constructor for DetailsViewer.
111 * </p>
112 *
113 * @param parent
114 * a {@link org.eclipse.swt.widgets.Composite} object.
115 * @param viewPart
116 * a {@link eu.etaxonomy.taxeditor.view.AbstractCdmViewPart}
117 * object.
118 */
119 public DetailsViewer(Composite parent, AbstractCdmViewPart viewPart) {
120 super(parent, viewPart);
121 }
122
123 // START HACK TO MAKE THE DERIVED UNIT FACADE WORK
124 // since we are getting implementations of DerivedUnitBase from the bulk
125 // editor
126 // and not derived unit facade objects,
127
128 /*
129 * (non-Javadoc)
130 *
131 * @see
132 * eu.etaxonomy.taxeditor.editor.view.AbstractCdmDataViewer#setInput(java
133 * .lang.Object)
134 */
135 @Override
136 public void setInput(Object input) {
137 if (input instanceof DerivedUnit) {
138 try {
139 input = DerivedUnitFacade.NewInstance((DerivedUnit) input,
140 PreferencesUtil.getDerivedUnitConfigurator());
141 } catch (DerivedUnitFacadeNotSupportedException e) {
142 AbstractUtility.error(getClass(), e);
143 }
144 }
145 super.setInput(input);
146 }
147
148 @Override
149 protected void markViewPartDirty() {
150 if (getInput() instanceof DerivedUnitFacade) {
151 getViewPart().changed(((DerivedUnitFacade) getInput()).innerDerivedUnit());
152 }
153
154 super.markViewPartDirty();
155 }
156
157 // END HACK TO MAKE THE DERIVED UNIT FACADE WORK
158
159 /*
160 * (non-Javadoc)
161 *
162 * @see org.eclipse.jface.viewers.Viewer#refresh()
163 */
164 /** {@inheritDoc} */
165 @Override
166 protected void showParts() {
167 // FIXME (CM) : Need to clean out this code.
168 // Too much type checking to decide which detail view to display.
169 // Need to build in a mechanism where navigators / editors are 'aware'
170 // of the corresponding detail viewer.
171 Object input = getInput();
172 if (input instanceof TaxonBase) {
173 createTaxonSections(rootElement);
174
175 } else if (input instanceof NonViralName) {
176 createNameSections(rootElement);
177
178 } else if (input instanceof Reference) {
179 createReferenceSections(rootElement);
180
181 } else if (input instanceof Team) {
182 createTeamDetailSection(rootElement);
183
184 } else if (input instanceof Person) {
185 createPersonDetailSection(rootElement);
186
187 } else if (input instanceof TeamOrPersonBase) {
188 createTeamOrPersonBaseDetailSection(rootElement);
189
190 } else if (input instanceof DescriptionBase) {
191 Set<Marker> descriptionMarkers = ((DescriptionBase) input).getMarkers();
192 MarkerType useMarkertype = (MarkerType) CdmStore.getService(ITermService.class).find(
193 UsageTermCollection.uuidUseMarkerType);
194 Boolean isUseDescription = false;
195 for (Marker marker : descriptionMarkers) {
196 if (marker.getMarkerType().equals(useMarkertype)) {
197 isUseDescription = true;
198 }
199 }
200 if (((DescriptionBase) input).isImageGallery()) {
201 createImageGallerySection(rootElement);
202
203 } else if (isUseDescription) {
204 createUseDescriptionSection(rootElement);
205 } else {
206 createDescriptionSection(rootElement);
207
208 }
209 } else if (input instanceof DescriptionElementBase) {
210 Set<Marker> descriptionMarkers = ((DescriptionElementBase) input).getInDescription().getMarkers();
211 MarkerType useMarkertype = (MarkerType) CdmStore.getService(ITermService.class).find(
212 UsageTermCollection.uuidUseMarkerType);
213 Boolean isUseDescription = false;
214 for (Marker marker : descriptionMarkers) {
215 if (marker.getMarkerType().equals(useMarkertype)) {
216 isUseDescription = true;
217 }
218 }
219
220 if (isUseDescription == true && input instanceof CategoricalData) {
221 createUseRecordSection(rootElement);
222 } else {
223 createDescriptionElementSection(rootElement);
224 }
225
226 } else if (input instanceof Media) {
227 createMediaElementSection(rootElement);
228
229 } else if (input instanceof DerivedUnitFacade) {
230 createDerivedUnitBaseElementSection(rootElement);
231
232 } else if (input instanceof FeatureNodeContainer) {
233 createFeatureDistributionSection(rootElement);
234
235 } else if (input instanceof PolytomousKey) {
236 // createPolytomousKeySection(rootElement);
237
238 } else if ((input instanceof PolytomousKeyNode) || (input instanceof PolytomousKeyRelationship)) {
239 createPolytomousKeyNodeSection(rootElement);
240 } else if (input instanceof User) {
241 createUserSection(rootElement);
242 } else if (input instanceof Group) {
243 createGroupSection(rootElement);
244 } else if (input instanceof TaxonRelationship) {
245 createTaxonRelationshipSection(rootElement);
246 } else if (input instanceof TermVocabulary) {
247 createTermVocabularySection(rootElement);
248 } else if (input instanceof DefinedTermBase) {
249 createDefinedTermSection(rootElement);
250 } else {
251 destroySections();
252 }
253 layout();
254 }
255
256 /**
257 * @param rootElement
258 */
259 private void createGroupSection(RootElement parent) {
260 destroySections();
261
262 GroupDetailSection groupDetailSection = formFactory.createGroupDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE| ExpandableComposite.EXPANDED);
263 MemberDetailSection memberDetailSection = formFactory.createMemberDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
264 GrantedAuthorityDetailSection grantedAuthorityDetailSection = formFactory.createGrantedAuthorityDetailSection(getConversationHolder(), parent,ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
265
266 addPart(groupDetailSection);
267 addPart(memberDetailSection);
268 addPart(grantedAuthorityDetailSection);
269 }
270
271 /*
272 * (non-Javadoc)
273 *
274 * @see org.eclipse.jface.viewers.Viewer#getSelection()
275 */
276 /** {@inheritDoc} */
277 @Override
278 public ISelection getSelection() {
279 return selection;
280 }
281
282 /*
283 * (non-Javadoc)
284 *
285 * @see
286 * org.eclipse.jface.viewers.Viewer#setSelection(org.eclipse.jface.viewers
287 * .ISelection, boolean)
288 */
289 /** {@inheritDoc} */
290 @Override
291 public void setSelection(ISelection selection, boolean reveal) {
292 this.selection = selection;
293 SelectionChangedEvent selectionChangedEvent = new SelectionChangedEvent(this, selection);
294 fireSelectionChanged(selectionChangedEvent);
295 }
296
297 /**
298 * createTaxonSections(RootElement parent)
299 *
300 * @param parent
301 */
302 private void createTaxonSections(RootElement parent) {
303 destroySections();
304
305 TaxonBaseDetailSection taxonBaseDetailSection = formFactory.createTaxonBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
306
307 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
308
309 NonViralNameDetailSection nonViralNameSection = formFactory.createNonViralNameDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE
310 | ExpandableComposite.EXPANDED);
311
312 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
313
314 NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
315
316 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
317
318 NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent,ExpandableComposite.TWISTIE);
319
320 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
321
322 ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
323
324 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
325
326 TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
327
328 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
329
330 NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
331
332 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
333
334 ParsingMessagesSection parsingMessagesSection = formFactory.createParsingMessagesSection(getConversationHolder(), parent, this, ExpandableComposite.EXPANDED);
335
336 addPart(taxonBaseDetailSection);
337 addPart(nonViralNameSection);
338 addPart(nomenclaturalStatusSection);
339 addPart(protologSection);
340 addPart(referenceDetailSection);
341 addPart(typeDesignationSection);
342 addPart(nameRelationshipSection);
343 addPart(parsingMessagesSection);
344 }
345
346 /**
347 * createNameSections
348 *
349 * @param parent
350 */
351 private void createNameSections(RootElement parent) {
352 destroySections();
353 NonViralNameDetailSection nonViralNameSection = formFactory.createNonViralNameDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
354
355 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
356
357 NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
358
359 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
360
361 NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
362
363 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
364
365 ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
366
367 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
368
369 TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
370
371 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
372
373 NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
374
375 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
376
377 addPart(nonViralNameSection);
378 addPart(nomenclaturalStatusSection);
379 addPart(protologSection);
380 addPart(referenceDetailSection);
381 addPart(typeDesignationSection);
382 addPart(nameRelationshipSection);
383 }
384
385 /**
386 * createReferenceSections
387 *
388 * @param parent
389 */
390 private void createReferenceSections(RootElement parent) {
391 destroySections();
392
393 ReferenceDetailSection referenceDetailSection = formFactory.createReferenceDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
394
395 addPart(referenceDetailSection);
396 }
397
398 /**
399 * createTeamOrPersonBaseDetailSection
400 *
401 * @param parent
402 */
403 private void createTeamOrPersonBaseDetailSection(RootElement parent) {
404 destroySections();
405 TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection = formFactory.createTeamOrPersonBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
406
407 addPart(teamOrPersonBaseDetailSection);
408 }
409
410 /**
411 * createTeamDetailSection
412 *
413 * @param parent
414 */
415 private void createTeamDetailSection(RootElement parent) {
416 destroySections();
417 TeamDetailSection teamDetailSection = formFactory.createTeamDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
418
419 addPart(teamDetailSection);
420 }
421
422 /**
423 * createPersonDetailSection
424 *
425 * @param parent
426 */
427 private void createPersonDetailSection(RootElement parent) {
428 destroySections();
429 PersonDetailSection personDetailSection = formFactory.createPersonDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
430 addPart(personDetailSection);
431 }
432
433 /**
434 * createDescriptionElementSection
435 *
436 * @param parent
437 */
438 private void createDescriptionElementSection(RootElement parent) {
439 destroySections();
440
441 DescriptionElementDetailSection descriptionElementDetailSection = formFactory.createDescriptionElementDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
442
443 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
444
445 DescriptionElementSourceSection descriptionElementSourceSection = formFactory.createDescriptionElementSourceSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
446
447 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
448
449 DescriptionElementMediaSection descriptionElementMediaSection = formFactory.createDescriptionElementMediaSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
450
451 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
452
453 addPart(descriptionElementDetailSection);
454 addPart(descriptionElementSourceSection);
455 addPart(descriptionElementMediaSection);
456 }
457
458 /**
459 * createDescriptionSection
460 *
461 * @param parent
462 */
463 private void createDescriptionSection(RootElement parent) {
464 destroySections();
465 DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
466
467 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
468
469 NaturalLanguageSection naturalLanguageSection = formFactory.createNaturalLanguageSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
470
471 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
472
473 DescribedSpecimenSection describedSpecimenSection = formFactory.createDescribedSpecimenSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
474
475 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
476
477 // DescriptionSourceSection descriptionSourceSection = formFactory.createDescriptionSourceSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
478 //
479 // formFactory.createHorizontalSeparator(parent, SWT.BORDER);
480
481 ScopeSection scopeSection = formFactory.createScopeSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
482
483 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
484
485 addPart(descriptionDetailSection);
486 addPart(naturalLanguageSection);
487 addPart(describedSpecimenSection);
488 // addPart(descriptionSourceSection);
489 addPart(scopeSection);
490 }
491
492 /**
493 * Creates the use Description section
494 *
495 * @param parent
496 */
497 private void createUseDescriptionSection(RootElement parent) {
498 destroySections();
499 DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
500
501 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
502
503 DescriptionSourceSection descriptionSourceSection = formFactory.createDescriptionSourceSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
504
505 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
506
507 addPart(descriptionDetailSection);
508 addPart(descriptionSourceSection);
509
510 }
511
512 /**
513 * @param rootElement
514 */
515 private void createImageGallerySection(RootElement parent) {
516 destroySections();
517 DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
518
519 addPart(descriptionDetailSection);
520 }
521
522 /**
523 * createMediaElementSection
524 *
525 * @param parent
526 */
527
528 private void createMediaElementSection(RootElement parent) {
529 destroySections();
530 MediaDetailsSection mediaDetailSection = formFactory.createMediaDetailsSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
531
532 addPart(mediaDetailSection);
533 }
534
535 /**
536 * createDerivedUnitBaseElementSection
537 *
538 * @param parent
539 */
540 private void createDerivedUnitBaseElementSection(RootElement parent) {
541 destroySections();
542
543 FieldObservationSection fieldObservationSection = formFactory.createFieldObservationSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
544
545 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
546
547 GatheringEventDetailSection gatheringEventDetailSection = formFactory.createGatheringEventDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
548
549 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
550
551 FieldObservationDetailSection fieldObservationDetailSection = formFactory.createFieldObservationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
552
553 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
554
555 SpecimenSection specimenSection = formFactory.createSpecimenSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
556
557 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
558
559
560 // DerivedUnitBaseDetailSection derivedUnitBaseDetailSection = formFactory.createDerivedUnitBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
561 //
562 // formFactory.createHorizontalSeparator(parent, SWT.BORDER);
563 //
564 // DeterminationDetailSection determinationDetailSection = formFactory.createDeterminationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
565
566 addPart(fieldObservationSection);
567 addPart(gatheringEventDetailSection);
568 addPart(fieldObservationDetailSection);
569 addPart(specimenSection);
570 // addPart(derivedUnitBaseDetailSection);
571 // addPart(determinationDetailSection);
572 }
573
574 /**
575 * @param rootElement
576 */
577 private void createFeatureDistributionSection(RootElement parent) {
578 destroySections();
579
580 FeatureDistributionDetailSection featureDistributionSection = formFactory.createFeatureDistributionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
581
582 addPart(featureDistributionSection);
583 }
584
585 /**
586 * createPolytomousKeyNodeSection
587 *
588 * @param parent
589 */
590 private void createPolytomousKeyNodeSection(RootElement parent) {
591 destroySections();
592
593 PolytomousKeyDetailSection polytomousKeyDetailSection = formFactory.createPolytomousKeyDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.COMPACT);
594
595 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
596
597 PolytomousKeyNodeDetailSection polytomousKeyNodeDetailSection = formFactory.createPolytomousKeyNodeDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
598
599 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
600
601 TaxonomicScopeSection taxonomicScopeSection = formFactory.createTaxonomicScopeSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.COMPACT);
602
603 addPart(polytomousKeyDetailSection);
604 addPart(polytomousKeyNodeDetailSection);
605 addPart(taxonomicScopeSection);
606
607 }
608
609 /**
610 * create the UseRecordSection
611 *
612 * @param parent
613 */
614 private void createUseRecordSection(RootElement parent) {
615 destroySections();
616
617 UseRecordDetailSection descriptionUseRecordSection = formFactory.createUseRecordDetailSection(getConversationHolder(), parent, this,ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
618
619 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
620
621 addPart(descriptionUseRecordSection);
622
623 }
624
625 /**
626 * createUserSection
627 *
628 * @param parent
629 */
630 private void createUserSection(RootElement parent) {
631 destroySections();
632
633 UserDetailSection userDetailSection = formFactory.createUserDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
634
635 GroupsByUserDetailSection groupByUserDetailSection = formFactory.createGroupsByUserDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
636
637 addPart(userDetailSection);
638 addPart(groupByUserDetailSection);
639 }
640
641 /**
642 * createTaxonRelationshipSection
643 *
644 * @param parent
645 */
646 private void createTaxonRelationshipSection(RootElement parent) {
647 destroySections();
648
649 TaxonRelationshipDetailSection taxonRelationshipDetailSection = formFactory.createTaxonRelationshipDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
650
651 ReferencedEntityDetailSection referencedEntityBaseDetailSection = formFactory.createReferencedEntityDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
652 addPart(taxonRelationshipDetailSection);
653 addPart(referencedEntityBaseDetailSection);
654 }
655
656 /**
657 * @param rootElement
658 */
659 private void createTermVocabularySection(RootElement parent) {
660 destroySections();
661
662 TermVocabularyDetailSection termVocabularyDetailSection = formFactory.createTermVocabularyDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
663 addPart(termVocabularyDetailSection);
664 }
665
666 /**
667 * createDefinedTermSection
668 *
669 * @param parent
670 */
671 private void createDefinedTermSection(RootElement parent) {
672 destroySections();
673
674 AbstractFormSection definedTermDetailSection = formFactory.createDefinedTermDetailSection(getInput().getClass(), getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
675 addPart(definedTermDetailSection);
676 }
677 }