2 * Copyright (C) 2011 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
9 package eu
.etaxonomy
.taxeditor
.view
.e4
.details
;
11 import java
.util
.Collection
;
12 import java
.util
.EnumSet
;
13 import java
.util
.HashSet
;
16 import javax
.inject
.Inject
;
18 import org
.eclipse
.e4
.core
.di
.annotations
.Optional
;
19 import org
.eclipse
.e4
.ui
.di
.UIEventTopic
;
20 import org
.eclipse
.jface
.viewers
.ISelection
;
21 import org
.eclipse
.jface
.viewers
.IStructuredSelection
;
22 import org
.eclipse
.jface
.viewers
.SelectionChangedEvent
;
23 import org
.eclipse
.jface
.viewers
.TreeNode
;
24 import org
.eclipse
.swt
.SWT
;
25 import org
.springframework
.security
.core
.GrantedAuthority
;
27 import eu
.etaxonomy
.cdm
.api
.facade
.DerivedUnitFacade
;
28 import eu
.etaxonomy
.cdm
.api
.facade
.DerivedUnitFacadeNotSupportedException
;
29 import eu
.etaxonomy
.cdm
.ext
.occurrence
.gbif
.GbifResponse
;
30 import eu
.etaxonomy
.cdm
.model
.agent
.Person
;
31 import eu
.etaxonomy
.cdm
.model
.agent
.Team
;
32 import eu
.etaxonomy
.cdm
.model
.agent
.TeamOrPersonBase
;
33 import eu
.etaxonomy
.cdm
.model
.common
.Marker
;
34 import eu
.etaxonomy
.cdm
.model
.description
.CategoricalData
;
35 import eu
.etaxonomy
.cdm
.model
.description
.Character
;
36 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionBase
;
37 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionElementBase
;
38 import eu
.etaxonomy
.cdm
.model
.description
.Distribution
;
39 import eu
.etaxonomy
.cdm
.model
.description
.PolytomousKeyNode
;
40 import eu
.etaxonomy
.cdm
.model
.description
.SpecimenDescription
;
41 import eu
.etaxonomy
.cdm
.model
.description
.TaxonDescription
;
42 import eu
.etaxonomy
.cdm
.model
.media
.Media
;
43 import eu
.etaxonomy
.cdm
.model
.molecular
.DnaSample
;
44 import eu
.etaxonomy
.cdm
.model
.molecular
.Sequence
;
45 import eu
.etaxonomy
.cdm
.model
.molecular
.SingleRead
;
46 import eu
.etaxonomy
.cdm
.model
.name
.TaxonName
;
47 import eu
.etaxonomy
.cdm
.model
.occurrence
.DerivedUnit
;
48 import eu
.etaxonomy
.cdm
.model
.occurrence
.FieldUnit
;
49 import eu
.etaxonomy
.cdm
.model
.occurrence
.MediaSpecimen
;
50 import eu
.etaxonomy
.cdm
.model
.occurrence
.SpecimenOrObservationType
;
51 import eu
.etaxonomy
.cdm
.model
.permission
.CRUD
;
52 import eu
.etaxonomy
.cdm
.model
.permission
.Group
;
53 import eu
.etaxonomy
.cdm
.model
.permission
.User
;
54 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
55 import eu
.etaxonomy
.cdm
.model
.taxon
.Synonym
;
56 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
57 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonBase
;
58 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonNode
;
59 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonRelationship
;
60 import eu
.etaxonomy
.cdm
.model
.term
.DefinedTermBase
;
61 import eu
.etaxonomy
.cdm
.model
.term
.TermNode
;
62 import eu
.etaxonomy
.cdm
.model
.term
.TermTree
;
63 import eu
.etaxonomy
.cdm
.model
.term
.TermType
;
64 import eu
.etaxonomy
.cdm
.model
.term
.TermVocabulary
;
65 import eu
.etaxonomy
.cdm
.persistence
.dto
.TermNodeDto
;
66 import eu
.etaxonomy
.cdm
.persistence
.dto
.TermTreeDto
;
67 import eu
.etaxonomy
.cdm
.persistence
.hibernate
.CdmDataChangeMap
;
68 import eu
.etaxonomy
.taxeditor
.editor
.IDistributionEditorPart
;
69 import eu
.etaxonomy
.taxeditor
.event
.WorkbenchEventConstants
;
70 import eu
.etaxonomy
.taxeditor
.l10n
.Messages
;
71 import eu
.etaxonomy
.taxeditor
.model
.AbstractUtility
;
72 import eu
.etaxonomy
.taxeditor
.model
.FeatureNodeContainer
;
73 import eu
.etaxonomy
.taxeditor
.model
.IDerivedUnitFacadePart
;
74 import eu
.etaxonomy
.taxeditor
.model
.MessagingUtils
;
75 import eu
.etaxonomy
.taxeditor
.model
.PolytomousKeyRelationship
;
76 import eu
.etaxonomy
.taxeditor
.preference
.NameDetailsConfigurator
;
77 import eu
.etaxonomy
.taxeditor
.preference
.PreferencesUtil
;
78 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
79 import eu
.etaxonomy
.taxeditor
.store
.StoreUtil
;
80 import eu
.etaxonomy
.taxeditor
.store
.UsageTermCollection
;
81 import eu
.etaxonomy
.taxeditor
.termtree
.e4
.ICharacterEditor
;
82 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
83 import eu
.etaxonomy
.taxeditor
.ui
.element
.RootElement
;
84 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailSection
;
85 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailSection
;
86 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamOrPersonBaseDetailSection
;
87 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferencedEntityDetailSection
;
88 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailSection
;
89 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailElement
;
90 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailSection
;
91 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementMediaSection
;
92 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceSection
;
93 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceSection
;
94 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.MediaDetailsSection
;
95 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageSection
;
96 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeSection
;
97 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.DistributionDetailElement
;
98 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.CharacterDetailSection
;
99 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.CharacterNodeDetailSection
;
100 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.CharacterNodeDtoDetailSection
;
101 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailSection
;
102 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.TermNodeDetailSection
;
103 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.TermTreeDetailSection
;
104 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.TermTreeDetailSectionForNode
;
105 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailSection
;
106 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailSection
;
107 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailSection
;
108 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailSection
;
109 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailSection
;
110 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailSection
;
111 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusSection
;
112 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailSection
;
113 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.TypeDesignationSection
;
114 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitBaseDetailSection
;
115 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitGeneralDetailSection
;
116 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailSection
;
117 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitDetailSection
;
118 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitGeneralDetailSection
;
119 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailSection
;
120 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.association
.DerivedUnitTypeDesignationSection
;
121 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.association
.TaxonAssociationDetailSection
;
122 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaQualityDetailSection
;
123 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaSampleGeneralDetailSection
;
124 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaSamplePreparationPreservationSection
;
125 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SampleDesignationDetailSection
;
126 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceContigFileCollectionDetailSection
;
127 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceGeneralDetailSection
;
128 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceReferenceCollectionDetailSection
;
129 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SingleReadGeneralDetailSection
;
130 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SingleReadPherogramCollectionDetailSection
;
131 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.TissueSampleGeneralDetailSection
;
132 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.media
.MediaSpecimenGeneralDetailSection
;
133 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailSection
;
134 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailSection
;
135 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.RightsSection
;
136 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.identifier
.DerivedUnitFacadeIdentifierSection
;
137 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessagesSection
;
138 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailSection
;
139 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailSection
;
140 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailSection
;
141 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailSection
;
142 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailSection
;
143 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.DefinedTermDetailSection
;
144 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermMediaSection
;
145 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailSection
;
146 import eu
.etaxonomy
.taxeditor
.view
.detail
.CdmSectionPart
;
147 import eu
.etaxonomy
.taxeditor
.view
.e4
.AbstractCdmDataViewerE4
;
150 * The DetailsViewer handles the content of the details view (
151 * {@link DetailsPartE4}).<br>
152 * Depending on the type of the selected element the section of the details view
158 public class DetailsViewerE4
extends AbstractCdmDataViewerE4
{
160 private ISelection selection
;
161 private boolean detailsEnabled
= true;
162 private Object activePart
;
164 public boolean isDetailsEnabled() {
165 return detailsEnabled
;
168 public void setDetailsEnabled(boolean detailsEnabled
) {
169 this.detailsEnabled
= detailsEnabled
;
172 public void setInput(Object input
, Object activePart
) {
173 this.activePart
= activePart
;
177 // START HACK TO MAKE THE DERIVED UNIT FACADE WORK
178 // since we are getting implementations of DerivedUnitBase from the bulk
180 // and not derived unit facade objects,
183 public void setInput(Object input
) {
185 if(input
instanceof TreeNode
){
186 input
= ((TreeNode
) input
).getValue();
188 if(input
instanceof GbifResponse
){
189 input
= ((GbifResponse
) input
).getDerivedUnitFacade();
191 if (input
instanceof MediaSpecimen
&& !(this.activePart
.getClass().getSimpleName().equals("BulkEditorE4"))){
193 }else if (input
instanceof DerivedUnit
) {
194 DerivedUnit derivedUnit
= (DerivedUnit
)input
;
196 input
= DerivedUnitFacade
.NewInstance(derivedUnit
,
197 PreferencesUtil
.getDerivedUnitConfigurator());
198 } catch (DerivedUnitFacadeNotSupportedException e
) {
199 MessagingUtils
.error(getClass(), e
); //nothing should happen, later on the Details View will show an according information that it is not possible to open this data
202 else if(input
instanceof FieldUnit
){
203 input
= DerivedUnitFacade
.NewInstance(SpecimenOrObservationType
.FieldUnit
, (FieldUnit
) input
);
205 super.setInput(input
);
209 protected void markViewPartDirty() {
210 if (getInput() instanceof DerivedUnitFacade
) {
211 if(part
instanceof IDerivedUnitFacadePart
){
212 part
.changed(getInput());
215 DerivedUnitFacade facade
= (DerivedUnitFacade
) getInput();
216 if(facade
.innerDerivedUnit()!=null){
217 part
.changed(facade
.innerDerivedUnit());
219 else if(facade
.innerFieldUnit()!=null){
220 part
.changed(facade
.innerFieldUnit());
225 super.markViewPartDirty();
230 protected void showParts() {
231 // FIXME (CM) : Need to clean out this code.
232 // Too much type checking to decide which detail view to display.
233 // Need to build in a mechanism where navigators / editors are 'aware'
234 // of the corresponding detail viewer.
236 Object input
= getInput();
241 if (input
instanceof TaxonBase
) {
242 if(((TaxonBase
) input
).getName()==null){
243 createEmptySection(Messages
.DetailsViewerE4_TAXON_HAS_NO_NAME
, rootElement
);
246 createTaxonSections(rootElement
);
249 } else if (input
instanceof TaxonName
) {
250 createNameSections(rootElement
);
252 } else if (input
instanceof Reference
) {
253 createReferenceSections(rootElement
);
255 } else if (input
instanceof Team
) {
256 createTeamDetailSection(rootElement
);
258 } else if (input
instanceof Person
) {
259 createPersonDetailSection(rootElement
);
261 } else if (input
instanceof TeamOrPersonBase
) {
262 createTeamOrPersonBaseDetailSection(rootElement
);
264 } else if (input
instanceof DescriptionBase
) {
265 if(input
instanceof SpecimenDescription
){
266 //TODO: add more sections to DetailsView for SpecimenDescription
267 createSpecimenDescriptionSection(rootElement
);
270 Set
<Marker
> descriptionMarkers
= ((DescriptionBase
<?
>) input
).getMarkers();
272 Boolean isUseDescription
= false;
273 for (Marker marker
: descriptionMarkers
) {
274 if (marker
.getMarkerType()!= null && marker
.getMarkerType().getUuid().equals(UsageTermCollection
.uuidUseMarkerType
)) {
275 isUseDescription
= true;
278 if (((DescriptionBase
<?
>) input
).isImageGallery()) {
279 createImageGallerySection(rootElement
);
281 } else if (isUseDescription
) {
282 createUseDescriptionSection(rootElement
);
283 } else if (input
instanceof TaxonDescription
){
284 createTaxonDescriptionSection(rootElement
);
287 createDescriptionSection(rootElement
, false);
290 } else if (input
instanceof DescriptionElementBase
){
291 Set
<Marker
> descriptionMarkers
= new HashSet
<>();
292 if(((DescriptionElementBase
) input
).getInDescription()!=null) {
293 descriptionMarkers
= ((DescriptionElementBase
) input
).getInDescription().getMarkers();
296 Boolean isUseDescription
= false;
297 for (Marker marker
: descriptionMarkers
) {
298 if (marker
.getMarkerType()!= null && marker
.getMarkerType().getUuid().equals(UsageTermCollection
.uuidUseMarkerType
)) {
299 isUseDescription
= true;
303 if (isUseDescription
== true && input
instanceof CategoricalData
) {
304 createUseRecordSection(rootElement
);
306 createDescriptionElementSection(rootElement
, activePart
);
309 } else if (input
instanceof Media
) {
310 createMediaElementSection(rootElement
);
312 //FIXME hack to show more informative message to the user when
313 //DerivedUnit has more than one FieldUnit #4363
314 else if (input
instanceof DerivedUnit
&& !(input
instanceof MediaSpecimen
)) {
315 DerivedUnit derivedUnit
= (DerivedUnit
)input
;
317 input
= DerivedUnitFacade
.NewInstance(derivedUnit
,
318 PreferencesUtil
.getDerivedUnitConfigurator());
319 } catch (DerivedUnitFacadeNotSupportedException e
) {
320 createEmptySection(e
.getMessage(), rootElement
);
323 else if (input
instanceof DerivedUnitFacade
) {
324 DerivedUnitFacade facade
= (DerivedUnitFacade
) input
;
325 if(facade
.getType() == SpecimenOrObservationType
.FieldUnit
){
326 if(facade
.innerFieldUnit() == null){
327 MessagingUtils
.error(DetailsViewerE4
.class, "FieldUnit of facade is null", null); //$NON-NLS-1$
330 createFieldUnitSection(rootElement
);
333 else if(facade
.getType() == SpecimenOrObservationType
.PreservedSpecimen
){
334 if(facade
.innerDerivedUnit() == null){
335 MessagingUtils
.error(DetailsViewerE4
.class, "DerivedUnit of facade is null", null); //$NON-NLS-1$
338 createDerivedUnitBaseElementSection(rootElement
);
341 else if(facade
.getType() == SpecimenOrObservationType
.TissueSample
){
342 //TissueSample should only be created by using it's own class
343 //in future using only one class with different SpecimenOrObservationTypes is desired
344 createTissueSampleSection(rootElement
);
346 else if(facade
.getType()==SpecimenOrObservationType
.DnaSample
){
348 if(facade
.innerDerivedUnit().getRecordBasis()==SpecimenOrObservationType
.TissueSample
){
349 createTissueSampleSection(rootElement
);
351 else if(facade
.innerDerivedUnit().getRecordBasis()==SpecimenOrObservationType
.DnaSample
){
352 createDnaSampleSection(rootElement
);
354 }else if (facade
.innerDerivedUnit() instanceof MediaSpecimen
){
355 createEmptySection("Image specimen not supported by specimen list editor", rootElement
);
357 createDerivedUnitBaseElementSection(rootElement
);
359 } else if (input
instanceof DnaSample
){
360 DnaSample dnaSample
= (DnaSample
)input
;
361 if(dnaSample
.getRecordBasis()==SpecimenOrObservationType
.TissueSample
){
362 createTissueSampleSection(rootElement
);
364 else if(dnaSample
.getRecordBasis()==SpecimenOrObservationType
.DnaSample
){
365 createDnaSampleSection(rootElement
);
367 } else if (input
instanceof MediaSpecimen
){
368 createMediaSpecimenSection(rootElement
);
370 else if(input
instanceof Sequence
){
371 createSequenceSection(rootElement
);
373 else if(input
instanceof SingleRead
){
374 createSingleReadSection(rootElement
);
376 else if (input
instanceof FeatureNodeContainer
) {
377 createFeatureDistributionSection(rootElement
);
379 } else if (input
instanceof TermNode
) {
380 TermType type
= ((TermNode
<?
>) input
).getTermType();
381 if(type
.equals(TermType
.Character
) ){
382 createCharacterNodeSection(rootElement
);
384 else if(type
.equals(TermType
.Feature
)){
385 createFeatureNodeSection(rootElement
);
388 } else if (input
instanceof TermTree
) {
389 createFeatureTreeSection(rootElement
);
391 } else if (input
instanceof TermNodeDto
) {
392 TermType type
= ((TermNodeDto
) input
).getTerm().getTermType();
393 if(type
.equals(TermType
.Character
) && activePart
instanceof ICharacterEditor
){
394 createCharacterNodeDtoSection(rootElement
);
396 else if(type
.equals(TermType
.Feature
) || type
.equals(TermType
.Character
)){
397 createFeatureNodeSection(rootElement
);
400 } else if (input
instanceof TermTreeDto
) {
401 createFeatureTreeSectionForDto(rootElement
);
403 } else if (input
instanceof Character
) {
404 createCharacterSection(rootElement
);
406 }else if ((input
instanceof PolytomousKeyNode
) || (input
instanceof PolytomousKeyRelationship
)) {
407 createPolytomousKeyNodeSection(rootElement
);
408 } else if (input
instanceof User
) {
409 createUserSection(rootElement
);
410 } else if (input
instanceof Group
) {
411 createGroupSection(rootElement
);
412 } else if (input
instanceof TaxonRelationship
&& ((TaxonRelationship
)input
).getType()!=null
413 && (((TaxonRelationship
)input
).getType().isAnyMisappliedName() || ((TaxonRelationship
)input
).getType().isAnySynonym() || ((TaxonRelationship
)input
).getType().isMisappliedName())){
414 createMisappliedNameSection(rootElement
);
415 }else if (input
instanceof TaxonRelationship
) {
416 createTaxonRelationshipSection(rootElement
);
417 } else if (input
instanceof TermVocabulary
) {
418 createTermVocabularySection(rootElement
);
419 } else if (input
instanceof DefinedTermBase
) {
420 createDefinedTermSection(rootElement
);
422 } else if (input
instanceof SelectionChangedEvent
) {
423 IStructuredSelection sel
=(IStructuredSelection
) ((SelectionChangedEvent
)input
).getSelection();
424 if (sel
.getFirstElement()instanceof Distribution
){
425 createDescriptionElementSection(rootElement
);
428 // createDescriptionElementSection(rootElement);
431 createEmptySection(null, rootElement
);
436 private void createGroupSection(RootElement parent
) {
437 GroupDetailSection groupDetailSection
= formFactory
.createGroupDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(GroupDetailSection
.class, getInput().getClass().getCanonicalName()));
438 MemberDetailSection memberDetailSection
= formFactory
.createMemberDetailSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(MemberDetailSection
.class, getInput().getClass().getCanonicalName()));
439 GrantedAuthorityDetailSection grantedAuthorityDetailSection
= formFactory
.createGrantedAuthorityDetailSection(getConversationHolder(), parent
,StoreUtil
.getSectionStyle(GrantedAuthorityDetailSection
.class, getInput().getClass().getCanonicalName()));
441 addPart(groupDetailSection
);
442 addPart(memberDetailSection
);
443 addPart(grantedAuthorityDetailSection
);
447 public ISelection
getSelection() {
452 public void setSelection(ISelection selection
, boolean reveal
) {
454 this.selection
= selection
;
455 if(this.selection
!=null){
456 SelectionChangedEvent selectionChangedEvent
= new SelectionChangedEvent(this, selection
);
457 fireSelectionChanged(selectionChangedEvent
);
461 private void createTaxonSections(RootElement parent
) {
462 NameDetailsConfigurator config
= PreferencesUtil
.getPreferredNameDetailsConfiguration();
463 EnumSet
<CRUD
> requiredCrud
;
464 if(getInput() == null || StoreUtil
.getCdmEntity(getInput()).getId() == 0) {
465 // new entity, not yet saved
466 requiredCrud
= EnumSet
.of(CRUD
.CREATE
);
468 requiredCrud
= EnumSet
.of(CRUD
.UPDATE
);
470 boolean hasPermission
= CdmStore
.currentAuthentiationHasPermission(StoreUtil
.getCdmEntity(getInput()), requiredCrud
);
472 // check for subtree permissions as well.
473 TaxonBase
<?
> taxonBase
= (TaxonBase
<?
>)getInput();
474 Taxon acceptedTaxon
= null;
475 if (taxonBase
instanceof Taxon
){
476 acceptedTaxon
= (Taxon
)taxonBase
;
478 acceptedTaxon
= ((Synonym
)taxonBase
).getAcceptedTaxon();
480 if (acceptedTaxon
!= null){ //needs discussion if synonyms without accepted taxon should never be filtered by subtree permission(current implementation). See also #8849
481 Set
<TaxonNode
> nodes
= acceptedTaxon
.getTaxonNodes();
482 for (TaxonNode node
: nodes
){
483 hasPermission
&= CdmStore
.currentAuthentiationHasPermission(node
, requiredCrud
);
485 //check whether there are explicit TaxonNode rights
486 boolean taxonnodePermissionExists
= false;
487 Collection
<?
extends GrantedAuthority
> authorities
= CdmStore
.getCurrentAuthentiation().getAuthorities();
488 for (GrantedAuthority grantedAuthority
: authorities
){
489 if (grantedAuthority
.getAuthority().startsWith("TAXONNODE")){
490 taxonnodePermissionExists
= true;
493 if (!taxonnodePermissionExists
){
494 hasPermission
= true;
500 detailsEnabled
= hasPermission
;
501 ParsingMessagesSection parsingMessagesSection
= formFactory
.createParsingMessagesSection(getConversationHolder(), parent
, this,
502 StoreUtil
.getSectionStyle(ParsingMessagesSection
.class, getInput().getClass().getCanonicalName(), true));
504 TaxonBaseDetailSection taxonBaseDetailSection
= formFactory
.createTaxonBaseDetailSection(getConversationHolder(), parent
, this,
505 StoreUtil
.getSectionStyle(TaxonBaseDetailSection
.class, getInput().getClass().getCanonicalName(), true));
506 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
507 // boolean hasPermission = CdmStore.currentAuthentiationHasPermission(getInput(), Operation.UPDATE);
508 taxonBaseDetailSection
.setEnabled(detailsEnabled
);
509 addPart(taxonBaseDetailSection
);
511 if (config
.isTaxonSectionActivated()){
512 TaxonBaseDetailSection taxonBaseDetailSection
= formFactory
.createTaxonBaseDetailSection(getConversationHolder(), parent
, this,
513 StoreUtil
.getSectionStyle(TaxonBaseDetailSection
.class, getInput().getClass().getCanonicalName(), true));
514 taxonBaseDetailSection
.setEnabled(detailsEnabled
);
515 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
516 addPart(taxonBaseDetailSection
);
519 NonViralNameDetailSection nonViralNameSection
= formFactory
520 .createNonViralNameDetailSection(getConversationHolder(), parent
, this, true,
521 StoreUtil
.getSectionStyle(NonViralNameDetailSection
.class, getInput().getClass().getCanonicalName(), true));
522 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
523 nonViralNameSection
.setEnabled(detailsEnabled
);
524 if (config
== null || config
.isNomenclaturalReferenceSectionActivated()){
525 NomenclaturalReferenceDetailSection referenceDetailSection
= formFactory
.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent
, this,
526 StoreUtil
.getSectionStyle(NomenclaturalReferenceDetailSection
.class, getInput().getClass().getCanonicalName(), true));
527 referenceDetailSection
.setEnabled(detailsEnabled
);
528 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
529 addPart(referenceDetailSection
);
532 if ( config
== null || config
.isNomenclaturalStatusSectionActivated()){
533 NomenclaturalStatusSection nomenclaturalStatusSection
= formFactory
.createNomenclaturalStatusSection(getConversationHolder(), parent
,
534 StoreUtil
.getSectionStyle(NomenclaturalStatusSection
.class, getInput().getClass().getCanonicalName(), true));
535 nomenclaturalStatusSection
.setEnabled(detailsEnabled
);
536 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
537 addPart(nomenclaturalStatusSection
);
540 // if ( config == null || config.isProtologueActivated()){
541 // ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(ProtologueSection.class, getInput().getClass().getCanonicalName()));
542 // protologSection.setEnabled(detailsEnabled);
543 // formFactory.createHorizontalSeparator(parent, SWT.BORDER);
544 // addPart(protologSection);
547 if (config
== null || config
.isTypeDesignationSectionActivated()){
548 TypeDesignationSection typeDesignationSection
= formFactory
.createTypeDesignationSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(TypeDesignationSection
.class, getInput().getClass().getCanonicalName()));
549 typeDesignationSection
.setEnabled(detailsEnabled
);
550 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
551 addPart(typeDesignationSection
);
554 if (config
== null || config
.isNameRelationsSectionActivated()){
555 NameRelationshipDetailSection nameRelationshipSection
= formFactory
.createNameRelationshipDetailSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(NameRelationshipDetailSection
.class, getInput().getClass().getCanonicalName()));
556 nameRelationshipSection
.setEnabled(detailsEnabled
);
557 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
558 addPart(nameRelationshipSection
);
561 addPart(parsingMessagesSection
);
562 addPart(nonViralNameSection
);
565 private void createNameSections(RootElement parent
) {
566 NonViralNameDetailSection nonViralNameSection
= formFactory
.createNonViralNameDetailSection(
567 getConversationHolder(), parent
, this, false, StoreUtil
.getSectionStyle(NonViralNameDetailSection
.class, getInput().getClass().getCanonicalName(), true));
569 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
571 NomenclaturalReferenceDetailSection referenceDetailSection
= formFactory
.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent
, this,
572 StoreUtil
.getSectionStyle(NomenclaturalReferenceDetailSection
.class, getInput().getClass().getCanonicalName(), true));
573 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
575 NomenclaturalStatusSection nomenclaturalStatusSection
= formFactory
.createNomenclaturalStatusSection(getConversationHolder(), parent
,
576 StoreUtil
.getSectionStyle(NomenclaturalStatusSection
.class, getInput().getClass().getCanonicalName(), true));
577 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
579 addPart(nonViralNameSection
);
580 addPart(nomenclaturalStatusSection
);
581 addPart(referenceDetailSection
);
583 // ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(ProtologueSection.class, getInput().getClass().getCanonicalName()));
584 // formFactory.createHorizontalSeparator(parent, SWT.BORDER);
586 TypeDesignationSection typeDesignationSection
= formFactory
.createTypeDesignationSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(TypeDesignationSection
.class, getInput().getClass().getCanonicalName()));
587 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
589 NameRelationshipDetailSection nameRelationshipSection
= formFactory
.createNameRelationshipDetailSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(NameRelationshipDetailSection
.class, getInput().getClass().getCanonicalName()));
590 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
591 // addPart(protologSection);
592 addPart(typeDesignationSection
);
593 addPart(nameRelationshipSection
);
596 private void createReferenceSections(RootElement parent
) {
597 ReferenceDetailSection referenceDetailSection
= formFactory
.createReferenceDetailSection(getConversationHolder(), parent
, this,
598 StoreUtil
.getSectionStyle(ReferenceDetailSection
.class, getInput().getClass().getCanonicalName(), true));
600 addPart(referenceDetailSection
);
603 private void createTeamOrPersonBaseDetailSection(RootElement parent
) {
604 TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection
= formFactory
.createTeamOrPersonBaseDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(TeamOrPersonBaseDetailSection
.class, getInput().getClass().getCanonicalName(), true));
606 addPart(teamOrPersonBaseDetailSection
);
609 private void createTeamDetailSection(RootElement parent
) {
610 TeamDetailSection teamDetailSection
= formFactory
.createTeamDetailSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(TeamDetailSection
.class, getInput().getClass().getCanonicalName(), true));
612 addPart(teamDetailSection
);
615 private void createPersonDetailSection(RootElement parent
) {
616 PersonDetailSection personDetailSection
= formFactory
.createPersonDetailSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(PersonDetailSection
.class, getInput().getClass().getCanonicalName(), true));
617 addPart(personDetailSection
);
620 private void createDescriptionElementSection(RootElement parent
) {
621 createDescriptionElementSection(parent
, null);
624 private void createDescriptionElementSection(RootElement parent
, Object activePart
) {
625 DescriptionElementDetailSection descriptionElementDetailSection
= formFactory
.createDescriptionElementDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DescriptionElementDetailSection
.class, getInput().getClass().getCanonicalName(), true));
626 descriptionElementDetailSection
.setEnabled(this.detailsEnabled
);
628 // IntextReferenceSection intextReferenceSection = formFactory.createIntextReferenceSection(getConversationHolder(), parent, getSectionStyle(.class, getInput().getClass().getCanonicalName()));
630 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
631 DescriptionElementSourceSection descriptionElementSourceSection
;
632 if (activePart
!= null && activePart
instanceof IDistributionEditorPart
){
633 Reference defaultSource
=((IDistributionEditorPart
)activePart
).getEditor().getDefaultSource();
634 descriptionElementSourceSection
= formFactory
.createDescriptionElementSourceSection(getConversationHolder(), parent
, defaultSource
, StoreUtil
.getSectionStyle(DescriptionElementSourceSection
.class, getInput().getClass().getCanonicalName()));
637 descriptionElementSourceSection
= formFactory
.createDescriptionElementSourceSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(DescriptionElementSourceSection
.class, getInput().getClass().getCanonicalName()) );
640 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
642 DescriptionElementMediaSection descriptionElementMediaSection
= formFactory
.createDescriptionElementMediaSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(DescriptionElementMediaSection
.class, getInput().getClass().getCanonicalName()));
644 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
646 addPart(descriptionElementDetailSection
);
647 addPart(descriptionElementSourceSection
);
648 addPart(descriptionElementMediaSection
);
651 private void createDescriptionSection(RootElement parent
, boolean isTaxonDescription
) {
652 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DescriptionDetailSection
.class, getInput().getClass().getCanonicalName(), true));
653 addPart(descriptionDetailSection
);
655 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
657 if(isTaxonDescription
) {
658 NaturalLanguageSection naturalLanguageSection
= formFactory
.createNaturalLanguageSection(
659 getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(NaturalLanguageSection
.class, getInput().getClass().getCanonicalName(), true));
660 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
661 addPart(naturalLanguageSection
);
663 DescriptionSourceSection descriptionSourceSection
= formFactory
.createDescriptionSourceSection(
664 getConversationHolder(), parent
, StoreUtil
.getSectionStyle(DescriptionSourceSection
.class, getInput().getClass().getCanonicalName(), true));
665 addPart(descriptionSourceSection
);
667 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
669 if(isTaxonDescription
) {
670 ScopeSection scopeSection
= formFactory
.createScopeSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(ScopeSection
.class, getInput().getClass().getCanonicalName()));
671 addPart(scopeSection
);
675 private void createTaxonDescriptionSection(RootElement parent
) {
676 createDescriptionSection(parent
, true);
679 private void createSpecimenDescriptionSection(RootElement parent
) {
680 createDescriptionSection(parent
, false);
683 private void createUseDescriptionSection(RootElement parent
) {
684 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DescriptionDetailSection
.class, getInput().getClass().getCanonicalName()));
686 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
688 DescriptionSourceSection descriptionSourceSection
= formFactory
.createDescriptionSourceSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(DescriptionSourceSection
.class, getInput().getClass().getCanonicalName()));
690 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
692 addPart(descriptionDetailSection
);
693 addPart(descriptionSourceSection
);
696 private void createImageGallerySection(RootElement parent
) {
697 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DescriptionDetailSection
.class, getInput().getClass().getCanonicalName()));
699 addPart(descriptionDetailSection
);
702 private void createMediaElementSection(RootElement parent
) {
703 MediaDetailsSection mediaDetailSection
= formFactory
.createMediaDetailsSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(MediaDetailsSection
.class, getInput().getClass().getCanonicalName(), true));
705 addPart(mediaDetailSection
);
708 private void createDerivedUnitBaseElementSection(RootElement parent
) {
709 DerivedUnitGeneralDetailSection derivedUnitGeneralDetailSection
= formFactory
.createDerivedUnitGeneralDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DerivedUnitGeneralDetailSection
.class, getInput().getClass().getCanonicalName(), true));
710 //TODO for DerivateEditor do not use facade anymore to avoid this special case handling #4539
711 if(!(AbstractUtility
.getActivePart() instanceof IDerivedUnitFacadePart
)){
712 derivedUnitGeneralDetailSection
.setShowOnlyDerivedUnitData(true);
714 addPart(derivedUnitGeneralDetailSection
);
716 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
718 DerivedUnitBaseDetailSection derivedUnitBaseDetailSection
= formFactory
.createDerivedUnitBaseDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DerivedUnitBaseDetailSection
.class, getInput().getClass().getCanonicalName(), true));
719 addPart(derivedUnitBaseDetailSection
);
721 //for editors working with facades
722 if(AbstractUtility
.getActivePart() instanceof IDerivedUnitFacadePart
){
723 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
724 GatheringEventDetailSection gatheringEventDetailSection
= formFactory
.createGatheringEventDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(GatheringEventDetailSection
.class, getInput().getClass().getCanonicalName()));
725 addPart(gatheringEventDetailSection
);
727 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
728 FieldUnitDetailSection fieldUnitDetailSection
= formFactory
.createFieldUnitDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(FieldUnitDetailSection
.class, getInput().getClass().getCanonicalName()));
729 addPart(fieldUnitDetailSection
);
733 if(PreferencesUtil
.isShowTaxonAssociations()){
734 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
735 TaxonAssociationDetailSection taxonAssociationDetailSection
= formFactory
.createTaxonAssociationDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(TaxonAssociationDetailSection
.class, getInput().getClass().getCanonicalName(), true));
736 addPart(taxonAssociationDetailSection
);
738 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
739 DerivedUnitFacadeIdentifierSection identifierDetailSection
= formFactory
.createDerivedUnitFacadeIdentifierSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(DerivedUnitFacadeIdentifierSection
.class, getInput().getClass().getCanonicalName()));
740 addPart(identifierDetailSection
);
742 if(!PreferencesUtil
.isDeterminationOnlyForFieldUnits()){
743 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
744 DeterminationDetailSection determinationDetailSection
= formFactory
.createDeterminationDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DeterminationDetailSection
.class, getInput().getClass().getCanonicalName()));
745 addPart(determinationDetailSection
);
748 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
749 DerivedUnitTypeDesignationSection derivedUnitTypeDesignationSection
= formFactory
.createDerivedUnitTypeDesignationSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DerivedUnitTypeDesignationSection
.class, getInput().getClass().getCanonicalName()));
750 addPart(derivedUnitTypeDesignationSection
);
753 private void createFieldUnitSection(RootElement parent
) {
754 FieldUnitGeneralDetailSection fielUnitGeneralDetailSection
= formFactory
.createFieldUnitGeneralDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(FieldUnitGeneralDetailSection
.class, getInput().getClass().getCanonicalName(), true));
756 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
758 GatheringEventDetailSection gatheringEventDetailSection
= formFactory
.createGatheringEventDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(GatheringEventDetailSection
.class, getInput().getClass().getCanonicalName()));
760 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
762 FieldUnitDetailSection fieldUnitDetailSection
= formFactory
.createFieldUnitDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(FieldUnitDetailSection
.class, getInput().getClass().getCanonicalName()));
764 addPart(fielUnitGeneralDetailSection
);
765 addPart(gatheringEventDetailSection
);
766 addPart(fieldUnitDetailSection
);
768 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
769 DeterminationDetailSection determinationDetailSection
= formFactory
.createDeterminationDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DeterminationDetailSection
.class, getInput().getClass().getCanonicalName()));
770 addPart(determinationDetailSection
);
773 private void createTissueSampleSection(RootElement parent
) {
774 TissueSampleGeneralDetailSection section
= formFactory
.createTissueSampleGeneralDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(TissueSampleGeneralDetailSection
.class, getInput().getClass().getCanonicalName(), true));
776 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
778 SampleDesignationDetailSection sampleDesignationDetailSection
= formFactory
.createSampleDesignationDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(SampleDesignationDetailSection
.class, getInput().getClass().getCanonicalName(), true));
781 addPart(sampleDesignationDetailSection
);
784 private void createDnaSampleSection(RootElement parent
) {
785 DnaSampleGeneralDetailSection section
= formFactory
.createDnaSampleGeneralDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DnaSampleGeneralDetailSection
.class, getInput().getClass().getCanonicalName(), true));
787 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
789 DnaSamplePreparationPreservationSection preparationPreservationSection
= formFactory
.createDnaSamplePreparationPreservationSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DnaSamplePreparationPreservationSection
.class, getInput().getClass().getCanonicalName(), true));
791 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
793 DnaQualityDetailSection qualitySection
= formFactory
.createDnaQualityDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DnaQualityDetailSection
.class, getInput().getClass().getCanonicalName(), true));
795 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
797 SampleDesignationDetailSection sampleDesignationDetailSection
= formFactory
.createSampleDesignationDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(SampleDesignationDetailSection
.class, getInput().getClass().getCanonicalName(), true));
799 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
800 DeterminationDetailSection determinationDetailSection
= null;
801 if(!PreferencesUtil
.isDeterminationOnlyForFieldUnits()){
802 determinationDetailSection
= formFactory
.createDeterminationDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DeterminationDetailSection
.class, getInput().getClass().getCanonicalName()));
805 addPart(preparationPreservationSection
);
806 addPart(qualitySection
);
807 addPart(sampleDesignationDetailSection
);
808 if(!PreferencesUtil
.isDeterminationOnlyForFieldUnits()){
809 addPart(determinationDetailSection
);
813 private void createSequenceSection(RootElement parent
) {
814 SequenceGeneralDetailSection section
= formFactory
.createSequenceGeneralDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(SequenceGeneralDetailSection
.class, getInput().getClass().getCanonicalName(), true));
816 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
818 SequenceReferenceCollectionDetailSection referenceSection
= formFactory
.createSequenceReferenceCollectionDetailSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(SequenceReferenceCollectionDetailSection
.class, getInput().getClass().getCanonicalName(), true));
820 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
822 SequenceContigFileCollectionDetailSection contigFileSection
= formFactory
.createSequenceContigFileCollectionDetailSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(SequenceContigFileCollectionDetailSection
.class, getInput().getClass().getCanonicalName(), true));
825 addPart(referenceSection
);
826 addPart(contigFileSection
);
829 private void createSingleReadSection(RootElement parent
) {
830 SingleReadGeneralDetailSection section
= formFactory
.createSingleReadGeneralDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(SingleReadGeneralDetailSection
.class, getInput().getClass().getCanonicalName(), true));
833 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
835 SingleReadPherogramCollectionDetailSection pherogramSection
= formFactory
.createSingleReadPherogramCollectionDetailSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(SingleReadPherogramCollectionDetailSection
.class, getInput().getClass().getCanonicalName(), true));
836 addPart(pherogramSection
);
839 private void createMediaSpecimenSection(RootElement parent
) {
840 MediaSpecimenGeneralDetailSection generalSection
= formFactory
.createMediaSpecimenGeneralDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(MediaSpecimenGeneralDetailSection
.class, getInput().getClass().getCanonicalName(), true));
841 addPart(generalSection
);
843 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
845 RightsSection rightsSection
= formFactory
.createRightsSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(RightsSection
.class, getInput().getClass().getCanonicalName()));
846 // rightsSection.setEntity(generalSection.getEntity().innerDerivedUnit());
847 addPart(rightsSection
);
850 private void createFeatureTreeSectionForDto(RootElement parent
) {
851 TermTreeDetailSection section
= formFactory
.createFeatureTreeDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(TermTreeDetailSection
.class, getInput().getClass().getCanonicalName(), true));
855 private void createFeatureTreeSection(RootElement parent
) {
856 TermTreeDetailSectionForNode section
= formFactory
.createFeatureTreeDetailSectionForTree(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(TermTreeDetailSection
.class, getInput().getClass().getCanonicalName(), true));
861 private void createFeatureNodeSection(RootElement parent
) {
862 TermNodeDetailSection featureDistributionSection
= formFactory
.createFeatureNodeDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(TermNodeDetailSection
.class, getInput().getClass().getCanonicalName(), true));
863 addPart(featureDistributionSection
);
866 private void createFeatureDistributionSection(RootElement parent
) {
867 FeatureDistributionDetailSection featureDistributionSection
= formFactory
.createFeatureDistributionDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(FeatureDistributionDetailSection
.class, getInput().getClass().getCanonicalName(), true));
868 addPart(featureDistributionSection
);
871 private void createCharacterNodeSection(RootElement parent
) {
872 CharacterNodeDetailSection featureDistributionSection
= formFactory
.createCharacterNodeDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(CharacterDetailSection
.class, getInput().getClass().getCanonicalName(), true));
873 addPart(featureDistributionSection
);
876 private void createCharacterNodeDtoSection(RootElement parent
) {
877 CharacterNodeDtoDetailSection featureDistributionSection
= formFactory
.createCharacterNodeDtoDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(CharacterDetailSection
.class, getInput().getClass().getCanonicalName(), true));
878 addPart(featureDistributionSection
);
881 private void createCharacterSection(RootElement parent
) {
882 CharacterDetailSection featureDistributionSection
= formFactory
.createCharacterDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(CharacterDetailSection
.class, getInput().getClass().getCanonicalName(), true));
883 addPart(featureDistributionSection
);
886 private void createPolytomousKeyNodeSection(RootElement parent
) {
887 PolytomousKeyDetailSection polytomousKeyDetailSection
= formFactory
.createPolytomousKeyDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(PolytomousKeyDetailSection
.class, getInput().getClass().getCanonicalName()));
889 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
891 PolytomousKeyNodeDetailSection polytomousKeyNodeDetailSection
= formFactory
.createPolytomousKeyNodeDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(PolytomousKeyNodeDetailSection
.class, getInput().getClass().getCanonicalName(), true));
893 addPart(polytomousKeyDetailSection
);
894 addPart(polytomousKeyNodeDetailSection
);
898 private void createUseRecordSection(RootElement parent
) {
899 UseRecordDetailSection descriptionUseRecordSection
= formFactory
.createUseRecordDetailSection(getConversationHolder(), parent
, this,StoreUtil
.getSectionStyle(UseRecordDetailSection
.class, getInput().getClass().getCanonicalName(), true));
900 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
901 addPart(descriptionUseRecordSection
);
904 private void createUserSection(RootElement parent
) {
905 UserDetailSection userDetailSection
= formFactory
.createUserDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(UserDetailSection
.class, getInput().getClass().getCanonicalName(), true));
907 GroupsByUserDetailSection groupByUserDetailSection
= formFactory
.createGroupsByUserDetailSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(GroupsByUserDetailSection
.class, getInput().getClass().getCanonicalName(), true));
909 addPart(userDetailSection
);
910 addPart(groupByUserDetailSection
);
913 private void createMisappliedNameSection(RootElement parent
) {
914 TaxonRelationshipDetailSection taxonRelationshipDetailSection
= formFactory
.createTaxonRelationshipDetailSection(getConversationHolder(), parent
, this,
915 StoreUtil
.getSectionStyle(TaxonRelationshipDetailSection
.class, getInput().getClass().getCanonicalName(), true));
916 addPart(taxonRelationshipDetailSection
);
918 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
920 NonViralNameDetailSection nonViralNameSection
= formFactory
921 .createNonViralNameDetailSection(getConversationHolder(), parent
, this, true,
922 StoreUtil
.getSectionStyle(NonViralNameDetailSection
.class, getInput().getClass().getCanonicalName(), true));
923 addPart(nonViralNameSection
);
925 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
927 NomenclaturalReferenceDetailSection referenceDetailSection
= formFactory
.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent
, this,
928 StoreUtil
.getSectionStyle(NomenclaturalReferenceDetailSection
.class, getInput().getClass().getCanonicalName(), true));
929 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
930 addPart(referenceDetailSection
);
932 NomenclaturalStatusSection nomenclaturalStatusSection
= formFactory
.createNomenclaturalStatusSection(getConversationHolder(), parent
,
933 StoreUtil
.getSectionStyle(NomenclaturalStatusSection
.class, getInput().getClass().getCanonicalName(), true));
934 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
935 addPart(nomenclaturalStatusSection
);
937 // ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(ProtologueSection.class, getInput().getClass().getCanonicalName()));
938 // formFactory.createHorizontalSeparator(parent, SWT.BORDER);
939 // addPart(protologSection);
941 TypeDesignationSection typeDesignationSection
= formFactory
.createTypeDesignationSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(TypeDesignationSection
.class, getInput().getClass().getCanonicalName()));
942 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
943 addPart(typeDesignationSection
);
945 NameRelationshipDetailSection nameRelationshipSection
= formFactory
.createNameRelationshipDetailSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(NameRelationshipDetailSection
.class, getInput().getClass().getCanonicalName()));
946 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
947 addPart(nameRelationshipSection
);
950 private void createTaxonRelationshipSection(RootElement parent
) {
951 TaxonRelationshipDetailSection taxonRelationshipDetailSection
= formFactory
.createTaxonRelationshipDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(TaxonRelationshipDetailSection
.class, getInput().getClass().getCanonicalName(), true));
953 ReferencedEntityDetailSection referencedEntityBaseDetailSection
= formFactory
.createReferencedEntityDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(ReferencedEntityDetailSection
.class, getInput().getClass().getCanonicalName(), true));
954 addPart(taxonRelationshipDetailSection
);
955 addPart(referencedEntityBaseDetailSection
);
957 private void createTermVocabularySection(RootElement parent
) {
958 TermVocabularyDetailSection termVocabularyDetailSection
= formFactory
.createTermVocabularyDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(TermVocabularyDetailSection
.class, getInput().getClass().getCanonicalName(), true));
959 addPart(termVocabularyDetailSection
);
962 private void createDefinedTermSection(RootElement parent
) {
963 DefinedTermDetailSection
<?
> definedTermDetailSection
= formFactory
.createDefinedTermDetailSection(getInput().getClass(), getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DefinedTermDetailSection
.class, getInput().getClass().getCanonicalName(), true));
964 addPart(definedTermDetailSection
);
965 TermMediaSection termMediaSection
= formFactory
.createTermMediaSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(DefinedTermDetailSection
.class, getInput().getClass().getCanonicalName(), true));
966 addPart(termMediaSection
);
970 public void update(CdmDataChangeMap arg0
) {
975 private void updateView(@UIEventTopic(WorkbenchEventConstants
.REFRESH_DETAILS
)boolean refresh
){
983 private void updateView(@UIEventTopic(WorkbenchEventConstants
.REFRESH_DETAILS_DISTRIBUTION
)String nameCache
){
984 if(nameCache
!= null && getInput() instanceof Distribution
&& this.activePart
instanceof IDistributionEditorPart
){
985 if (part
instanceof CdmSectionPart
&& ((CdmSectionPart
)part
).getSection() instanceof DescriptionElementDetailSection
){
986 for (ICdmFormElement element
: ((DescriptionElementDetailSection
)((CdmSectionPart
)part
).getSection()).getElements()){
987 if (element
instanceof DescriptionElementDetailElement
){
988 for(ICdmFormElement descriptionElement
:((DescriptionElementDetailElement
)element
).getElements()){
989 if (descriptionElement
instanceof DistributionDetailElement
){
990 ((DistributionDetailElement
) descriptionElement
).setName(nameCache
);