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
.hibernate
.CdmDataChangeMap
;
67 import eu
.etaxonomy
.taxeditor
.editor
.IDistributionEditorPart
;
68 import eu
.etaxonomy
.taxeditor
.event
.WorkbenchEventConstants
;
69 import eu
.etaxonomy
.taxeditor
.l10n
.Messages
;
70 import eu
.etaxonomy
.taxeditor
.model
.AbstractUtility
;
71 import eu
.etaxonomy
.taxeditor
.model
.FeatureNodeContainer
;
72 import eu
.etaxonomy
.taxeditor
.model
.IDerivedUnitFacadePart
;
73 import eu
.etaxonomy
.taxeditor
.model
.MessagingUtils
;
74 import eu
.etaxonomy
.taxeditor
.model
.PolytomousKeyRelationship
;
75 import eu
.etaxonomy
.taxeditor
.preference
.NameDetailsConfigurator
;
76 import eu
.etaxonomy
.taxeditor
.preference
.PreferencesUtil
;
77 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
78 import eu
.etaxonomy
.taxeditor
.store
.StoreUtil
;
79 import eu
.etaxonomy
.taxeditor
.store
.UsageTermCollection
;
80 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
81 import eu
.etaxonomy
.taxeditor
.ui
.element
.RootElement
;
82 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.PersonDetailSection
;
83 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamDetailSection
;
84 import eu
.etaxonomy
.taxeditor
.ui
.section
.agent
.TeamOrPersonBaseDetailSection
;
85 import eu
.etaxonomy
.taxeditor
.ui
.section
.common
.ReferencedEntityDetailSection
;
86 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionDetailSection
;
87 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailElement
;
88 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementDetailSection
;
89 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementMediaSection
;
90 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionElementSourceSection
;
91 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.DescriptionSourceSection
;
92 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.MediaDetailsSection
;
93 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.NaturalLanguageSection
;
94 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.ScopeSection
;
95 import eu
.etaxonomy
.taxeditor
.ui
.section
.description
.detail
.DistributionDetailElement
;
96 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.CharacterDetailSection
;
97 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.CharacterNodeDetailSection
;
98 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureDistributionDetailSection
;
99 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureNodeDetailSection
;
100 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.FeatureTreeDetailSection
;
101 import eu
.etaxonomy
.taxeditor
.ui
.section
.grantedAuthority
.GrantedAuthorityDetailSection
;
102 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.GroupDetailSection
;
103 import eu
.etaxonomy
.taxeditor
.ui
.section
.group
.MemberDetailSection
;
104 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyDetailSection
;
105 import eu
.etaxonomy
.taxeditor
.ui
.section
.key
.PolytomousKeyNodeDetailSection
;
106 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NameRelationshipDetailSection
;
107 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NomenclaturalStatusSection
;
108 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.NonViralNameDetailSection
;
109 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.ProtologueSection
;
110 import eu
.etaxonomy
.taxeditor
.ui
.section
.name
.TypeDesignationSection
;
111 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitBaseDetailSection
;
112 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DerivedUnitGeneralDetailSection
;
113 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.DeterminationDetailSection
;
114 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitDetailSection
;
115 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.FieldUnitGeneralDetailSection
;
116 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.GatheringEventDetailSection
;
117 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.association
.DerivedUnitTypeDesignationSection
;
118 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.association
.TaxonAssociationDetailSection
;
119 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaQualityDetailSection
;
120 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaSampleGeneralDetailSection
;
121 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.DnaSamplePreparationPreservationSection
;
122 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SampleDesignationDetailSection
;
123 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceContigFileCollectionDetailSection
;
124 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceGeneralDetailSection
;
125 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SequenceReferenceCollectionDetailSection
;
126 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SingleReadGeneralDetailSection
;
127 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.SingleReadPherogramCollectionDetailSection
;
128 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.TissueSampleGeneralDetailSection
;
129 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.media
.MediaSpecimenGeneralDetailSection
;
130 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.NomenclaturalReferenceDetailSection
;
131 import eu
.etaxonomy
.taxeditor
.ui
.section
.reference
.ReferenceDetailSection
;
132 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.RightsSection
;
133 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.identifier
.DerivedUnitFacadeIdentifierSection
;
134 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.ParsingMessagesSection
;
135 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonBaseDetailSection
;
136 import eu
.etaxonomy
.taxeditor
.ui
.section
.taxon
.TaxonRelationshipDetailSection
;
137 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.GroupsByUserDetailSection
;
138 import eu
.etaxonomy
.taxeditor
.ui
.section
.user
.UserDetailSection
;
139 import eu
.etaxonomy
.taxeditor
.ui
.section
.userecords
.UseRecordDetailSection
;
140 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.DefinedTermDetailSection
;
141 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermMediaSection
;
142 import eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
.TermVocabularyDetailSection
;
143 import eu
.etaxonomy
.taxeditor
.view
.detail
.CdmSectionPart
;
144 import eu
.etaxonomy
.taxeditor
.view
.e4
.AbstractCdmDataViewerE4
;
148 * The DetailsViewer handles the content of the details view (
149 * {@link DetailsPartE4}).<br>
150 * Depending on the type of the selected element the section of the details view
157 public class DetailsViewerE4
extends AbstractCdmDataViewerE4
{
159 private ISelection selection
;
160 private boolean detailsEnabled
= true;
161 private Object activePart
;
163 public boolean isDetailsEnabled() {
164 return detailsEnabled
;
167 public void setDetailsEnabled(boolean detailsEnabled
) {
168 this.detailsEnabled
= detailsEnabled
;
171 public void setInput(Object input
, Object activePart
) {
172 this.activePart
= activePart
;
176 // START HACK TO MAKE THE DERIVED UNIT FACADE WORK
177 // since we are getting implementations of DerivedUnitBase from the bulk
179 // and not derived unit facade objects,
182 public void setInput(Object input
) {
184 if(input
instanceof TreeNode
){
185 input
= ((TreeNode
) input
).getValue();
187 if(input
instanceof GbifResponse
){
188 input
= ((GbifResponse
) input
).getDerivedUnitFacade();
190 if (input
!=null && input
instanceof DerivedUnit
) {
191 DerivedUnit derivedUnit
= (DerivedUnit
)input
;
193 input
= DerivedUnitFacade
.NewInstance(derivedUnit
,
194 PreferencesUtil
.getDerivedUnitConfigurator());
195 } catch (DerivedUnitFacadeNotSupportedException e
) {
196 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
199 else if(input
instanceof FieldUnit
){
200 input
= DerivedUnitFacade
.NewInstance(SpecimenOrObservationType
.FieldUnit
, (FieldUnit
) input
);
202 super.setInput(input
);
206 protected void markViewPartDirty() {
207 if (getInput() instanceof DerivedUnitFacade
) {
208 if(part
instanceof IDerivedUnitFacadePart
){
209 part
.changed(getInput());
212 DerivedUnitFacade facade
= (DerivedUnitFacade
) getInput();
213 if(facade
.innerDerivedUnit()!=null){
214 part
.changed(facade
.innerDerivedUnit());
216 else if(facade
.innerFieldUnit()!=null){
217 part
.changed(facade
.innerFieldUnit());
222 super.markViewPartDirty();
228 protected void showParts() {
229 // FIXME (CM) : Need to clean out this code.
230 // Too much type checking to decide which detail view to display.
231 // Need to build in a mechanism where navigators / editors are 'aware'
232 // of the corresponding detail viewer.
234 Object input
= getInput();
239 if (input
instanceof TaxonBase
) {
240 if(((TaxonBase
) input
).getName()==null){
241 createEmptySection(Messages
.DetailsViewerE4_TAXON_HAS_NO_NAME
, rootElement
);
244 createTaxonSections(rootElement
);
247 } else if (input
instanceof TaxonName
) {
248 createNameSections(rootElement
);
250 } else if (input
instanceof Reference
) {
251 createReferenceSections(rootElement
);
253 } else if (input
instanceof Team
) {
254 createTeamDetailSection(rootElement
);
256 } else if (input
instanceof Person
) {
257 createPersonDetailSection(rootElement
);
259 } else if (input
instanceof TeamOrPersonBase
) {
260 createTeamOrPersonBaseDetailSection(rootElement
);
262 } else if (input
instanceof DescriptionBase
) {
263 if(input
instanceof SpecimenDescription
){
264 //TODO: add more sections to DetailsView for SpecimenDescription
265 createSpecimenDescriptionSection(rootElement
);
268 Set
<Marker
> descriptionMarkers
= ((DescriptionBase
<?
>) input
).getMarkers();
270 Boolean isUseDescription
= false;
271 for (Marker marker
: descriptionMarkers
) {
272 if (marker
.getMarkerType()!= null && marker
.getMarkerType().getUuid().equals(UsageTermCollection
.uuidUseMarkerType
)) {
273 isUseDescription
= true;
276 if (((DescriptionBase
<?
>) input
).isImageGallery()) {
277 createImageGallerySection(rootElement
);
279 } else if (isUseDescription
) {
280 createUseDescriptionSection(rootElement
);
281 } else if (input
instanceof TaxonDescription
){
282 createTaxonDescriptionSection(rootElement
);
285 createDescriptionSection(rootElement
, false);
288 } else if (input
instanceof DescriptionElementBase
){
289 Set
<Marker
> descriptionMarkers
= new HashSet
<>();
290 if(((DescriptionElementBase
) input
).getInDescription()!=null) {
291 descriptionMarkers
= ((DescriptionElementBase
) input
).getInDescription().getMarkers();
294 Boolean isUseDescription
= false;
295 for (Marker marker
: descriptionMarkers
) {
296 if (marker
.getMarkerType()!= null && marker
.getMarkerType().getUuid().equals(UsageTermCollection
.uuidUseMarkerType
)) {
297 isUseDescription
= true;
301 if (isUseDescription
== true && input
instanceof CategoricalData
) {
302 createUseRecordSection(rootElement
);
304 createDescriptionElementSection(rootElement
, activePart
);
307 } else if (input
instanceof Media
) {
308 createMediaElementSection(rootElement
);
311 //FIXME hack to show more informative message to the user when
312 //DerivedUnit has more than one FieldUnit #4363
313 else if (input
instanceof DerivedUnit
) {
314 DerivedUnit derivedUnit
= (DerivedUnit
)input
;
316 input
= DerivedUnitFacade
.NewInstance(derivedUnit
,
317 PreferencesUtil
.getDerivedUnitConfigurator());
318 } catch (DerivedUnitFacadeNotSupportedException e
) {
319 createEmptySection(e
.getMessage(), rootElement
);
322 else if (input
instanceof DerivedUnitFacade
) {
323 if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.FieldUnit
){
324 if(((DerivedUnitFacade
) input
).innerFieldUnit()==null){
325 MessagingUtils
.error(DetailsViewerE4
.class, "FieldUnit of facade is null", null); //$NON-NLS-1$
328 createFieldUnitSection(rootElement
);
331 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.PreservedSpecimen
){
332 if(((DerivedUnitFacade
) input
).innerDerivedUnit()==null){
333 MessagingUtils
.error(DetailsViewerE4
.class, "DerivedUnit of facade is null", null); //$NON-NLS-1$
336 createDerivedUnitBaseElementSection(rootElement
);
339 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.TissueSample
){
340 //TissueSample should only be created by using it's own class
341 //in future using only one class with different SpecimenOrObservationTypes is desired
342 createTissueSampleSection(rootElement
);
344 else if(((DerivedUnitFacade
) input
).getType()==SpecimenOrObservationType
.DnaSample
){
346 if(((DerivedUnitFacade
) input
).innerDerivedUnit().getRecordBasis()==SpecimenOrObservationType
.TissueSample
){
347 createTissueSampleSection(rootElement
);
349 else if(((DerivedUnitFacade
) input
).innerDerivedUnit().getRecordBasis()==SpecimenOrObservationType
.DnaSample
){
350 createDnaSampleSection(rootElement
);
355 createDerivedUnitBaseElementSection(rootElement
);
357 } else if (input
instanceof DnaSample
){
358 DnaSample dnaSample
= (DnaSample
)input
;
359 if(dnaSample
.getRecordBasis()==SpecimenOrObservationType
.TissueSample
){
360 createTissueSampleSection(rootElement
);
362 else if(dnaSample
.getRecordBasis()==SpecimenOrObservationType
.DnaSample
){
363 createDnaSampleSection(rootElement
);
365 } else if (input
instanceof MediaSpecimen
){
366 createMediaSpecimenSection(rootElement
);
368 else if(input
instanceof Sequence
){
369 createSequenceSection(rootElement
);
371 else if(input
instanceof SingleRead
){
372 createSingleReadSection(rootElement
);
374 else if (input
instanceof FeatureNodeContainer
) {
375 createFeatureDistributionSection(rootElement
);
377 } else if (input
instanceof TermNode
) {
378 TermType type
= ((TermNode
) input
).getTermType();
379 if(type
.equals(TermType
.Character
)){
380 createCharacterNodeSection(rootElement
);
382 else if(type
.equals(TermType
.Feature
)){
383 createFeatureNodeSection(rootElement
);
386 } else if (input
instanceof TermTree
) {
387 createFeatureTreeSection(rootElement
);
389 } else if (input
instanceof Character
) {
390 createCharacterSection(rootElement
);
392 }else if ((input
instanceof PolytomousKeyNode
) || (input
instanceof PolytomousKeyRelationship
)) {
393 createPolytomousKeyNodeSection(rootElement
);
394 } else if (input
instanceof User
) {
395 createUserSection(rootElement
);
396 } else if (input
instanceof Group
) {
397 createGroupSection(rootElement
);
398 } else if (input
instanceof TaxonRelationship
&& ((TaxonRelationship
)input
).getType()!=null
399 && (((TaxonRelationship
)input
).getType().isAnyMisappliedName() || ((TaxonRelationship
)input
).getType().isAnySynonym() || ((TaxonRelationship
)input
).getType().isMisappliedNameOrInvalidDesignation())){
400 createMisappliedNameSection(rootElement
);
401 }else if (input
instanceof TaxonRelationship
) {
402 createTaxonRelationshipSection(rootElement
);
403 } else if (input
instanceof TermVocabulary
) {
404 createTermVocabularySection(rootElement
);
405 } else if (input
instanceof DefinedTermBase
) {
406 createDefinedTermSection(rootElement
);
408 } else if (input
instanceof SelectionChangedEvent
) {
409 IStructuredSelection sel
=(IStructuredSelection
) ((SelectionChangedEvent
)input
).getSelection();
410 if (sel
.getFirstElement()instanceof Distribution
){
411 createDescriptionElementSection(rootElement
);
414 // createDescriptionElementSection(rootElement);
417 createEmptySection(null, rootElement
);
423 private void createGroupSection(RootElement parent
) {
424 GroupDetailSection groupDetailSection
= formFactory
.createGroupDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(GroupDetailSection
.class, getInput().getClass().getCanonicalName()));
425 MemberDetailSection memberDetailSection
= formFactory
.createMemberDetailSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(MemberDetailSection
.class, getInput().getClass().getCanonicalName()));
426 GrantedAuthorityDetailSection grantedAuthorityDetailSection
= formFactory
.createGrantedAuthorityDetailSection(getConversationHolder(), parent
,StoreUtil
.getSectionStyle(GrantedAuthorityDetailSection
.class, getInput().getClass().getCanonicalName()));
428 addPart(groupDetailSection
);
429 addPart(memberDetailSection
);
430 addPart(grantedAuthorityDetailSection
);
435 public ISelection
getSelection() {
441 public void setSelection(ISelection selection
, boolean reveal
) {
443 this.selection
= selection
;
445 if(this.selection
!=null){
446 SelectionChangedEvent selectionChangedEvent
= new SelectionChangedEvent(this, selection
);
447 fireSelectionChanged(selectionChangedEvent
);
452 private void createTaxonSections(RootElement parent
) {
453 NameDetailsConfigurator config
= PreferencesUtil
.getPreferredNameDetailsConfiguration();
454 EnumSet
<CRUD
> requiredCrud
;
455 if(getInput() == null || StoreUtil
.getCdmEntity(getInput()).getId() == 0) {
456 // new entity, not yet saved
457 requiredCrud
= EnumSet
.of(CRUD
.CREATE
);
459 requiredCrud
= EnumSet
.of(CRUD
.UPDATE
);
461 boolean hasPermission
= CdmStore
.currentAuthentiationHasPermission(StoreUtil
.getCdmEntity(getInput()), requiredCrud
);
462 TaxonBase taxonBase
= (TaxonBase
)getInput();
463 Taxon acceptedTaxon
= null;
464 if (taxonBase
instanceof Taxon
){
465 acceptedTaxon
= (Taxon
)taxonBase
;
467 acceptedTaxon
= ((Synonym
)taxonBase
).getAcceptedTaxon();
469 Set
<TaxonNode
> nodes
= acceptedTaxon
.getTaxonNodes();
470 // check for subtree permissions as well.
472 for (TaxonNode node
: nodes
){
473 hasPermission
&= CdmStore
.currentAuthentiationHasPermission(node
, requiredCrud
);
475 //check whether there are explicit TaxonNode rights
476 boolean taxonnodePermissionExists
= false;
477 Collection
<?
extends GrantedAuthority
> authorities
= CdmStore
.getCurrentAuthentiation().getAuthorities();
478 for (GrantedAuthority grantedAuthority
: authorities
){
479 if (grantedAuthority
.getAuthority().startsWith("TAXONNODE")){
480 taxonnodePermissionExists
= true;
483 if (!taxonnodePermissionExists
){
484 hasPermission
= true;
489 detailsEnabled
= hasPermission
;
490 ParsingMessagesSection parsingMessagesSection
= formFactory
.createParsingMessagesSection(getConversationHolder(), parent
, this,
491 StoreUtil
.getSectionStyle(ParsingMessagesSection
.class, getInput().getClass().getCanonicalName(), true));
493 TaxonBaseDetailSection taxonBaseDetailSection
= formFactory
.createTaxonBaseDetailSection(getConversationHolder(), parent
, this,
494 StoreUtil
.getSectionStyle(TaxonBaseDetailSection
.class, getInput().getClass().getCanonicalName(), true));
495 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
496 // boolean hasPermission = CdmStore.currentAuthentiationHasPermission(getInput(), Operation.UPDATE);
497 taxonBaseDetailSection
.setEnabled(detailsEnabled
);
498 addPart(taxonBaseDetailSection
);
500 if (config
.isTaxonSectionActivated()){
501 TaxonBaseDetailSection taxonBaseDetailSection
= formFactory
.createTaxonBaseDetailSection(getConversationHolder(), parent
, this,
502 StoreUtil
.getSectionStyle(TaxonBaseDetailSection
.class, getInput().getClass().getCanonicalName(), true));
503 taxonBaseDetailSection
.setEnabled(detailsEnabled
);
504 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
505 addPart(taxonBaseDetailSection
);
508 NonViralNameDetailSection nonViralNameSection
= formFactory
509 .createNonViralNameDetailSection(getConversationHolder(), parent
, this, true,
510 StoreUtil
.getSectionStyle(NonViralNameDetailSection
.class, getInput().getClass().getCanonicalName(), true));
511 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
512 nonViralNameSection
.setEnabled(detailsEnabled
);
513 if (config
== null || config
.isNomenclaturalReferenceSectionActivated()){
514 NomenclaturalReferenceDetailSection referenceDetailSection
= formFactory
.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent
, this,
515 StoreUtil
.getSectionStyle(NomenclaturalReferenceDetailSection
.class, getInput().getClass().getCanonicalName(), true));
516 referenceDetailSection
.setEnabled(detailsEnabled
);
517 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
518 addPart(referenceDetailSection
);
521 if ( config
== null || config
.isNomenclaturalStatusSectionActivated()){
522 NomenclaturalStatusSection nomenclaturalStatusSection
= formFactory
.createNomenclaturalStatusSection(getConversationHolder(), parent
,
523 StoreUtil
.getSectionStyle(NomenclaturalStatusSection
.class, getInput().getClass().getCanonicalName(), true));
524 nomenclaturalStatusSection
.setEnabled(detailsEnabled
);
525 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
526 addPart(nomenclaturalStatusSection
);
529 if ( config
== null || config
.isProtologueActivated()){
530 ProtologueSection protologSection
= formFactory
.createProtologueSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(ProtologueSection
.class, getInput().getClass().getCanonicalName()));
531 protologSection
.setEnabled(detailsEnabled
);
532 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
533 addPart(protologSection
);
536 if (config
== null || config
.isTypeDesignationSectionActivated()){
537 TypeDesignationSection typeDesignationSection
= formFactory
.createTypeDesignationSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(TypeDesignationSection
.class, getInput().getClass().getCanonicalName()));
538 typeDesignationSection
.setEnabled(detailsEnabled
);
539 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
540 addPart(typeDesignationSection
);
543 if (config
== null || config
.isNameRelationsSectionActivated()){
544 NameRelationshipDetailSection nameRelationshipSection
= formFactory
.createNameRelationshipDetailSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(NameRelationshipDetailSection
.class, getInput().getClass().getCanonicalName()));
545 nameRelationshipSection
.setEnabled(detailsEnabled
);
546 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
547 addPart(nameRelationshipSection
);
551 addPart(parsingMessagesSection
);
553 addPart(nonViralNameSection
);
557 private void createNameSections(RootElement parent
) {
558 NonViralNameDetailSection nonViralNameSection
= formFactory
.createNonViralNameDetailSection(
559 getConversationHolder(), parent
, this, false, StoreUtil
.getSectionStyle(NonViralNameDetailSection
.class, getInput().getClass().getCanonicalName(), true));
561 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
563 NomenclaturalReferenceDetailSection referenceDetailSection
= formFactory
.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent
, this,
564 StoreUtil
.getSectionStyle(NomenclaturalReferenceDetailSection
.class, getInput().getClass().getCanonicalName(), true));
565 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
567 NomenclaturalStatusSection nomenclaturalStatusSection
= formFactory
.createNomenclaturalStatusSection(getConversationHolder(), parent
,
568 StoreUtil
.getSectionStyle(NomenclaturalStatusSection
.class, getInput().getClass().getCanonicalName(), true));
569 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
571 addPart(nonViralNameSection
);
572 addPart(nomenclaturalStatusSection
);
573 addPart(referenceDetailSection
);
575 ProtologueSection protologSection
= formFactory
.createProtologueSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(ProtologueSection
.class, getInput().getClass().getCanonicalName()));
576 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
578 TypeDesignationSection typeDesignationSection
= formFactory
.createTypeDesignationSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(TypeDesignationSection
.class, getInput().getClass().getCanonicalName()));
579 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
581 NameRelationshipDetailSection nameRelationshipSection
= formFactory
.createNameRelationshipDetailSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(NameRelationshipDetailSection
.class, getInput().getClass().getCanonicalName()));
582 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
583 addPart(protologSection
);
584 addPart(typeDesignationSection
);
585 addPart(nameRelationshipSection
);
589 private void createReferenceSections(RootElement parent
) {
590 ReferenceDetailSection referenceDetailSection
= formFactory
.createReferenceDetailSection(getConversationHolder(), parent
, this,
591 StoreUtil
.getSectionStyle(ReferenceDetailSection
.class, getInput().getClass().getCanonicalName(), true));
593 addPart(referenceDetailSection
);
596 private void createTeamOrPersonBaseDetailSection(RootElement parent
) {
597 TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection
= formFactory
.createTeamOrPersonBaseDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(TeamOrPersonBaseDetailSection
.class, getInput().getClass().getCanonicalName(), true));
599 addPart(teamOrPersonBaseDetailSection
);
602 private void createTeamDetailSection(RootElement parent
) {
603 TeamDetailSection teamDetailSection
= formFactory
.createTeamDetailSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(TeamDetailSection
.class, getInput().getClass().getCanonicalName(), true));
605 addPart(teamDetailSection
);
608 private void createPersonDetailSection(RootElement parent
) {
609 PersonDetailSection personDetailSection
= formFactory
.createPersonDetailSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(PersonDetailSection
.class, getInput().getClass().getCanonicalName(), true));
610 addPart(personDetailSection
);
613 private void createDescriptionElementSection(RootElement parent
) {
614 createDescriptionElementSection(parent
, null);
617 private void createDescriptionElementSection(RootElement parent
, Object activePart
) {
618 DescriptionElementDetailSection descriptionElementDetailSection
= formFactory
.createDescriptionElementDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DescriptionElementDetailSection
.class, getInput().getClass().getCanonicalName(), true));
619 descriptionElementDetailSection
.setEnabled(this.detailsEnabled
);
621 // IntextReferenceSection intextReferenceSection = formFactory.createIntextReferenceSection(getConversationHolder(), parent, getSectionStyle(.class, getInput().getClass().getCanonicalName()));
623 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
624 DescriptionElementSourceSection descriptionElementSourceSection
;
625 if (activePart
!= null && activePart
instanceof IDistributionEditorPart
){
626 Reference defaultSource
=((IDistributionEditorPart
)activePart
).getEditor().getDefaultSource();
627 descriptionElementSourceSection
= formFactory
.createDescriptionElementSourceSection(getConversationHolder(), parent
, defaultSource
, StoreUtil
.getSectionStyle(DescriptionElementSourceSection
.class, getInput().getClass().getCanonicalName()));
630 descriptionElementSourceSection
= formFactory
.createDescriptionElementSourceSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(DescriptionElementSourceSection
.class, getInput().getClass().getCanonicalName()) );
634 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
636 DescriptionElementMediaSection descriptionElementMediaSection
= formFactory
.createDescriptionElementMediaSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(DescriptionElementMediaSection
.class, getInput().getClass().getCanonicalName()));
638 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
640 addPart(descriptionElementDetailSection
);
641 addPart(descriptionElementSourceSection
);
642 addPart(descriptionElementMediaSection
);
645 private void createDescriptionSection(RootElement parent
, boolean isTaxonDescription
) {
646 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DescriptionDetailSection
.class, getInput().getClass().getCanonicalName(), true));
647 addPart(descriptionDetailSection
);
649 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
651 if(isTaxonDescription
) {
652 NaturalLanguageSection naturalLanguageSection
= formFactory
.createNaturalLanguageSection(
653 getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(NaturalLanguageSection
.class, getInput().getClass().getCanonicalName(), true));
654 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
655 addPart(naturalLanguageSection
);
657 DescriptionSourceSection descriptionSourceSection
= formFactory
.createDescriptionSourceSection(
658 getConversationHolder(), parent
, StoreUtil
.getSectionStyle(DescriptionSourceSection
.class, getInput().getClass().getCanonicalName(), true));
659 addPart(descriptionSourceSection
);
661 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
663 if(isTaxonDescription
) {
664 ScopeSection scopeSection
= formFactory
.createScopeSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(ScopeSection
.class, getInput().getClass().getCanonicalName()));
665 addPart(scopeSection
);
669 private void createTaxonDescriptionSection(RootElement parent
) {
670 createDescriptionSection(parent
, true);
673 private void createSpecimenDescriptionSection(RootElement parent
) {
674 createDescriptionSection(parent
, false);
677 private void createUseDescriptionSection(RootElement parent
) {
678 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DescriptionDetailSection
.class, getInput().getClass().getCanonicalName()));
680 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
682 DescriptionSourceSection descriptionSourceSection
= formFactory
.createDescriptionSourceSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(DescriptionSourceSection
.class, getInput().getClass().getCanonicalName()));
684 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
686 addPart(descriptionDetailSection
);
687 addPart(descriptionSourceSection
);
691 private void createImageGallerySection(RootElement parent
) {
692 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DescriptionDetailSection
.class, getInput().getClass().getCanonicalName()));
694 addPart(descriptionDetailSection
);
697 private void createMediaElementSection(RootElement parent
) {
698 MediaDetailsSection mediaDetailSection
= formFactory
.createMediaDetailsSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(MediaDetailsSection
.class, getInput().getClass().getCanonicalName(), true));
700 addPart(mediaDetailSection
);
703 private void createDerivedUnitBaseElementSection(RootElement parent
) {
704 DerivedUnitGeneralDetailSection derivedUnitGeneralDetailSection
= formFactory
.createDerivedUnitGeneralDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DerivedUnitGeneralDetailSection
.class, getInput().getClass().getCanonicalName(), true));
705 //TODO for DerivateEditor do not use facade anymore to avoid this special case handling #4539
706 if(!(AbstractUtility
.getActivePart() instanceof IDerivedUnitFacadePart
)){
707 derivedUnitGeneralDetailSection
.setShowOnlyDerivedUnitData(true);
709 addPart(derivedUnitGeneralDetailSection
);
711 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
713 DerivedUnitBaseDetailSection derivedUnitBaseDetailSection
= formFactory
.createDerivedUnitBaseDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DerivedUnitBaseDetailSection
.class, getInput().getClass().getCanonicalName(), true));
714 addPart(derivedUnitBaseDetailSection
);
716 //for editors working with facades
717 if(AbstractUtility
.getActivePart() instanceof IDerivedUnitFacadePart
){
718 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
719 GatheringEventDetailSection gatheringEventDetailSection
= formFactory
.createGatheringEventDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(GatheringEventDetailSection
.class, getInput().getClass().getCanonicalName()));
720 addPart(gatheringEventDetailSection
);
722 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
723 FieldUnitDetailSection fieldUnitDetailSection
= formFactory
.createFieldUnitDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(FieldUnitDetailSection
.class, getInput().getClass().getCanonicalName()));
724 addPart(fieldUnitDetailSection
);
728 if(PreferencesUtil
.isShowTaxonAssociations()){
729 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
730 TaxonAssociationDetailSection taxonAssociationDetailSection
= formFactory
.createTaxonAssociationDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(TaxonAssociationDetailSection
.class, getInput().getClass().getCanonicalName(), true));
731 addPart(taxonAssociationDetailSection
);
733 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
734 DerivedUnitFacadeIdentifierSection identifierDetailSection
= formFactory
.createDerivedUnitFacadeIdentifierSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(DerivedUnitFacadeIdentifierSection
.class, getInput().getClass().getCanonicalName()));
735 addPart(identifierDetailSection
);
737 if(!PreferencesUtil
.isDeterminationOnlyForFieldUnits()){
738 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
739 DeterminationDetailSection determinationDetailSection
= formFactory
.createDeterminationDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DeterminationDetailSection
.class, getInput().getClass().getCanonicalName()));
740 addPart(determinationDetailSection
);
743 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
744 DerivedUnitTypeDesignationSection derivedUnitTypeDesignationSection
= formFactory
.createDerivedUnitTypeDesignationSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DerivedUnitTypeDesignationSection
.class, getInput().getClass().getCanonicalName()));
745 addPart(derivedUnitTypeDesignationSection
);
749 private void createFieldUnitSection(RootElement parent
) {
750 FieldUnitGeneralDetailSection fielUnitGeneralDetailSection
= formFactory
.createFieldUnitGeneralDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(FieldUnitGeneralDetailSection
.class, getInput().getClass().getCanonicalName(), true));
752 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
754 GatheringEventDetailSection gatheringEventDetailSection
= formFactory
.createGatheringEventDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(GatheringEventDetailSection
.class, getInput().getClass().getCanonicalName()));
756 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
758 FieldUnitDetailSection fieldUnitDetailSection
= formFactory
.createFieldUnitDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(FieldUnitDetailSection
.class, getInput().getClass().getCanonicalName()));
760 addPart(fielUnitGeneralDetailSection
);
761 addPart(gatheringEventDetailSection
);
762 addPart(fieldUnitDetailSection
);
764 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
765 DeterminationDetailSection determinationDetailSection
= formFactory
.createDeterminationDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DeterminationDetailSection
.class, getInput().getClass().getCanonicalName()));
766 addPart(determinationDetailSection
);
770 private void createTissueSampleSection(RootElement parent
) {
771 TissueSampleGeneralDetailSection section
= formFactory
.createTissueSampleGeneralDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(TissueSampleGeneralDetailSection
.class, getInput().getClass().getCanonicalName(), true));
773 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
775 SampleDesignationDetailSection sampleDesignationDetailSection
= formFactory
.createSampleDesignationDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(SampleDesignationDetailSection
.class, getInput().getClass().getCanonicalName(), true));
778 addPart(sampleDesignationDetailSection
);
781 private void createDnaSampleSection(RootElement parent
) {
782 DnaSampleGeneralDetailSection section
= formFactory
.createDnaSampleGeneralDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DnaSampleGeneralDetailSection
.class, getInput().getClass().getCanonicalName(), true));
784 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
786 DnaSamplePreparationPreservationSection preparationPreservationSection
= formFactory
.createDnaSamplePreparationPreservationSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DnaSamplePreparationPreservationSection
.class, getInput().getClass().getCanonicalName(), true));
788 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
790 DnaQualityDetailSection qualitySection
= formFactory
.createDnaQualityDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DnaQualityDetailSection
.class, getInput().getClass().getCanonicalName(), true));
792 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
794 SampleDesignationDetailSection sampleDesignationDetailSection
= formFactory
.createSampleDesignationDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(SampleDesignationDetailSection
.class, getInput().getClass().getCanonicalName(), true));
796 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
797 DeterminationDetailSection determinationDetailSection
= null;
798 if(!PreferencesUtil
.isDeterminationOnlyForFieldUnits()){
799 determinationDetailSection
= formFactory
.createDeterminationDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DeterminationDetailSection
.class, getInput().getClass().getCanonicalName()));
802 addPart(preparationPreservationSection
);
803 addPart(qualitySection
);
804 addPart(sampleDesignationDetailSection
);
805 if(!PreferencesUtil
.isDeterminationOnlyForFieldUnits()){
806 addPart(determinationDetailSection
);
810 private void createSequenceSection(RootElement parent
) {
811 SequenceGeneralDetailSection section
= formFactory
.createSequenceGeneralDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(SequenceGeneralDetailSection
.class, getInput().getClass().getCanonicalName(), true));
813 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
815 SequenceReferenceCollectionDetailSection referenceSection
= formFactory
.createSequenceReferenceCollectionDetailSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(SequenceReferenceCollectionDetailSection
.class, getInput().getClass().getCanonicalName(), true));
817 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
819 SequenceContigFileCollectionDetailSection contigFileSection
= formFactory
.createSequenceContigFileCollectionDetailSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(SequenceContigFileCollectionDetailSection
.class, getInput().getClass().getCanonicalName(), true));
823 addPart(referenceSection
);
824 addPart(contigFileSection
);
827 private void createSingleReadSection(RootElement parent
) {
828 SingleReadGeneralDetailSection section
= formFactory
.createSingleReadGeneralDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(SingleReadGeneralDetailSection
.class, getInput().getClass().getCanonicalName(), true));
831 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
833 SingleReadPherogramCollectionDetailSection pherogramSection
= formFactory
.createSingleReadPherogramCollectionDetailSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(SingleReadPherogramCollectionDetailSection
.class, getInput().getClass().getCanonicalName(), true));
834 addPart(pherogramSection
);
838 private void createMediaSpecimenSection(RootElement parent
) {
839 MediaSpecimenGeneralDetailSection generalSection
= formFactory
.createMediaSpecimenGeneralDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(MediaSpecimenGeneralDetailSection
.class, getInput().getClass().getCanonicalName(), true));
840 addPart(generalSection
);
842 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
844 RightsSection rightsSection
= formFactory
.createRightsSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(RightsSection
.class, getInput().getClass().getCanonicalName()));
845 addPart(rightsSection
);
849 private void createFeatureTreeSection(RootElement parent
) {
850 FeatureTreeDetailSection section
= formFactory
.createFeatureTreeDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(FeatureTreeDetailSection
.class, getInput().getClass().getCanonicalName(), true));
855 private void createFeatureNodeSection(RootElement parent
) {
856 FeatureNodeDetailSection featureDistributionSection
= formFactory
.createFeatureNodeDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(FeatureNodeDetailSection
.class, getInput().getClass().getCanonicalName(), true));
858 addPart(featureDistributionSection
);
861 private void createFeatureDistributionSection(RootElement parent
) {
862 FeatureDistributionDetailSection featureDistributionSection
= formFactory
.createFeatureDistributionDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(FeatureDistributionDetailSection
.class, getInput().getClass().getCanonicalName(), true));
864 addPart(featureDistributionSection
);
867 private void createCharacterNodeSection(RootElement parent
) {
868 CharacterNodeDetailSection featureDistributionSection
= formFactory
.createCharacterNodeDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(CharacterDetailSection
.class, getInput().getClass().getCanonicalName(), true));
869 addPart(featureDistributionSection
);
872 private void createCharacterSection(RootElement parent
) {
873 CharacterDetailSection featureDistributionSection
= formFactory
.createCharacterDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(CharacterDetailSection
.class, getInput().getClass().getCanonicalName(), true));
874 addPart(featureDistributionSection
);
877 private void createPolytomousKeyNodeSection(RootElement parent
) {
878 PolytomousKeyDetailSection polytomousKeyDetailSection
= formFactory
.createPolytomousKeyDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(PolytomousKeyDetailSection
.class, getInput().getClass().getCanonicalName()));
880 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
882 PolytomousKeyNodeDetailSection polytomousKeyNodeDetailSection
= formFactory
.createPolytomousKeyNodeDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(PolytomousKeyNodeDetailSection
.class, getInput().getClass().getCanonicalName(), true));
884 addPart(polytomousKeyDetailSection
);
885 addPart(polytomousKeyNodeDetailSection
);
889 private void createUseRecordSection(RootElement parent
) {
890 UseRecordDetailSection descriptionUseRecordSection
= formFactory
.createUseRecordDetailSection(getConversationHolder(), parent
, this,StoreUtil
.getSectionStyle(UseRecordDetailSection
.class, getInput().getClass().getCanonicalName(), true));
892 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
894 addPart(descriptionUseRecordSection
);
899 private void createUserSection(RootElement parent
) {
900 UserDetailSection userDetailSection
= formFactory
.createUserDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(UserDetailSection
.class, getInput().getClass().getCanonicalName(), true));
902 GroupsByUserDetailSection groupByUserDetailSection
= formFactory
.createGroupsByUserDetailSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(GroupsByUserDetailSection
.class, getInput().getClass().getCanonicalName(), true));
904 addPart(userDetailSection
);
905 addPart(groupByUserDetailSection
);
908 private void createMisappliedNameSection(RootElement parent
) {
909 TaxonRelationshipDetailSection taxonRelationshipDetailSection
= formFactory
.createTaxonRelationshipDetailSection(getConversationHolder(), parent
, this,
910 StoreUtil
.getSectionStyle(TaxonRelationshipDetailSection
.class, getInput().getClass().getCanonicalName(), true));
911 addPart(taxonRelationshipDetailSection
);
913 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
916 NonViralNameDetailSection nonViralNameSection
= formFactory
917 .createNonViralNameDetailSection(getConversationHolder(), parent
, this, true,
918 StoreUtil
.getSectionStyle(NonViralNameDetailSection
.class, getInput().getClass().getCanonicalName(), true));
919 addPart(nonViralNameSection
);
921 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
923 NomenclaturalReferenceDetailSection referenceDetailSection
= formFactory
.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent
, this,
924 StoreUtil
.getSectionStyle(NomenclaturalReferenceDetailSection
.class, getInput().getClass().getCanonicalName(), true));
925 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
926 addPart(referenceDetailSection
);
929 NomenclaturalStatusSection nomenclaturalStatusSection
= formFactory
.createNomenclaturalStatusSection(getConversationHolder(), parent
,
930 StoreUtil
.getSectionStyle(NomenclaturalStatusSection
.class, getInput().getClass().getCanonicalName(), true));
931 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
932 addPart(nomenclaturalStatusSection
);
934 ProtologueSection protologSection
= formFactory
.createProtologueSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(ProtologueSection
.class, getInput().getClass().getCanonicalName()));
935 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
936 addPart(protologSection
);
938 TypeDesignationSection typeDesignationSection
= formFactory
.createTypeDesignationSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(TypeDesignationSection
.class, getInput().getClass().getCanonicalName()));
939 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
940 addPart(typeDesignationSection
);
942 NameRelationshipDetailSection nameRelationshipSection
= formFactory
.createNameRelationshipDetailSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(NameRelationshipDetailSection
.class, getInput().getClass().getCanonicalName()));
943 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
944 addPart(nameRelationshipSection
);
948 private void createTaxonRelationshipSection(RootElement parent
) {
949 TaxonRelationshipDetailSection taxonRelationshipDetailSection
= formFactory
.createTaxonRelationshipDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(TaxonRelationshipDetailSection
.class, getInput().getClass().getCanonicalName(), true));
951 ReferencedEntityDetailSection referencedEntityBaseDetailSection
= formFactory
.createReferencedEntityDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(ReferencedEntityDetailSection
.class, getInput().getClass().getCanonicalName(), true));
952 addPart(taxonRelationshipDetailSection
);
953 addPart(referencedEntityBaseDetailSection
);
955 private void createTermVocabularySection(RootElement parent
) {
956 TermVocabularyDetailSection termVocabularyDetailSection
= formFactory
.createTermVocabularyDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(TermVocabularyDetailSection
.class, getInput().getClass().getCanonicalName(), true));
957 addPart(termVocabularyDetailSection
);
960 private void createDefinedTermSection(RootElement parent
) {
961 DefinedTermDetailSection definedTermDetailSection
= formFactory
.createDefinedTermDetailSection(getInput().getClass(), getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DefinedTermDetailSection
.class, getInput().getClass().getCanonicalName(), true));
962 addPart(definedTermDetailSection
);
963 TermMediaSection termMediaSection
= formFactory
.createTermMediaSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(DefinedTermDetailSection
.class, getInput().getClass().getCanonicalName(), true));
964 addPart(termMediaSection
);
968 public void update(CdmDataChangeMap arg0
) {
973 private void updateView(@UIEventTopic(WorkbenchEventConstants
.REFRESH_DETAILS
)boolean refresh
){
981 private void updateView(@UIEventTopic(WorkbenchEventConstants
.REFRESH_DETAILS_DISTRIBUTION
)String nameCache
){
982 if(nameCache
!= null && getInput() instanceof Distribution
&& this.activePart
instanceof IDistributionEditorPart
){
983 if (part
instanceof CdmSectionPart
&& ((CdmSectionPart
)part
).getSection() instanceof DescriptionElementDetailSection
){
984 for (ICdmFormElement element
: ((DescriptionElementDetailSection
)((CdmSectionPart
)part
).getSection()).getElements()){
985 if (element
instanceof DescriptionElementDetailElement
){
986 for(ICdmFormElement descriptionElement
:((DescriptionElementDetailElement
)element
).getElements()){
987 if (descriptionElement
instanceof DistributionDetailElement
){
988 ((DistributionDetailElement
) descriptionElement
).setName(nameCache
);