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.
10 package eu
.etaxonomy
.taxeditor
.view
.e4
.details
;
12 import java
.util
.Collection
;
13 import java
.util
.EnumSet
;
14 import java
.util
.HashSet
;
17 import javax
.inject
.Inject
;
19 import org
.eclipse
.e4
.core
.di
.annotations
.Optional
;
20 import org
.eclipse
.e4
.ui
.di
.UIEventTopic
;
21 import org
.eclipse
.jface
.viewers
.ISelection
;
22 import org
.eclipse
.jface
.viewers
.IStructuredSelection
;
23 import org
.eclipse
.jface
.viewers
.SelectionChangedEvent
;
24 import org
.eclipse
.jface
.viewers
.TreeNode
;
25 import org
.eclipse
.swt
.SWT
;
26 import org
.springframework
.security
.core
.GrantedAuthority
;
28 import eu
.etaxonomy
.cdm
.api
.facade
.DerivedUnitFacade
;
29 import eu
.etaxonomy
.cdm
.api
.facade
.DerivedUnitFacadeNotSupportedException
;
30 import eu
.etaxonomy
.cdm
.ext
.occurrence
.gbif
.GbifResponse
;
31 import eu
.etaxonomy
.cdm
.model
.agent
.Person
;
32 import eu
.etaxonomy
.cdm
.model
.agent
.Team
;
33 import eu
.etaxonomy
.cdm
.model
.agent
.TeamOrPersonBase
;
34 import eu
.etaxonomy
.cdm
.model
.common
.Marker
;
35 import eu
.etaxonomy
.cdm
.model
.description
.CategoricalData
;
36 import eu
.etaxonomy
.cdm
.model
.description
.Character
;
37 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionBase
;
38 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionElementBase
;
39 import eu
.etaxonomy
.cdm
.model
.description
.Distribution
;
40 import eu
.etaxonomy
.cdm
.model
.description
.PolytomousKeyNode
;
41 import eu
.etaxonomy
.cdm
.model
.description
.SpecimenDescription
;
42 import eu
.etaxonomy
.cdm
.model
.description
.TaxonDescription
;
43 import eu
.etaxonomy
.cdm
.model
.media
.Media
;
44 import eu
.etaxonomy
.cdm
.model
.molecular
.DnaSample
;
45 import eu
.etaxonomy
.cdm
.model
.molecular
.Sequence
;
46 import eu
.etaxonomy
.cdm
.model
.molecular
.SingleRead
;
47 import eu
.etaxonomy
.cdm
.model
.name
.TaxonName
;
48 import eu
.etaxonomy
.cdm
.model
.occurrence
.DerivedUnit
;
49 import eu
.etaxonomy
.cdm
.model
.occurrence
.FieldUnit
;
50 import eu
.etaxonomy
.cdm
.model
.occurrence
.MediaSpecimen
;
51 import eu
.etaxonomy
.cdm
.model
.occurrence
.SpecimenOrObservationType
;
52 import eu
.etaxonomy
.cdm
.model
.permission
.CRUD
;
53 import eu
.etaxonomy
.cdm
.model
.permission
.Group
;
54 import eu
.etaxonomy
.cdm
.model
.permission
.User
;
55 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
56 import eu
.etaxonomy
.cdm
.model
.taxon
.Synonym
;
57 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
58 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonBase
;
59 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonNode
;
60 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonRelationship
;
61 import eu
.etaxonomy
.cdm
.model
.term
.DefinedTermBase
;
62 import eu
.etaxonomy
.cdm
.model
.term
.TermNode
;
63 import eu
.etaxonomy
.cdm
.model
.term
.TermTree
;
64 import eu
.etaxonomy
.cdm
.model
.term
.TermType
;
65 import eu
.etaxonomy
.cdm
.model
.term
.TermVocabulary
;
66 import eu
.etaxonomy
.cdm
.persistence
.dto
.TermNodeDto
;
67 import eu
.etaxonomy
.cdm
.persistence
.dto
.TermTreeDto
;
68 import eu
.etaxonomy
.cdm
.persistence
.hibernate
.CdmDataChangeMap
;
69 import eu
.etaxonomy
.taxeditor
.editor
.IDistributionEditorPart
;
70 import eu
.etaxonomy
.taxeditor
.event
.WorkbenchEventConstants
;
71 import eu
.etaxonomy
.taxeditor
.featuretree
.e4
.ICharacterEditor
;
72 import eu
.etaxonomy
.taxeditor
.l10n
.Messages
;
73 import eu
.etaxonomy
.taxeditor
.model
.AbstractUtility
;
74 import eu
.etaxonomy
.taxeditor
.model
.FeatureNodeContainer
;
75 import eu
.etaxonomy
.taxeditor
.model
.IDerivedUnitFacadePart
;
76 import eu
.etaxonomy
.taxeditor
.model
.MessagingUtils
;
77 import eu
.etaxonomy
.taxeditor
.model
.PolytomousKeyRelationship
;
78 import eu
.etaxonomy
.taxeditor
.preference
.NameDetailsConfigurator
;
79 import eu
.etaxonomy
.taxeditor
.preference
.PreferencesUtil
;
80 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
81 import eu
.etaxonomy
.taxeditor
.store
.StoreUtil
;
82 import eu
.etaxonomy
.taxeditor
.store
.UsageTermCollection
;
83 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
84 import eu
.etaxonomy
.taxeditor
.ui
.element
.RootElement
;
85 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailSection
;
86 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailSection
;
87 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamOrPersonBaseDetailSection
;
88 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferencedEntityDetailSection
;
89 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailSection
;
90 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailElement
;
91 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailSection
;
92 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementMediaSection
;
93 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceSection
;
94 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceSection
;
95 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.MediaDetailsSection
;
96 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageSection
;
97 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeSection
;
98 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.DistributionDetailElement
;
99 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.CharacterDetailSection
;
100 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.CharacterNodeDetailSection
;
101 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.CharacterNodeDtoDetailSection
;
102 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailSection
;
103 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureNodeDetailSection
;
104 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureTreeDetailSection
;
105 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureTreeDetailSectionForNode
;
106 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailSection
;
107 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailSection
;
108 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailSection
;
109 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailSection
;
110 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailSection
;
111 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailSection
;
112 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusSection
;
113 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailSection
;
114 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.TypeDesignationSection
;
115 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitBaseDetailSection
;
116 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitGeneralDetailSection
;
117 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailSection
;
118 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitDetailSection
;
119 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitGeneralDetailSection
;
120 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailSection
;
121 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.association
.DerivedUnitTypeDesignationSection
;
122 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.association
.TaxonAssociationDetailSection
;
123 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaQualityDetailSection
;
124 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaSampleGeneralDetailSection
;
125 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaSamplePreparationPreservationSection
;
126 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SampleDesignationDetailSection
;
127 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceContigFileCollectionDetailSection
;
128 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceGeneralDetailSection
;
129 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceReferenceCollectionDetailSection
;
130 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SingleReadGeneralDetailSection
;
131 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SingleReadPherogramCollectionDetailSection
;
132 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.TissueSampleGeneralDetailSection
;
133 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.media
.MediaSpecimenGeneralDetailSection
;
134 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailSection
;
135 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailSection
;
136 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.RightsSection
;
137 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.identifier
.DerivedUnitFacadeIdentifierSection
;
138 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessagesSection
;
139 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailSection
;
140 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailSection
;
141 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailSection
;
142 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailSection
;
143 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailSection
;
144 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.DefinedTermDetailSection
;
145 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermMediaSection
;
146 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailSection
;
147 import eu
.etaxonomy
.taxeditor
.view
.detail
.CdmSectionPart
;
148 import eu
.etaxonomy
.taxeditor
.view
.e4
.AbstractCdmDataViewerE4
;
152 * The DetailsViewer handles the content of the details view (
153 * {@link DetailsPartE4}).<br>
154 * Depending on the type of the selected element the section of the details view
161 public class DetailsViewerE4
extends AbstractCdmDataViewerE4
{
163 private ISelection selection
;
164 private boolean detailsEnabled
= true;
165 private Object activePart
;
167 public boolean isDetailsEnabled() {
168 return detailsEnabled
;
171 public void setDetailsEnabled(boolean detailsEnabled
) {
172 this.detailsEnabled
= detailsEnabled
;
175 public void setInput(Object input
, Object activePart
) {
176 this.activePart
= activePart
;
180 // START HACK TO MAKE THE DERIVED UNIT FACADE WORK
181 // since we are getting implementations of DerivedUnitBase from the bulk
183 // and not derived unit facade objects,
186 public void setInput(Object input
) {
188 if(input
instanceof TreeNode
){
189 input
= ((TreeNode
) input
).getValue();
191 if(input
instanceof GbifResponse
){
192 input
= ((GbifResponse
) input
).getDerivedUnitFacade();
194 if (input
!=null && input
instanceof DerivedUnit
) {
195 DerivedUnit derivedUnit
= (DerivedUnit
)input
;
197 input
= DerivedUnitFacade
.NewInstance(derivedUnit
,
198 PreferencesUtil
.getDerivedUnitConfigurator());
199 } catch (DerivedUnitFacadeNotSupportedException e
) {
200 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
203 else if(input
instanceof FieldUnit
){
204 input
= DerivedUnitFacade
.NewInstance(SpecimenOrObservationType
.FieldUnit
, (FieldUnit
) input
);
206 super.setInput(input
);
210 protected void markViewPartDirty() {
211 if (getInput() instanceof DerivedUnitFacade
) {
212 if(part
instanceof IDerivedUnitFacadePart
){
213 part
.changed(getInput());
216 DerivedUnitFacade facade
= (DerivedUnitFacade
) getInput();
217 if(facade
.innerDerivedUnit()!=null){
218 part
.changed(facade
.innerDerivedUnit());
220 else if(facade
.innerFieldUnit()!=null){
221 part
.changed(facade
.innerFieldUnit());
226 super.markViewPartDirty();
232 protected void showParts() {
233 // FIXME (CM) : Need to clean out this code.
234 // Too much type checking to decide which detail view to display.
235 // Need to build in a mechanism where navigators / editors are 'aware'
236 // of the corresponding detail viewer.
238 Object input
= getInput();
243 if (input
instanceof TaxonBase
) {
244 if(((TaxonBase
) input
).getName()==null){
245 createEmptySection(Messages
.DetailsViewerE4_TAXON_HAS_NO_NAME
, rootElement
);
248 createTaxonSections(rootElement
);
251 } else if (input
instanceof TaxonName
) {
252 createNameSections(rootElement
);
254 } else if (input
instanceof Reference
) {
255 createReferenceSections(rootElement
);
257 } else if (input
instanceof Team
) {
258 createTeamDetailSection(rootElement
);
260 } else if (input
instanceof Person
) {
261 createPersonDetailSection(rootElement
);
263 } else if (input
instanceof TeamOrPersonBase
) {
264 createTeamOrPersonBaseDetailSection(rootElement
);
266 } else if (input
instanceof DescriptionBase
) {
267 if(input
instanceof SpecimenDescription
){
268 //TODO: add more sections to DetailsView for SpecimenDescription
269 createSpecimenDescriptionSection(rootElement
);
272 Set
<Marker
> descriptionMarkers
= ((DescriptionBase
<?
>) input
).getMarkers();
274 Boolean isUseDescription
= false;
275 for (Marker marker
: descriptionMarkers
) {
276 if (marker
.getMarkerType()!= null && marker
.getMarkerType().getUuid().equals(UsageTermCollection
.uuidUseMarkerType
)) {
277 isUseDescription
= true;
280 if (((DescriptionBase
<?
>) input
).isImageGallery()) {
281 createImageGallerySection(rootElement
);
283 } else if (isUseDescription
) {
284 createUseDescriptionSection(rootElement
);
285 } else if (input
instanceof TaxonDescription
){
286 createTaxonDescriptionSection(rootElement
);
289 createDescriptionSection(rootElement
, false);
292 } else if (input
instanceof DescriptionElementBase
){
293 Set
<Marker
> descriptionMarkers
= new HashSet
<>();
294 if(((DescriptionElementBase
) input
).getInDescription()!=null) {
295 descriptionMarkers
= ((DescriptionElementBase
) input
).getInDescription().getMarkers();
298 Boolean isUseDescription
= false;
299 for (Marker marker
: descriptionMarkers
) {
300 if (marker
.getMarkerType()!= null && marker
.getMarkerType().getUuid().equals(UsageTermCollection
.uuidUseMarkerType
)) {
301 isUseDescription
= true;
305 if (isUseDescription
== true && input
instanceof CategoricalData
) {
306 createUseRecordSection(rootElement
);
308 createDescriptionElementSection(rootElement
, activePart
);
311 } else if (input
instanceof Media
) {
312 createMediaElementSection(rootElement
);
315 //FIXME hack to show more informative message to the user when
316 //DerivedUnit has more than one FieldUnit #4363
317 else if (input
instanceof DerivedUnit
) {
318 DerivedUnit derivedUnit
= (DerivedUnit
)input
;
320 input
= DerivedUnitFacade
.NewInstance(derivedUnit
,
321 PreferencesUtil
.getDerivedUnitConfigurator());
322 } catch (DerivedUnitFacadeNotSupportedException e
) {
323 createEmptySection(e
.getMessage(), rootElement
);
326 else if (input
instanceof DerivedUnitFacade
) {
327 if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.FieldUnit
){
328 if(((DerivedUnitFacade
) input
).innerFieldUnit()==null){
329 MessagingUtils
.error(DetailsViewerE4
.class, "FieldUnit of facade is null", null); //$NON-NLS-1$
332 createFieldUnitSection(rootElement
);
335 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.PreservedSpecimen
){
336 if(((DerivedUnitFacade
) input
).innerDerivedUnit()==null){
337 MessagingUtils
.error(DetailsViewerE4
.class, "DerivedUnit of facade is null", null); //$NON-NLS-1$
340 createDerivedUnitBaseElementSection(rootElement
);
343 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.TissueSample
){
344 //TissueSample should only be created by using it's own class
345 //in future using only one class with different SpecimenOrObservationTypes is desired
346 createTissueSampleSection(rootElement
);
348 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.DnaSample
){
350 if(((DerivedUnitFacade
) input
).innerDerivedUnit().getRecordBasis()==SpecimenOrObservationType
.TissueSample
){
351 createTissueSampleSection(rootElement
);
353 else if(((DerivedUnitFacade
) input
).innerDerivedUnit().getRecordBasis()==SpecimenOrObservationType
.DnaSample
){
354 createDnaSampleSection(rootElement
);
356 }else if (((DerivedUnitFacade
) input
).innerDerivedUnit() instanceof MediaSpecimen
){
357 createMediaSpecimenSection(rootElement
);
361 createDerivedUnitBaseElementSection(rootElement
);
363 } else if (input
instanceof DnaSample
){
364 DnaSample dnaSample
= (DnaSample
)input
;
365 if(dnaSample
.getRecordBasis()==SpecimenOrObservationType
.TissueSample
){
366 createTissueSampleSection(rootElement
);
368 else if(dnaSample
.getRecordBasis()==SpecimenOrObservationType
.DnaSample
){
369 createDnaSampleSection(rootElement
);
371 } else if (input
instanceof MediaSpecimen
){
372 createMediaSpecimenSection(rootElement
);
374 else if(input
instanceof Sequence
){
375 createSequenceSection(rootElement
);
377 else if(input
instanceof SingleRead
){
378 createSingleReadSection(rootElement
);
380 else if (input
instanceof FeatureNodeContainer
) {
381 createFeatureDistributionSection(rootElement
);
383 } else if (input
instanceof TermNode
) {
384 TermType type
= ((TermNode
) input
).getTermType();
385 if(type
.equals(TermType
.Character
) ){
386 createCharacterNodeSection(rootElement
);
388 else if(type
.equals(TermType
.Feature
)){
389 createFeatureNodeSection(rootElement
);
392 } else if (input
instanceof TermTree
) {
393 createFeatureTreeSection(rootElement
);
395 } else if (input
instanceof TermNodeDto
) {
396 TermType type
= ((TermNodeDto
) input
).getTerm().getTermType();
397 if(type
.equals(TermType
.Character
) && activePart
instanceof ICharacterEditor
){
398 createCharacterNodeDtoSection(rootElement
);
400 else if(type
.equals(TermType
.Feature
) || type
.equals(TermType
.Character
)){
401 createFeatureNodeSection(rootElement
);
404 } else if (input
instanceof TermTreeDto
) {
405 createFeatureTreeSectionForDto(rootElement
);
407 } else if (input
instanceof Character
) {
408 createCharacterSection(rootElement
);
410 }else if ((input
instanceof PolytomousKeyNode
) || (input
instanceof PolytomousKeyRelationship
)) {
411 createPolytomousKeyNodeSection(rootElement
);
412 } else if (input
instanceof User
) {
413 createUserSection(rootElement
);
414 } else if (input
instanceof Group
) {
415 createGroupSection(rootElement
);
416 } else if (input
instanceof TaxonRelationship
&& ((TaxonRelationship
)input
).getType()!=null
417 && (((TaxonRelationship
)input
).getType().isAnyMisappliedName() || ((TaxonRelationship
)input
).getType().isAnySynonym() || ((TaxonRelationship
)input
).getType().isMisappliedName())){
418 createMisappliedNameSection(rootElement
);
419 }else if (input
instanceof TaxonRelationship
) {
420 createTaxonRelationshipSection(rootElement
);
421 } else if (input
instanceof TermVocabulary
) {
422 createTermVocabularySection(rootElement
);
423 } else if (input
instanceof DefinedTermBase
) {
424 createDefinedTermSection(rootElement
);
426 } else if (input
instanceof SelectionChangedEvent
) {
427 IStructuredSelection sel
=(IStructuredSelection
) ((SelectionChangedEvent
)input
).getSelection();
428 if (sel
.getFirstElement()instanceof Distribution
){
429 createDescriptionElementSection(rootElement
);
432 // createDescriptionElementSection(rootElement);
435 createEmptySection(null, rootElement
);
442 private void createFeatureTreeSectionForTree(RootElement rootElement
) {
443 // TODO Auto-generated method stub
447 private void createGroupSection(RootElement parent
) {
448 GroupDetailSection groupDetailSection
= formFactory
.createGroupDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(GroupDetailSection
.class, getInput().getClass().getCanonicalName()));
449 MemberDetailSection memberDetailSection
= formFactory
.createMemberDetailSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(MemberDetailSection
.class, getInput().getClass().getCanonicalName()));
450 GrantedAuthorityDetailSection grantedAuthorityDetailSection
= formFactory
.createGrantedAuthorityDetailSection(getConversationHolder(), parent
,StoreUtil
.getSectionStyle(GrantedAuthorityDetailSection
.class, getInput().getClass().getCanonicalName()));
452 addPart(groupDetailSection
);
453 addPart(memberDetailSection
);
454 addPart(grantedAuthorityDetailSection
);
459 public ISelection
getSelection() {
465 public void setSelection(ISelection selection
, boolean reveal
) {
467 this.selection
= selection
;
469 if(this.selection
!=null){
470 SelectionChangedEvent selectionChangedEvent
= new SelectionChangedEvent(this, selection
);
471 fireSelectionChanged(selectionChangedEvent
);
476 private void createTaxonSections(RootElement parent
) {
477 NameDetailsConfigurator config
= PreferencesUtil
.getPreferredNameDetailsConfiguration();
478 EnumSet
<CRUD
> requiredCrud
;
479 if(getInput() == null || StoreUtil
.getCdmEntity(getInput()).getId() == 0) {
480 // new entity, not yet saved
481 requiredCrud
= EnumSet
.of(CRUD
.CREATE
);
483 requiredCrud
= EnumSet
.of(CRUD
.UPDATE
);
485 boolean hasPermission
= CdmStore
.currentAuthentiationHasPermission(StoreUtil
.getCdmEntity(getInput()), requiredCrud
);
487 // check for subtree permissions as well.
488 TaxonBase
<?
> taxonBase
= (TaxonBase
<?
>)getInput();
489 Taxon acceptedTaxon
= null;
490 if (taxonBase
instanceof Taxon
){
491 acceptedTaxon
= (Taxon
)taxonBase
;
493 acceptedTaxon
= ((Synonym
)taxonBase
).getAcceptedTaxon();
495 if (acceptedTaxon
!= null){ //needs discussion if synonyms without accepted taxon should never be filtered by subtree permission(current implementation). See also #8849
496 Set
<TaxonNode
> nodes
= acceptedTaxon
.getTaxonNodes();
497 for (TaxonNode node
: nodes
){
498 hasPermission
&= CdmStore
.currentAuthentiationHasPermission(node
, requiredCrud
);
500 //check whether there are explicit TaxonNode rights
501 boolean taxonnodePermissionExists
= false;
502 Collection
<?
extends GrantedAuthority
> authorities
= CdmStore
.getCurrentAuthentiation().getAuthorities();
503 for (GrantedAuthority grantedAuthority
: authorities
){
504 if (grantedAuthority
.getAuthority().startsWith("TAXONNODE")){
505 taxonnodePermissionExists
= true;
508 if (!taxonnodePermissionExists
){
509 hasPermission
= true;
515 detailsEnabled
= hasPermission
;
516 ParsingMessagesSection parsingMessagesSection
= formFactory
.createParsingMessagesSection(getConversationHolder(), parent
, this,
517 StoreUtil
.getSectionStyle(ParsingMessagesSection
.class, getInput().getClass().getCanonicalName(), true));
519 TaxonBaseDetailSection taxonBaseDetailSection
= formFactory
.createTaxonBaseDetailSection(getConversationHolder(), parent
, this,
520 StoreUtil
.getSectionStyle(TaxonBaseDetailSection
.class, getInput().getClass().getCanonicalName(), true));
521 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
522 // boolean hasPermission = CdmStore.currentAuthentiationHasPermission(getInput(), Operation.UPDATE);
523 taxonBaseDetailSection
.setEnabled(detailsEnabled
);
524 addPart(taxonBaseDetailSection
);
526 if (config
.isTaxonSectionActivated()){
527 TaxonBaseDetailSection taxonBaseDetailSection
= formFactory
.createTaxonBaseDetailSection(getConversationHolder(), parent
, this,
528 StoreUtil
.getSectionStyle(TaxonBaseDetailSection
.class, getInput().getClass().getCanonicalName(), true));
529 taxonBaseDetailSection
.setEnabled(detailsEnabled
);
530 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
531 addPart(taxonBaseDetailSection
);
534 NonViralNameDetailSection nonViralNameSection
= formFactory
535 .createNonViralNameDetailSection(getConversationHolder(), parent
, this, true,
536 StoreUtil
.getSectionStyle(NonViralNameDetailSection
.class, getInput().getClass().getCanonicalName(), true));
537 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
538 nonViralNameSection
.setEnabled(detailsEnabled
);
539 if (config
== null || config
.isNomenclaturalReferenceSectionActivated()){
540 NomenclaturalReferenceDetailSection referenceDetailSection
= formFactory
.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent
, this,
541 StoreUtil
.getSectionStyle(NomenclaturalReferenceDetailSection
.class, getInput().getClass().getCanonicalName(), true));
542 referenceDetailSection
.setEnabled(detailsEnabled
);
543 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
544 addPart(referenceDetailSection
);
547 if ( config
== null || config
.isNomenclaturalStatusSectionActivated()){
548 NomenclaturalStatusSection nomenclaturalStatusSection
= formFactory
.createNomenclaturalStatusSection(getConversationHolder(), parent
,
549 StoreUtil
.getSectionStyle(NomenclaturalStatusSection
.class, getInput().getClass().getCanonicalName(), true));
550 nomenclaturalStatusSection
.setEnabled(detailsEnabled
);
551 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
552 addPart(nomenclaturalStatusSection
);
555 // if ( config == null || config.isProtologueActivated()){
556 // ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(ProtologueSection.class, getInput().getClass().getCanonicalName()));
557 // protologSection.setEnabled(detailsEnabled);
558 // formFactory.createHorizontalSeparator(parent, SWT.BORDER);
559 // addPart(protologSection);
562 if (config
== null || config
.isTypeDesignationSectionActivated()){
563 TypeDesignationSection typeDesignationSection
= formFactory
.createTypeDesignationSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(TypeDesignationSection
.class, getInput().getClass().getCanonicalName()));
564 typeDesignationSection
.setEnabled(detailsEnabled
);
565 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
566 addPart(typeDesignationSection
);
569 if (config
== null || config
.isNameRelationsSectionActivated()){
570 NameRelationshipDetailSection nameRelationshipSection
= formFactory
.createNameRelationshipDetailSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(NameRelationshipDetailSection
.class, getInput().getClass().getCanonicalName()));
571 nameRelationshipSection
.setEnabled(detailsEnabled
);
572 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
573 addPart(nameRelationshipSection
);
577 addPart(parsingMessagesSection
);
579 addPart(nonViralNameSection
);
583 private void createNameSections(RootElement parent
) {
584 NonViralNameDetailSection nonViralNameSection
= formFactory
.createNonViralNameDetailSection(
585 getConversationHolder(), parent
, this, false, StoreUtil
.getSectionStyle(NonViralNameDetailSection
.class, getInput().getClass().getCanonicalName(), true));
587 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
589 NomenclaturalReferenceDetailSection referenceDetailSection
= formFactory
.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent
, this,
590 StoreUtil
.getSectionStyle(NomenclaturalReferenceDetailSection
.class, getInput().getClass().getCanonicalName(), true));
591 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
593 NomenclaturalStatusSection nomenclaturalStatusSection
= formFactory
.createNomenclaturalStatusSection(getConversationHolder(), parent
,
594 StoreUtil
.getSectionStyle(NomenclaturalStatusSection
.class, getInput().getClass().getCanonicalName(), true));
595 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
597 addPart(nonViralNameSection
);
598 addPart(nomenclaturalStatusSection
);
599 addPart(referenceDetailSection
);
601 // ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(ProtologueSection.class, getInput().getClass().getCanonicalName()));
602 // formFactory.createHorizontalSeparator(parent, SWT.BORDER);
604 TypeDesignationSection typeDesignationSection
= formFactory
.createTypeDesignationSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(TypeDesignationSection
.class, getInput().getClass().getCanonicalName()));
605 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
607 NameRelationshipDetailSection nameRelationshipSection
= formFactory
.createNameRelationshipDetailSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(NameRelationshipDetailSection
.class, getInput().getClass().getCanonicalName()));
608 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
609 // addPart(protologSection);
610 addPart(typeDesignationSection
);
611 addPart(nameRelationshipSection
);
615 private void createReferenceSections(RootElement parent
) {
616 ReferenceDetailSection referenceDetailSection
= formFactory
.createReferenceDetailSection(getConversationHolder(), parent
, this,
617 StoreUtil
.getSectionStyle(ReferenceDetailSection
.class, getInput().getClass().getCanonicalName(), true));
619 addPart(referenceDetailSection
);
622 private void createTeamOrPersonBaseDetailSection(RootElement parent
) {
623 TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection
= formFactory
.createTeamOrPersonBaseDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(TeamOrPersonBaseDetailSection
.class, getInput().getClass().getCanonicalName(), true));
625 addPart(teamOrPersonBaseDetailSection
);
628 private void createTeamDetailSection(RootElement parent
) {
629 TeamDetailSection teamDetailSection
= formFactory
.createTeamDetailSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(TeamDetailSection
.class, getInput().getClass().getCanonicalName(), true));
631 addPart(teamDetailSection
);
634 private void createPersonDetailSection(RootElement parent
) {
635 PersonDetailSection personDetailSection
= formFactory
.createPersonDetailSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(PersonDetailSection
.class, getInput().getClass().getCanonicalName(), true));
636 addPart(personDetailSection
);
639 private void createDescriptionElementSection(RootElement parent
) {
640 createDescriptionElementSection(parent
, null);
643 private void createDescriptionElementSection(RootElement parent
, Object activePart
) {
644 DescriptionElementDetailSection descriptionElementDetailSection
= formFactory
.createDescriptionElementDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DescriptionElementDetailSection
.class, getInput().getClass().getCanonicalName(), true));
645 descriptionElementDetailSection
.setEnabled(this.detailsEnabled
);
647 // IntextReferenceSection intextReferenceSection = formFactory.createIntextReferenceSection(getConversationHolder(), parent, getSectionStyle(.class, getInput().getClass().getCanonicalName()));
649 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
650 DescriptionElementSourceSection descriptionElementSourceSection
;
651 if (activePart
!= null && activePart
instanceof IDistributionEditorPart
){
652 Reference defaultSource
=((IDistributionEditorPart
)activePart
).getEditor().getDefaultSource();
653 descriptionElementSourceSection
= formFactory
.createDescriptionElementSourceSection(getConversationHolder(), parent
, defaultSource
, StoreUtil
.getSectionStyle(DescriptionElementSourceSection
.class, getInput().getClass().getCanonicalName()));
656 descriptionElementSourceSection
= formFactory
.createDescriptionElementSourceSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(DescriptionElementSourceSection
.class, getInput().getClass().getCanonicalName()) );
660 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
662 DescriptionElementMediaSection descriptionElementMediaSection
= formFactory
.createDescriptionElementMediaSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(DescriptionElementMediaSection
.class, getInput().getClass().getCanonicalName()));
664 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
666 addPart(descriptionElementDetailSection
);
667 addPart(descriptionElementSourceSection
);
668 addPart(descriptionElementMediaSection
);
671 private void createDescriptionSection(RootElement parent
, boolean isTaxonDescription
) {
672 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DescriptionDetailSection
.class, getInput().getClass().getCanonicalName(), true));
673 addPart(descriptionDetailSection
);
675 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
677 if(isTaxonDescription
) {
678 NaturalLanguageSection naturalLanguageSection
= formFactory
.createNaturalLanguageSection(
679 getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(NaturalLanguageSection
.class, getInput().getClass().getCanonicalName(), true));
680 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
681 addPart(naturalLanguageSection
);
683 DescriptionSourceSection descriptionSourceSection
= formFactory
.createDescriptionSourceSection(
684 getConversationHolder(), parent
, StoreUtil
.getSectionStyle(DescriptionSourceSection
.class, getInput().getClass().getCanonicalName(), true));
685 addPart(descriptionSourceSection
);
687 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
689 if(isTaxonDescription
) {
690 ScopeSection scopeSection
= formFactory
.createScopeSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(ScopeSection
.class, getInput().getClass().getCanonicalName()));
691 addPart(scopeSection
);
695 private void createTaxonDescriptionSection(RootElement parent
) {
696 createDescriptionSection(parent
, true);
699 private void createSpecimenDescriptionSection(RootElement parent
) {
700 createDescriptionSection(parent
, false);
703 private void createUseDescriptionSection(RootElement parent
) {
704 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DescriptionDetailSection
.class, getInput().getClass().getCanonicalName()));
706 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
708 DescriptionSourceSection descriptionSourceSection
= formFactory
.createDescriptionSourceSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(DescriptionSourceSection
.class, getInput().getClass().getCanonicalName()));
710 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
712 addPart(descriptionDetailSection
);
713 addPart(descriptionSourceSection
);
717 private void createImageGallerySection(RootElement parent
) {
718 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DescriptionDetailSection
.class, getInput().getClass().getCanonicalName()));
720 addPart(descriptionDetailSection
);
723 private void createMediaElementSection(RootElement parent
) {
724 MediaDetailsSection mediaDetailSection
= formFactory
.createMediaDetailsSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(MediaDetailsSection
.class, getInput().getClass().getCanonicalName(), true));
726 addPart(mediaDetailSection
);
729 private void createDerivedUnitBaseElementSection(RootElement parent
) {
730 DerivedUnitGeneralDetailSection derivedUnitGeneralDetailSection
= formFactory
.createDerivedUnitGeneralDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DerivedUnitGeneralDetailSection
.class, getInput().getClass().getCanonicalName(), true));
731 //TODO for DerivateEditor do not use facade anymore to avoid this special case handling #4539
732 if(!(AbstractUtility
.getActivePart() instanceof IDerivedUnitFacadePart
)){
733 derivedUnitGeneralDetailSection
.setShowOnlyDerivedUnitData(true);
735 addPart(derivedUnitGeneralDetailSection
);
737 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
739 DerivedUnitBaseDetailSection derivedUnitBaseDetailSection
= formFactory
.createDerivedUnitBaseDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DerivedUnitBaseDetailSection
.class, getInput().getClass().getCanonicalName(), true));
740 addPart(derivedUnitBaseDetailSection
);
742 //for editors working with facades
743 if(AbstractUtility
.getActivePart() instanceof IDerivedUnitFacadePart
){
744 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
745 GatheringEventDetailSection gatheringEventDetailSection
= formFactory
.createGatheringEventDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(GatheringEventDetailSection
.class, getInput().getClass().getCanonicalName()));
746 addPart(gatheringEventDetailSection
);
748 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
749 FieldUnitDetailSection fieldUnitDetailSection
= formFactory
.createFieldUnitDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(FieldUnitDetailSection
.class, getInput().getClass().getCanonicalName()));
750 addPart(fieldUnitDetailSection
);
754 if(PreferencesUtil
.isShowTaxonAssociations()){
755 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
756 TaxonAssociationDetailSection taxonAssociationDetailSection
= formFactory
.createTaxonAssociationDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(TaxonAssociationDetailSection
.class, getInput().getClass().getCanonicalName(), true));
757 addPart(taxonAssociationDetailSection
);
759 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
760 DerivedUnitFacadeIdentifierSection identifierDetailSection
= formFactory
.createDerivedUnitFacadeIdentifierSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(DerivedUnitFacadeIdentifierSection
.class, getInput().getClass().getCanonicalName()));
761 addPart(identifierDetailSection
);
763 if(!PreferencesUtil
.isDeterminationOnlyForFieldUnits()){
764 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
765 DeterminationDetailSection determinationDetailSection
= formFactory
.createDeterminationDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DeterminationDetailSection
.class, getInput().getClass().getCanonicalName()));
766 addPart(determinationDetailSection
);
769 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
770 DerivedUnitTypeDesignationSection derivedUnitTypeDesignationSection
= formFactory
.createDerivedUnitTypeDesignationSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DerivedUnitTypeDesignationSection
.class, getInput().getClass().getCanonicalName()));
771 addPart(derivedUnitTypeDesignationSection
);
775 private void createFieldUnitSection(RootElement parent
) {
776 FieldUnitGeneralDetailSection fielUnitGeneralDetailSection
= formFactory
.createFieldUnitGeneralDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(FieldUnitGeneralDetailSection
.class, getInput().getClass().getCanonicalName(), true));
778 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
780 GatheringEventDetailSection gatheringEventDetailSection
= formFactory
.createGatheringEventDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(GatheringEventDetailSection
.class, getInput().getClass().getCanonicalName()));
782 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
784 FieldUnitDetailSection fieldUnitDetailSection
= formFactory
.createFieldUnitDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(FieldUnitDetailSection
.class, getInput().getClass().getCanonicalName()));
786 addPart(fielUnitGeneralDetailSection
);
787 addPart(gatheringEventDetailSection
);
788 addPart(fieldUnitDetailSection
);
790 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
791 DeterminationDetailSection determinationDetailSection
= formFactory
.createDeterminationDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DeterminationDetailSection
.class, getInput().getClass().getCanonicalName()));
792 addPart(determinationDetailSection
);
796 private void createTissueSampleSection(RootElement parent
) {
797 TissueSampleGeneralDetailSection section
= formFactory
.createTissueSampleGeneralDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(TissueSampleGeneralDetailSection
.class, getInput().getClass().getCanonicalName(), true));
799 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
801 SampleDesignationDetailSection sampleDesignationDetailSection
= formFactory
.createSampleDesignationDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(SampleDesignationDetailSection
.class, getInput().getClass().getCanonicalName(), true));
804 addPart(sampleDesignationDetailSection
);
807 private void createDnaSampleSection(RootElement parent
) {
808 DnaSampleGeneralDetailSection section
= formFactory
.createDnaSampleGeneralDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DnaSampleGeneralDetailSection
.class, getInput().getClass().getCanonicalName(), true));
810 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
812 DnaSamplePreparationPreservationSection preparationPreservationSection
= formFactory
.createDnaSamplePreparationPreservationSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DnaSamplePreparationPreservationSection
.class, getInput().getClass().getCanonicalName(), true));
814 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
816 DnaQualityDetailSection qualitySection
= formFactory
.createDnaQualityDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DnaQualityDetailSection
.class, getInput().getClass().getCanonicalName(), true));
818 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
820 SampleDesignationDetailSection sampleDesignationDetailSection
= formFactory
.createSampleDesignationDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(SampleDesignationDetailSection
.class, getInput().getClass().getCanonicalName(), true));
822 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
823 DeterminationDetailSection determinationDetailSection
= null;
824 if(!PreferencesUtil
.isDeterminationOnlyForFieldUnits()){
825 determinationDetailSection
= formFactory
.createDeterminationDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DeterminationDetailSection
.class, getInput().getClass().getCanonicalName()));
828 addPart(preparationPreservationSection
);
829 addPart(qualitySection
);
830 addPart(sampleDesignationDetailSection
);
831 if(!PreferencesUtil
.isDeterminationOnlyForFieldUnits()){
832 addPart(determinationDetailSection
);
836 private void createSequenceSection(RootElement parent
) {
837 SequenceGeneralDetailSection section
= formFactory
.createSequenceGeneralDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(SequenceGeneralDetailSection
.class, getInput().getClass().getCanonicalName(), true));
839 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
841 SequenceReferenceCollectionDetailSection referenceSection
= formFactory
.createSequenceReferenceCollectionDetailSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(SequenceReferenceCollectionDetailSection
.class, getInput().getClass().getCanonicalName(), true));
843 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
845 SequenceContigFileCollectionDetailSection contigFileSection
= formFactory
.createSequenceContigFileCollectionDetailSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(SequenceContigFileCollectionDetailSection
.class, getInput().getClass().getCanonicalName(), true));
849 addPart(referenceSection
);
850 addPart(contigFileSection
);
853 private void createSingleReadSection(RootElement parent
) {
854 SingleReadGeneralDetailSection section
= formFactory
.createSingleReadGeneralDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(SingleReadGeneralDetailSection
.class, getInput().getClass().getCanonicalName(), true));
857 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
859 SingleReadPherogramCollectionDetailSection pherogramSection
= formFactory
.createSingleReadPherogramCollectionDetailSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(SingleReadPherogramCollectionDetailSection
.class, getInput().getClass().getCanonicalName(), true));
860 addPart(pherogramSection
);
864 private void createMediaSpecimenSection(RootElement parent
) {
865 MediaSpecimenGeneralDetailSection generalSection
= formFactory
.createMediaSpecimenGeneralDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(MediaSpecimenGeneralDetailSection
.class, getInput().getClass().getCanonicalName(), true));
866 addPart(generalSection
);
868 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
870 RightsSection rightsSection
= formFactory
.createRightsSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(RightsSection
.class, getInput().getClass().getCanonicalName()));
871 // rightsSection.setEntity(generalSection.getEntity().innerDerivedUnit());
872 addPart(rightsSection
);
876 private void createFeatureTreeSectionForDto(RootElement parent
) {
877 FeatureTreeDetailSection section
= formFactory
.createFeatureTreeDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(FeatureTreeDetailSection
.class, getInput().getClass().getCanonicalName(), true));
881 private void createFeatureTreeSection(RootElement parent
) {
882 FeatureTreeDetailSectionForNode section
= formFactory
.createFeatureTreeDetailSectionForTree(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(FeatureTreeDetailSection
.class, getInput().getClass().getCanonicalName(), true));
887 private void createFeatureNodeSection(RootElement parent
) {
888 FeatureNodeDetailSection featureDistributionSection
= formFactory
.createFeatureNodeDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(FeatureNodeDetailSection
.class, getInput().getClass().getCanonicalName(), true));
890 addPart(featureDistributionSection
);
893 private void createFeatureDistributionSection(RootElement parent
) {
894 FeatureDistributionDetailSection featureDistributionSection
= formFactory
.createFeatureDistributionDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(FeatureDistributionDetailSection
.class, getInput().getClass().getCanonicalName(), true));
896 addPart(featureDistributionSection
);
899 private void createCharacterNodeSection(RootElement parent
) {
900 CharacterNodeDetailSection featureDistributionSection
= formFactory
.createCharacterNodeDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(CharacterDetailSection
.class, getInput().getClass().getCanonicalName(), true));
901 addPart(featureDistributionSection
);
904 private void createCharacterNodeDtoSection(RootElement parent
) {
905 CharacterNodeDtoDetailSection featureDistributionSection
= formFactory
.createCharacterNodeDtoDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(CharacterDetailSection
.class, getInput().getClass().getCanonicalName(), true));
906 addPart(featureDistributionSection
);
909 private void createCharacterSection(RootElement parent
) {
910 CharacterDetailSection featureDistributionSection
= formFactory
.createCharacterDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(CharacterDetailSection
.class, getInput().getClass().getCanonicalName(), true));
911 addPart(featureDistributionSection
);
914 private void createPolytomousKeyNodeSection(RootElement parent
) {
915 PolytomousKeyDetailSection polytomousKeyDetailSection
= formFactory
.createPolytomousKeyDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(PolytomousKeyDetailSection
.class, getInput().getClass().getCanonicalName()));
917 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
919 PolytomousKeyNodeDetailSection polytomousKeyNodeDetailSection
= formFactory
.createPolytomousKeyNodeDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(PolytomousKeyNodeDetailSection
.class, getInput().getClass().getCanonicalName(), true));
921 addPart(polytomousKeyDetailSection
);
922 addPart(polytomousKeyNodeDetailSection
);
926 private void createUseRecordSection(RootElement parent
) {
927 UseRecordDetailSection descriptionUseRecordSection
= formFactory
.createUseRecordDetailSection(getConversationHolder(), parent
, this,StoreUtil
.getSectionStyle(UseRecordDetailSection
.class, getInput().getClass().getCanonicalName(), true));
929 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
931 addPart(descriptionUseRecordSection
);
936 private void createUserSection(RootElement parent
) {
937 UserDetailSection userDetailSection
= formFactory
.createUserDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(UserDetailSection
.class, getInput().getClass().getCanonicalName(), true));
939 GroupsByUserDetailSection groupByUserDetailSection
= formFactory
.createGroupsByUserDetailSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(GroupsByUserDetailSection
.class, getInput().getClass().getCanonicalName(), true));
941 addPart(userDetailSection
);
942 addPart(groupByUserDetailSection
);
945 private void createMisappliedNameSection(RootElement parent
) {
946 TaxonRelationshipDetailSection taxonRelationshipDetailSection
= formFactory
.createTaxonRelationshipDetailSection(getConversationHolder(), parent
, this,
947 StoreUtil
.getSectionStyle(TaxonRelationshipDetailSection
.class, getInput().getClass().getCanonicalName(), true));
948 addPart(taxonRelationshipDetailSection
);
950 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
953 NonViralNameDetailSection nonViralNameSection
= formFactory
954 .createNonViralNameDetailSection(getConversationHolder(), parent
, this, true,
955 StoreUtil
.getSectionStyle(NonViralNameDetailSection
.class, getInput().getClass().getCanonicalName(), true));
956 addPart(nonViralNameSection
);
958 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
960 NomenclaturalReferenceDetailSection referenceDetailSection
= formFactory
.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent
, this,
961 StoreUtil
.getSectionStyle(NomenclaturalReferenceDetailSection
.class, getInput().getClass().getCanonicalName(), true));
962 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
963 addPart(referenceDetailSection
);
966 NomenclaturalStatusSection nomenclaturalStatusSection
= formFactory
.createNomenclaturalStatusSection(getConversationHolder(), parent
,
967 StoreUtil
.getSectionStyle(NomenclaturalStatusSection
.class, getInput().getClass().getCanonicalName(), true));
968 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
969 addPart(nomenclaturalStatusSection
);
971 // ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(ProtologueSection.class, getInput().getClass().getCanonicalName()));
972 // formFactory.createHorizontalSeparator(parent, SWT.BORDER);
973 // addPart(protologSection);
975 TypeDesignationSection typeDesignationSection
= formFactory
.createTypeDesignationSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(TypeDesignationSection
.class, getInput().getClass().getCanonicalName()));
976 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
977 addPart(typeDesignationSection
);
979 NameRelationshipDetailSection nameRelationshipSection
= formFactory
.createNameRelationshipDetailSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(NameRelationshipDetailSection
.class, getInput().getClass().getCanonicalName()));
980 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
981 addPart(nameRelationshipSection
);
985 private void createTaxonRelationshipSection(RootElement parent
) {
986 TaxonRelationshipDetailSection taxonRelationshipDetailSection
= formFactory
.createTaxonRelationshipDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(TaxonRelationshipDetailSection
.class, getInput().getClass().getCanonicalName(), true));
988 ReferencedEntityDetailSection referencedEntityBaseDetailSection
= formFactory
.createReferencedEntityDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(ReferencedEntityDetailSection
.class, getInput().getClass().getCanonicalName(), true));
989 addPart(taxonRelationshipDetailSection
);
990 addPart(referencedEntityBaseDetailSection
);
992 private void createTermVocabularySection(RootElement parent
) {
993 TermVocabularyDetailSection termVocabularyDetailSection
= formFactory
.createTermVocabularyDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(TermVocabularyDetailSection
.class, getInput().getClass().getCanonicalName(), true));
994 addPart(termVocabularyDetailSection
);
997 private void createDefinedTermSection(RootElement parent
) {
998 DefinedTermDetailSection definedTermDetailSection
= formFactory
.createDefinedTermDetailSection(getInput().getClass(), getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DefinedTermDetailSection
.class, getInput().getClass().getCanonicalName(), true));
999 addPart(definedTermDetailSection
);
1000 TermMediaSection termMediaSection
= formFactory
.createTermMediaSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(DefinedTermDetailSection
.class, getInput().getClass().getCanonicalName(), true));
1001 addPart(termMediaSection
);
1005 public void update(CdmDataChangeMap arg0
) {
1010 private void updateView(@UIEventTopic(WorkbenchEventConstants
.REFRESH_DETAILS
)boolean refresh
){
1018 private void updateView(@UIEventTopic(WorkbenchEventConstants
.REFRESH_DETAILS_DISTRIBUTION
)String nameCache
){
1019 if(nameCache
!= null && getInput() instanceof Distribution
&& this.activePart
instanceof IDistributionEditorPart
){
1020 if (part
instanceof CdmSectionPart
&& ((CdmSectionPart
)part
).getSection() instanceof DescriptionElementDetailSection
){
1021 for (ICdmFormElement element
: ((DescriptionElementDetailSection
)((CdmSectionPart
)part
).getSection()).getElements()){
1022 if (element
instanceof DescriptionElementDetailElement
){
1023 for(ICdmFormElement descriptionElement
:((DescriptionElementDetailElement
)element
).getElements()){
1024 if (descriptionElement
instanceof DistributionDetailElement
){
1025 ((DistributionDetailElement
) descriptionElement
).setName(nameCache
);