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