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
.l10n
.Messages
;
72 import eu
.etaxonomy
.taxeditor
.model
.AbstractUtility
;
73 import eu
.etaxonomy
.taxeditor
.model
.FeatureNodeContainer
;
74 import eu
.etaxonomy
.taxeditor
.model
.IDerivedUnitFacadePart
;
75 import eu
.etaxonomy
.taxeditor
.model
.MessagingUtils
;
76 import eu
.etaxonomy
.taxeditor
.model
.PolytomousKeyRelationship
;
77 import eu
.etaxonomy
.taxeditor
.preference
.NameDetailsConfigurator
;
78 import eu
.etaxonomy
.taxeditor
.preference
.PreferencesUtil
;
79 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
80 import eu
.etaxonomy
.taxeditor
.store
.StoreUtil
;
81 import eu
.etaxonomy
.taxeditor
.store
.UsageTermCollection
;
82 import eu
.etaxonomy
.taxeditor
.termtree
.e4
.ICharacterEditor
;
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
.TermNodeDetailSection
;
104 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.TermTreeDetailSection
;
105 import eu
.etaxonomy
.taxeditor
.ui
.section
.feature
.TermTreeDetailSectionForNode
;
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
instanceof MediaSpecimen
&& !(this.activePart
.getClass().getSimpleName().equals("BulkEditorE4"))){
196 }else if (input
instanceof DerivedUnit
) {
197 DerivedUnit derivedUnit
= (DerivedUnit
)input
;
199 input
= DerivedUnitFacade
.NewInstance(derivedUnit
,
200 PreferencesUtil
.getDerivedUnitConfigurator());
201 } catch (DerivedUnitFacadeNotSupportedException e
) {
202 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
205 else if(input
instanceof FieldUnit
){
206 input
= DerivedUnitFacade
.NewInstance(SpecimenOrObservationType
.FieldUnit
, (FieldUnit
) input
);
208 super.setInput(input
);
212 protected void markViewPartDirty() {
213 if (getInput() instanceof DerivedUnitFacade
) {
214 if(part
instanceof IDerivedUnitFacadePart
){
215 part
.changed(getInput());
218 DerivedUnitFacade facade
= (DerivedUnitFacade
) getInput();
219 if(facade
.innerDerivedUnit()!=null){
220 part
.changed(facade
.innerDerivedUnit());
222 else if(facade
.innerFieldUnit()!=null){
223 part
.changed(facade
.innerFieldUnit());
228 super.markViewPartDirty();
233 protected void showParts() {
234 // FIXME (CM) : Need to clean out this code.
235 // Too much type checking to decide which detail view to display.
236 // Need to build in a mechanism where navigators / editors are 'aware'
237 // of the corresponding detail viewer.
239 Object input
= getInput();
244 if (input
instanceof TaxonBase
) {
245 if(((TaxonBase
) input
).getName()==null){
246 createEmptySection(Messages
.DetailsViewerE4_TAXON_HAS_NO_NAME
, rootElement
);
249 createTaxonSections(rootElement
);
252 } else if (input
instanceof TaxonName
) {
253 createNameSections(rootElement
);
255 } else if (input
instanceof Reference
) {
256 createReferenceSections(rootElement
);
258 } else if (input
instanceof Team
) {
259 createTeamDetailSection(rootElement
);
261 } else if (input
instanceof Person
) {
262 createPersonDetailSection(rootElement
);
264 } else if (input
instanceof TeamOrPersonBase
) {
265 createTeamOrPersonBaseDetailSection(rootElement
);
267 } else if (input
instanceof DescriptionBase
) {
268 if(input
instanceof SpecimenDescription
){
269 //TODO: add more sections to DetailsView for SpecimenDescription
270 createSpecimenDescriptionSection(rootElement
);
273 Set
<Marker
> descriptionMarkers
= ((DescriptionBase
<?
>) input
).getMarkers();
275 Boolean isUseDescription
= false;
276 for (Marker marker
: descriptionMarkers
) {
277 if (marker
.getMarkerType()!= null && marker
.getMarkerType().getUuid().equals(UsageTermCollection
.uuidUseMarkerType
)) {
278 isUseDescription
= true;
281 if (((DescriptionBase
<?
>) input
).isImageGallery()) {
282 createImageGallerySection(rootElement
);
284 } else if (isUseDescription
) {
285 createUseDescriptionSection(rootElement
);
286 } else if (input
instanceof TaxonDescription
){
287 createTaxonDescriptionSection(rootElement
);
290 createDescriptionSection(rootElement
, false);
293 } else if (input
instanceof DescriptionElementBase
){
294 Set
<Marker
> descriptionMarkers
= new HashSet
<>();
295 if(((DescriptionElementBase
) input
).getInDescription()!=null) {
296 descriptionMarkers
= ((DescriptionElementBase
) input
).getInDescription().getMarkers();
299 Boolean isUseDescription
= false;
300 for (Marker marker
: descriptionMarkers
) {
301 if (marker
.getMarkerType()!= null && marker
.getMarkerType().getUuid().equals(UsageTermCollection
.uuidUseMarkerType
)) {
302 isUseDescription
= true;
306 if (isUseDescription
== true && input
instanceof CategoricalData
) {
307 createUseRecordSection(rootElement
);
309 createDescriptionElementSection(rootElement
, activePart
);
312 } else if (input
instanceof Media
) {
313 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
&& !(input
instanceof MediaSpecimen
)) {
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 DerivedUnitFacade facade
= (DerivedUnitFacade
) input
;
328 if(facade
.getType() == SpecimenOrObservationType
.FieldUnit
){
329 if(facade
.innerFieldUnit() == null){
330 MessagingUtils
.error(DetailsViewerE4
.class, "FieldUnit of facade is null", null); //$NON-NLS-1$
333 createFieldUnitSection(rootElement
);
336 else if(facade
.getType() == SpecimenOrObservationType
.PreservedSpecimen
){
337 if(facade
.innerDerivedUnit() == null){
338 MessagingUtils
.error(DetailsViewerE4
.class, "DerivedUnit of facade is null", null); //$NON-NLS-1$
341 createDerivedUnitBaseElementSection(rootElement
);
344 else if(facade
.getType() == SpecimenOrObservationType
.TissueSample
){
345 //TissueSample should only be created by using it's own class
346 //in future using only one class with different SpecimenOrObservationTypes is desired
347 createTissueSampleSection(rootElement
);
349 else if(facade
.getType()==SpecimenOrObservationType
.DnaSample
){
351 if(facade
.innerDerivedUnit().getRecordBasis()==SpecimenOrObservationType
.TissueSample
){
352 createTissueSampleSection(rootElement
);
354 else if(facade
.innerDerivedUnit().getRecordBasis()==SpecimenOrObservationType
.DnaSample
){
355 createDnaSampleSection(rootElement
);
357 }else if (facade
.innerDerivedUnit() instanceof MediaSpecimen
){
358 createEmptySection("Image specimen not supported by specimen list editor", rootElement
);
360 createDerivedUnitBaseElementSection(rootElement
);
362 } else if (input
instanceof DnaSample
){
363 DnaSample dnaSample
= (DnaSample
)input
;
364 if(dnaSample
.getRecordBasis()==SpecimenOrObservationType
.TissueSample
){
365 createTissueSampleSection(rootElement
);
367 else if(dnaSample
.getRecordBasis()==SpecimenOrObservationType
.DnaSample
){
368 createDnaSampleSection(rootElement
);
370 } else if (input
instanceof MediaSpecimen
){
371 createMediaSpecimenSection(rootElement
);
373 else if(input
instanceof Sequence
){
374 createSequenceSection(rootElement
);
376 else if(input
instanceof SingleRead
){
377 createSingleReadSection(rootElement
);
379 else if (input
instanceof FeatureNodeContainer
) {
380 createFeatureDistributionSection(rootElement
);
382 } else if (input
instanceof TermNode
) {
383 TermType type
= ((TermNode
<?
>) input
).getTermType();
384 if(type
.equals(TermType
.Character
) ){
385 createCharacterNodeSection(rootElement
);
387 else if(type
.equals(TermType
.Feature
)){
388 createFeatureNodeSection(rootElement
);
391 } else if (input
instanceof TermTree
) {
392 createFeatureTreeSection(rootElement
);
394 } else if (input
instanceof TermNodeDto
) {
395 TermType type
= ((TermNodeDto
) input
).getTerm().getTermType();
396 if(type
.equals(TermType
.Character
) && activePart
instanceof ICharacterEditor
){
397 createCharacterNodeDtoSection(rootElement
);
399 else if(type
.equals(TermType
.Feature
) || type
.equals(TermType
.Character
)){
400 createFeatureNodeSection(rootElement
);
403 } else if (input
instanceof TermTreeDto
) {
404 createFeatureTreeSectionForDto(rootElement
);
406 } else if (input
instanceof Character
) {
407 createCharacterSection(rootElement
);
409 }else if ((input
instanceof PolytomousKeyNode
) || (input
instanceof PolytomousKeyRelationship
)) {
410 createPolytomousKeyNodeSection(rootElement
);
411 } else if (input
instanceof User
) {
412 createUserSection(rootElement
);
413 } else if (input
instanceof Group
) {
414 createGroupSection(rootElement
);
415 } else if (input
instanceof TaxonRelationship
&& ((TaxonRelationship
)input
).getType()!=null
416 && (((TaxonRelationship
)input
).getType().isAnyMisappliedName() || ((TaxonRelationship
)input
).getType().isAnySynonym() || ((TaxonRelationship
)input
).getType().isMisappliedName())){
417 createMisappliedNameSection(rootElement
);
418 }else if (input
instanceof TaxonRelationship
) {
419 createTaxonRelationshipSection(rootElement
);
420 } else if (input
instanceof TermVocabulary
) {
421 createTermVocabularySection(rootElement
);
422 } else if (input
instanceof DefinedTermBase
) {
423 createDefinedTermSection(rootElement
);
425 } else if (input
instanceof SelectionChangedEvent
) {
426 IStructuredSelection sel
=(IStructuredSelection
) ((SelectionChangedEvent
)input
).getSelection();
427 if (sel
.getFirstElement()instanceof Distribution
){
428 createDescriptionElementSection(rootElement
);
431 // createDescriptionElementSection(rootElement);
434 createEmptySection(null, rootElement
);
441 private void createFeatureTreeSectionForTree(RootElement rootElement
) {
442 // TODO Auto-generated method stub
446 private void createGroupSection(RootElement parent
) {
447 GroupDetailSection groupDetailSection
= formFactory
.createGroupDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(GroupDetailSection
.class, getInput().getClass().getCanonicalName()));
448 MemberDetailSection memberDetailSection
= formFactory
.createMemberDetailSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(MemberDetailSection
.class, getInput().getClass().getCanonicalName()));
449 GrantedAuthorityDetailSection grantedAuthorityDetailSection
= formFactory
.createGrantedAuthorityDetailSection(getConversationHolder(), parent
,StoreUtil
.getSectionStyle(GrantedAuthorityDetailSection
.class, getInput().getClass().getCanonicalName()));
451 addPart(groupDetailSection
);
452 addPart(memberDetailSection
);
453 addPart(grantedAuthorityDetailSection
);
458 public ISelection
getSelection() {
464 public void setSelection(ISelection selection
, boolean reveal
) {
466 this.selection
= selection
;
468 if(this.selection
!=null){
469 SelectionChangedEvent selectionChangedEvent
= new SelectionChangedEvent(this, selection
);
470 fireSelectionChanged(selectionChangedEvent
);
475 private void createTaxonSections(RootElement parent
) {
476 NameDetailsConfigurator config
= PreferencesUtil
.getPreferredNameDetailsConfiguration();
477 EnumSet
<CRUD
> requiredCrud
;
478 if(getInput() == null || StoreUtil
.getCdmEntity(getInput()).getId() == 0) {
479 // new entity, not yet saved
480 requiredCrud
= EnumSet
.of(CRUD
.CREATE
);
482 requiredCrud
= EnumSet
.of(CRUD
.UPDATE
);
484 boolean hasPermission
= CdmStore
.currentAuthentiationHasPermission(StoreUtil
.getCdmEntity(getInput()), requiredCrud
);
486 // check for subtree permissions as well.
487 TaxonBase
<?
> taxonBase
= (TaxonBase
<?
>)getInput();
488 Taxon acceptedTaxon
= null;
489 if (taxonBase
instanceof Taxon
){
490 acceptedTaxon
= (Taxon
)taxonBase
;
492 acceptedTaxon
= ((Synonym
)taxonBase
).getAcceptedTaxon();
494 if (acceptedTaxon
!= null){ //needs discussion if synonyms without accepted taxon should never be filtered by subtree permission(current implementation). See also #8849
495 Set
<TaxonNode
> nodes
= acceptedTaxon
.getTaxonNodes();
496 for (TaxonNode node
: nodes
){
497 hasPermission
&= CdmStore
.currentAuthentiationHasPermission(node
, requiredCrud
);
499 //check whether there are explicit TaxonNode rights
500 boolean taxonnodePermissionExists
= false;
501 Collection
<?
extends GrantedAuthority
> authorities
= CdmStore
.getCurrentAuthentiation().getAuthorities();
502 for (GrantedAuthority grantedAuthority
: authorities
){
503 if (grantedAuthority
.getAuthority().startsWith("TAXONNODE")){
504 taxonnodePermissionExists
= true;
507 if (!taxonnodePermissionExists
){
508 hasPermission
= true;
514 detailsEnabled
= hasPermission
;
515 ParsingMessagesSection parsingMessagesSection
= formFactory
.createParsingMessagesSection(getConversationHolder(), parent
, this,
516 StoreUtil
.getSectionStyle(ParsingMessagesSection
.class, getInput().getClass().getCanonicalName(), true));
518 TaxonBaseDetailSection taxonBaseDetailSection
= formFactory
.createTaxonBaseDetailSection(getConversationHolder(), parent
, this,
519 StoreUtil
.getSectionStyle(TaxonBaseDetailSection
.class, getInput().getClass().getCanonicalName(), true));
520 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
521 // boolean hasPermission = CdmStore.currentAuthentiationHasPermission(getInput(), Operation.UPDATE);
522 taxonBaseDetailSection
.setEnabled(detailsEnabled
);
523 addPart(taxonBaseDetailSection
);
525 if (config
.isTaxonSectionActivated()){
526 TaxonBaseDetailSection taxonBaseDetailSection
= formFactory
.createTaxonBaseDetailSection(getConversationHolder(), parent
, this,
527 StoreUtil
.getSectionStyle(TaxonBaseDetailSection
.class, getInput().getClass().getCanonicalName(), true));
528 taxonBaseDetailSection
.setEnabled(detailsEnabled
);
529 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
530 addPart(taxonBaseDetailSection
);
533 NonViralNameDetailSection nonViralNameSection
= formFactory
534 .createNonViralNameDetailSection(getConversationHolder(), parent
, this, true,
535 StoreUtil
.getSectionStyle(NonViralNameDetailSection
.class, getInput().getClass().getCanonicalName(), true));
536 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
537 nonViralNameSection
.setEnabled(detailsEnabled
);
538 if (config
== null || config
.isNomenclaturalReferenceSectionActivated()){
539 NomenclaturalReferenceDetailSection referenceDetailSection
= formFactory
.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent
, this,
540 StoreUtil
.getSectionStyle(NomenclaturalReferenceDetailSection
.class, getInput().getClass().getCanonicalName(), true));
541 referenceDetailSection
.setEnabled(detailsEnabled
);
542 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
543 addPart(referenceDetailSection
);
546 if ( config
== null || config
.isNomenclaturalStatusSectionActivated()){
547 NomenclaturalStatusSection nomenclaturalStatusSection
= formFactory
.createNomenclaturalStatusSection(getConversationHolder(), parent
,
548 StoreUtil
.getSectionStyle(NomenclaturalStatusSection
.class, getInput().getClass().getCanonicalName(), true));
549 nomenclaturalStatusSection
.setEnabled(detailsEnabled
);
550 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
551 addPart(nomenclaturalStatusSection
);
554 // if ( config == null || config.isProtologueActivated()){
555 // ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(ProtologueSection.class, getInput().getClass().getCanonicalName()));
556 // protologSection.setEnabled(detailsEnabled);
557 // formFactory.createHorizontalSeparator(parent, SWT.BORDER);
558 // addPart(protologSection);
561 if (config
== null || config
.isTypeDesignationSectionActivated()){
562 TypeDesignationSection typeDesignationSection
= formFactory
.createTypeDesignationSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(TypeDesignationSection
.class, getInput().getClass().getCanonicalName()));
563 typeDesignationSection
.setEnabled(detailsEnabled
);
564 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
565 addPart(typeDesignationSection
);
568 if (config
== null || config
.isNameRelationsSectionActivated()){
569 NameRelationshipDetailSection nameRelationshipSection
= formFactory
.createNameRelationshipDetailSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(NameRelationshipDetailSection
.class, getInput().getClass().getCanonicalName()));
570 nameRelationshipSection
.setEnabled(detailsEnabled
);
571 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
572 addPart(nameRelationshipSection
);
576 addPart(parsingMessagesSection
);
578 addPart(nonViralNameSection
);
582 private void createNameSections(RootElement parent
) {
583 NonViralNameDetailSection nonViralNameSection
= formFactory
.createNonViralNameDetailSection(
584 getConversationHolder(), parent
, this, false, StoreUtil
.getSectionStyle(NonViralNameDetailSection
.class, getInput().getClass().getCanonicalName(), true));
586 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
588 NomenclaturalReferenceDetailSection referenceDetailSection
= formFactory
.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent
, this,
589 StoreUtil
.getSectionStyle(NomenclaturalReferenceDetailSection
.class, getInput().getClass().getCanonicalName(), true));
590 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
592 NomenclaturalStatusSection nomenclaturalStatusSection
= formFactory
.createNomenclaturalStatusSection(getConversationHolder(), parent
,
593 StoreUtil
.getSectionStyle(NomenclaturalStatusSection
.class, getInput().getClass().getCanonicalName(), true));
594 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
596 addPart(nonViralNameSection
);
597 addPart(nomenclaturalStatusSection
);
598 addPart(referenceDetailSection
);
600 // ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(ProtologueSection.class, getInput().getClass().getCanonicalName()));
601 // formFactory.createHorizontalSeparator(parent, SWT.BORDER);
603 TypeDesignationSection typeDesignationSection
= formFactory
.createTypeDesignationSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(TypeDesignationSection
.class, getInput().getClass().getCanonicalName()));
604 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
606 NameRelationshipDetailSection nameRelationshipSection
= formFactory
.createNameRelationshipDetailSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(NameRelationshipDetailSection
.class, getInput().getClass().getCanonicalName()));
607 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
608 // addPart(protologSection);
609 addPart(typeDesignationSection
);
610 addPart(nameRelationshipSection
);
614 private void createReferenceSections(RootElement parent
) {
615 ReferenceDetailSection referenceDetailSection
= formFactory
.createReferenceDetailSection(getConversationHolder(), parent
, this,
616 StoreUtil
.getSectionStyle(ReferenceDetailSection
.class, getInput().getClass().getCanonicalName(), true));
618 addPart(referenceDetailSection
);
621 private void createTeamOrPersonBaseDetailSection(RootElement parent
) {
622 TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection
= formFactory
.createTeamOrPersonBaseDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(TeamOrPersonBaseDetailSection
.class, getInput().getClass().getCanonicalName(), true));
624 addPart(teamOrPersonBaseDetailSection
);
627 private void createTeamDetailSection(RootElement parent
) {
628 TeamDetailSection teamDetailSection
= formFactory
.createTeamDetailSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(TeamDetailSection
.class, getInput().getClass().getCanonicalName(), true));
630 addPart(teamDetailSection
);
633 private void createPersonDetailSection(RootElement parent
) {
634 PersonDetailSection personDetailSection
= formFactory
.createPersonDetailSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(PersonDetailSection
.class, getInput().getClass().getCanonicalName(), true));
635 addPart(personDetailSection
);
638 private void createDescriptionElementSection(RootElement parent
) {
639 createDescriptionElementSection(parent
, null);
642 private void createDescriptionElementSection(RootElement parent
, Object activePart
) {
643 DescriptionElementDetailSection descriptionElementDetailSection
= formFactory
.createDescriptionElementDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DescriptionElementDetailSection
.class, getInput().getClass().getCanonicalName(), true));
644 descriptionElementDetailSection
.setEnabled(this.detailsEnabled
);
646 // IntextReferenceSection intextReferenceSection = formFactory.createIntextReferenceSection(getConversationHolder(), parent, getSectionStyle(.class, getInput().getClass().getCanonicalName()));
648 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
649 DescriptionElementSourceSection descriptionElementSourceSection
;
650 if (activePart
!= null && activePart
instanceof IDistributionEditorPart
){
651 Reference defaultSource
=((IDistributionEditorPart
)activePart
).getEditor().getDefaultSource();
652 descriptionElementSourceSection
= formFactory
.createDescriptionElementSourceSection(getConversationHolder(), parent
, defaultSource
, StoreUtil
.getSectionStyle(DescriptionElementSourceSection
.class, getInput().getClass().getCanonicalName()));
655 descriptionElementSourceSection
= formFactory
.createDescriptionElementSourceSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(DescriptionElementSourceSection
.class, getInput().getClass().getCanonicalName()) );
658 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
660 DescriptionElementMediaSection descriptionElementMediaSection
= formFactory
.createDescriptionElementMediaSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(DescriptionElementMediaSection
.class, getInput().getClass().getCanonicalName()));
662 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
664 addPart(descriptionElementDetailSection
);
665 addPart(descriptionElementSourceSection
);
666 addPart(descriptionElementMediaSection
);
669 private void createDescriptionSection(RootElement parent
, boolean isTaxonDescription
) {
670 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DescriptionDetailSection
.class, getInput().getClass().getCanonicalName(), true));
671 addPart(descriptionDetailSection
);
673 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
675 if(isTaxonDescription
) {
676 NaturalLanguageSection naturalLanguageSection
= formFactory
.createNaturalLanguageSection(
677 getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(NaturalLanguageSection
.class, getInput().getClass().getCanonicalName(), true));
678 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
679 addPart(naturalLanguageSection
);
681 DescriptionSourceSection descriptionSourceSection
= formFactory
.createDescriptionSourceSection(
682 getConversationHolder(), parent
, StoreUtil
.getSectionStyle(DescriptionSourceSection
.class, getInput().getClass().getCanonicalName(), true));
683 addPart(descriptionSourceSection
);
685 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
687 if(isTaxonDescription
) {
688 ScopeSection scopeSection
= formFactory
.createScopeSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(ScopeSection
.class, getInput().getClass().getCanonicalName()));
689 addPart(scopeSection
);
693 private void createTaxonDescriptionSection(RootElement parent
) {
694 createDescriptionSection(parent
, true);
697 private void createSpecimenDescriptionSection(RootElement parent
) {
698 createDescriptionSection(parent
, false);
701 private void createUseDescriptionSection(RootElement parent
) {
702 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DescriptionDetailSection
.class, getInput().getClass().getCanonicalName()));
704 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
706 DescriptionSourceSection descriptionSourceSection
= formFactory
.createDescriptionSourceSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(DescriptionSourceSection
.class, getInput().getClass().getCanonicalName()));
708 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
710 addPart(descriptionDetailSection
);
711 addPart(descriptionSourceSection
);
715 private void createImageGallerySection(RootElement parent
) {
716 DescriptionDetailSection descriptionDetailSection
= formFactory
.createDescriptionDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DescriptionDetailSection
.class, getInput().getClass().getCanonicalName()));
718 addPart(descriptionDetailSection
);
721 private void createMediaElementSection(RootElement parent
) {
722 MediaDetailsSection mediaDetailSection
= formFactory
.createMediaDetailsSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(MediaDetailsSection
.class, getInput().getClass().getCanonicalName(), true));
724 addPart(mediaDetailSection
);
727 private void createDerivedUnitBaseElementSection(RootElement parent
) {
728 DerivedUnitGeneralDetailSection derivedUnitGeneralDetailSection
= formFactory
.createDerivedUnitGeneralDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DerivedUnitGeneralDetailSection
.class, getInput().getClass().getCanonicalName(), true));
729 //TODO for DerivateEditor do not use facade anymore to avoid this special case handling #4539
730 if(!(AbstractUtility
.getActivePart() instanceof IDerivedUnitFacadePart
)){
731 derivedUnitGeneralDetailSection
.setShowOnlyDerivedUnitData(true);
733 addPart(derivedUnitGeneralDetailSection
);
735 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
737 DerivedUnitBaseDetailSection derivedUnitBaseDetailSection
= formFactory
.createDerivedUnitBaseDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DerivedUnitBaseDetailSection
.class, getInput().getClass().getCanonicalName(), true));
738 addPart(derivedUnitBaseDetailSection
);
740 //for editors working with facades
741 if(AbstractUtility
.getActivePart() instanceof IDerivedUnitFacadePart
){
742 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
743 GatheringEventDetailSection gatheringEventDetailSection
= formFactory
.createGatheringEventDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(GatheringEventDetailSection
.class, getInput().getClass().getCanonicalName()));
744 addPart(gatheringEventDetailSection
);
746 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
747 FieldUnitDetailSection fieldUnitDetailSection
= formFactory
.createFieldUnitDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(FieldUnitDetailSection
.class, getInput().getClass().getCanonicalName()));
748 addPart(fieldUnitDetailSection
);
752 if(PreferencesUtil
.isShowTaxonAssociations()){
753 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
754 TaxonAssociationDetailSection taxonAssociationDetailSection
= formFactory
.createTaxonAssociationDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(TaxonAssociationDetailSection
.class, getInput().getClass().getCanonicalName(), true));
755 addPart(taxonAssociationDetailSection
);
757 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
758 DerivedUnitFacadeIdentifierSection identifierDetailSection
= formFactory
.createDerivedUnitFacadeIdentifierSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(DerivedUnitFacadeIdentifierSection
.class, getInput().getClass().getCanonicalName()));
759 addPart(identifierDetailSection
);
761 if(!PreferencesUtil
.isDeterminationOnlyForFieldUnits()){
762 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
763 DeterminationDetailSection determinationDetailSection
= formFactory
.createDeterminationDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DeterminationDetailSection
.class, getInput().getClass().getCanonicalName()));
764 addPart(determinationDetailSection
);
767 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
768 DerivedUnitTypeDesignationSection derivedUnitTypeDesignationSection
= formFactory
.createDerivedUnitTypeDesignationSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DerivedUnitTypeDesignationSection
.class, getInput().getClass().getCanonicalName()));
769 addPart(derivedUnitTypeDesignationSection
);
773 private void createFieldUnitSection(RootElement parent
) {
774 FieldUnitGeneralDetailSection fielUnitGeneralDetailSection
= formFactory
.createFieldUnitGeneralDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(FieldUnitGeneralDetailSection
.class, getInput().getClass().getCanonicalName(), true));
776 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
778 GatheringEventDetailSection gatheringEventDetailSection
= formFactory
.createGatheringEventDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(GatheringEventDetailSection
.class, getInput().getClass().getCanonicalName()));
780 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
782 FieldUnitDetailSection fieldUnitDetailSection
= formFactory
.createFieldUnitDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(FieldUnitDetailSection
.class, getInput().getClass().getCanonicalName()));
784 addPart(fielUnitGeneralDetailSection
);
785 addPart(gatheringEventDetailSection
);
786 addPart(fieldUnitDetailSection
);
788 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
789 DeterminationDetailSection determinationDetailSection
= formFactory
.createDeterminationDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DeterminationDetailSection
.class, getInput().getClass().getCanonicalName()));
790 addPart(determinationDetailSection
);
794 private void createTissueSampleSection(RootElement parent
) {
795 TissueSampleGeneralDetailSection section
= formFactory
.createTissueSampleGeneralDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(TissueSampleGeneralDetailSection
.class, getInput().getClass().getCanonicalName(), true));
797 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
799 SampleDesignationDetailSection sampleDesignationDetailSection
= formFactory
.createSampleDesignationDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(SampleDesignationDetailSection
.class, getInput().getClass().getCanonicalName(), true));
802 addPart(sampleDesignationDetailSection
);
805 private void createDnaSampleSection(RootElement parent
) {
806 DnaSampleGeneralDetailSection section
= formFactory
.createDnaSampleGeneralDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DnaSampleGeneralDetailSection
.class, getInput().getClass().getCanonicalName(), true));
808 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
810 DnaSamplePreparationPreservationSection preparationPreservationSection
= formFactory
.createDnaSamplePreparationPreservationSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DnaSamplePreparationPreservationSection
.class, getInput().getClass().getCanonicalName(), true));
812 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
814 DnaQualityDetailSection qualitySection
= formFactory
.createDnaQualityDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DnaQualityDetailSection
.class, getInput().getClass().getCanonicalName(), true));
816 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
818 SampleDesignationDetailSection sampleDesignationDetailSection
= formFactory
.createSampleDesignationDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(SampleDesignationDetailSection
.class, getInput().getClass().getCanonicalName(), true));
820 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
821 DeterminationDetailSection determinationDetailSection
= null;
822 if(!PreferencesUtil
.isDeterminationOnlyForFieldUnits()){
823 determinationDetailSection
= formFactory
.createDeterminationDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DeterminationDetailSection
.class, getInput().getClass().getCanonicalName()));
826 addPart(preparationPreservationSection
);
827 addPart(qualitySection
);
828 addPart(sampleDesignationDetailSection
);
829 if(!PreferencesUtil
.isDeterminationOnlyForFieldUnits()){
830 addPart(determinationDetailSection
);
834 private void createSequenceSection(RootElement parent
) {
835 SequenceGeneralDetailSection section
= formFactory
.createSequenceGeneralDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(SequenceGeneralDetailSection
.class, getInput().getClass().getCanonicalName(), true));
837 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
839 SequenceReferenceCollectionDetailSection referenceSection
= formFactory
.createSequenceReferenceCollectionDetailSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(SequenceReferenceCollectionDetailSection
.class, getInput().getClass().getCanonicalName(), true));
841 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
843 SequenceContigFileCollectionDetailSection contigFileSection
= formFactory
.createSequenceContigFileCollectionDetailSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(SequenceContigFileCollectionDetailSection
.class, getInput().getClass().getCanonicalName(), true));
847 addPart(referenceSection
);
848 addPart(contigFileSection
);
851 private void createSingleReadSection(RootElement parent
) {
852 SingleReadGeneralDetailSection section
= formFactory
.createSingleReadGeneralDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(SingleReadGeneralDetailSection
.class, getInput().getClass().getCanonicalName(), true));
855 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
857 SingleReadPherogramCollectionDetailSection pherogramSection
= formFactory
.createSingleReadPherogramCollectionDetailSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(SingleReadPherogramCollectionDetailSection
.class, getInput().getClass().getCanonicalName(), true));
858 addPart(pherogramSection
);
862 private void createMediaSpecimenSection(RootElement parent
) {
863 MediaSpecimenGeneralDetailSection generalSection
= formFactory
.createMediaSpecimenGeneralDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(MediaSpecimenGeneralDetailSection
.class, getInput().getClass().getCanonicalName(), true));
864 addPart(generalSection
);
866 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
868 RightsSection rightsSection
= formFactory
.createRightsSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(RightsSection
.class, getInput().getClass().getCanonicalName()));
869 // rightsSection.setEntity(generalSection.getEntity().innerDerivedUnit());
870 addPart(rightsSection
);
874 private void createFeatureTreeSectionForDto(RootElement parent
) {
875 TermTreeDetailSection section
= formFactory
.createFeatureTreeDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(TermTreeDetailSection
.class, getInput().getClass().getCanonicalName(), true));
879 private void createFeatureTreeSection(RootElement parent
) {
880 TermTreeDetailSectionForNode section
= formFactory
.createFeatureTreeDetailSectionForTree(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(TermTreeDetailSection
.class, getInput().getClass().getCanonicalName(), true));
885 private void createFeatureNodeSection(RootElement parent
) {
886 TermNodeDetailSection featureDistributionSection
= formFactory
.createFeatureNodeDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(TermNodeDetailSection
.class, getInput().getClass().getCanonicalName(), true));
888 addPart(featureDistributionSection
);
891 private void createFeatureDistributionSection(RootElement parent
) {
892 FeatureDistributionDetailSection featureDistributionSection
= formFactory
.createFeatureDistributionDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(FeatureDistributionDetailSection
.class, getInput().getClass().getCanonicalName(), true));
894 addPart(featureDistributionSection
);
897 private void createCharacterNodeSection(RootElement parent
) {
898 CharacterNodeDetailSection featureDistributionSection
= formFactory
.createCharacterNodeDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(CharacterDetailSection
.class, getInput().getClass().getCanonicalName(), true));
899 addPart(featureDistributionSection
);
902 private void createCharacterNodeDtoSection(RootElement parent
) {
903 CharacterNodeDtoDetailSection featureDistributionSection
= formFactory
.createCharacterNodeDtoDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(CharacterDetailSection
.class, getInput().getClass().getCanonicalName(), true));
904 addPart(featureDistributionSection
);
907 private void createCharacterSection(RootElement parent
) {
908 CharacterDetailSection featureDistributionSection
= formFactory
.createCharacterDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(CharacterDetailSection
.class, getInput().getClass().getCanonicalName(), true));
909 addPart(featureDistributionSection
);
912 private void createPolytomousKeyNodeSection(RootElement parent
) {
913 PolytomousKeyDetailSection polytomousKeyDetailSection
= formFactory
.createPolytomousKeyDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(PolytomousKeyDetailSection
.class, getInput().getClass().getCanonicalName()));
915 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
917 PolytomousKeyNodeDetailSection polytomousKeyNodeDetailSection
= formFactory
.createPolytomousKeyNodeDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(PolytomousKeyNodeDetailSection
.class, getInput().getClass().getCanonicalName(), true));
919 addPart(polytomousKeyDetailSection
);
920 addPart(polytomousKeyNodeDetailSection
);
924 private void createUseRecordSection(RootElement parent
) {
925 UseRecordDetailSection descriptionUseRecordSection
= formFactory
.createUseRecordDetailSection(getConversationHolder(), parent
, this,StoreUtil
.getSectionStyle(UseRecordDetailSection
.class, getInput().getClass().getCanonicalName(), true));
927 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
929 addPart(descriptionUseRecordSection
);
934 private void createUserSection(RootElement parent
) {
935 UserDetailSection userDetailSection
= formFactory
.createUserDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(UserDetailSection
.class, getInput().getClass().getCanonicalName(), true));
937 GroupsByUserDetailSection groupByUserDetailSection
= formFactory
.createGroupsByUserDetailSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(GroupsByUserDetailSection
.class, getInput().getClass().getCanonicalName(), true));
939 addPart(userDetailSection
);
940 addPart(groupByUserDetailSection
);
943 private void createMisappliedNameSection(RootElement parent
) {
944 TaxonRelationshipDetailSection taxonRelationshipDetailSection
= formFactory
.createTaxonRelationshipDetailSection(getConversationHolder(), parent
, this,
945 StoreUtil
.getSectionStyle(TaxonRelationshipDetailSection
.class, getInput().getClass().getCanonicalName(), true));
946 addPart(taxonRelationshipDetailSection
);
948 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
951 NonViralNameDetailSection nonViralNameSection
= formFactory
952 .createNonViralNameDetailSection(getConversationHolder(), parent
, this, true,
953 StoreUtil
.getSectionStyle(NonViralNameDetailSection
.class, getInput().getClass().getCanonicalName(), true));
954 addPart(nonViralNameSection
);
956 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
958 NomenclaturalReferenceDetailSection referenceDetailSection
= formFactory
.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent
, this,
959 StoreUtil
.getSectionStyle(NomenclaturalReferenceDetailSection
.class, getInput().getClass().getCanonicalName(), true));
960 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
961 addPart(referenceDetailSection
);
964 NomenclaturalStatusSection nomenclaturalStatusSection
= formFactory
.createNomenclaturalStatusSection(getConversationHolder(), parent
,
965 StoreUtil
.getSectionStyle(NomenclaturalStatusSection
.class, getInput().getClass().getCanonicalName(), true));
966 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
967 addPart(nomenclaturalStatusSection
);
969 // ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(ProtologueSection.class, getInput().getClass().getCanonicalName()));
970 // formFactory.createHorizontalSeparator(parent, SWT.BORDER);
971 // addPart(protologSection);
973 TypeDesignationSection typeDesignationSection
= formFactory
.createTypeDesignationSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(TypeDesignationSection
.class, getInput().getClass().getCanonicalName()));
974 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
975 addPart(typeDesignationSection
);
977 NameRelationshipDetailSection nameRelationshipSection
= formFactory
.createNameRelationshipDetailSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(NameRelationshipDetailSection
.class, getInput().getClass().getCanonicalName()));
978 formFactory
.createHorizontalSeparator(parent
, SWT
.BORDER
);
979 addPart(nameRelationshipSection
);
983 private void createTaxonRelationshipSection(RootElement parent
) {
984 TaxonRelationshipDetailSection taxonRelationshipDetailSection
= formFactory
.createTaxonRelationshipDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(TaxonRelationshipDetailSection
.class, getInput().getClass().getCanonicalName(), true));
986 ReferencedEntityDetailSection referencedEntityBaseDetailSection
= formFactory
.createReferencedEntityDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(ReferencedEntityDetailSection
.class, getInput().getClass().getCanonicalName(), true));
987 addPart(taxonRelationshipDetailSection
);
988 addPart(referencedEntityBaseDetailSection
);
990 private void createTermVocabularySection(RootElement parent
) {
991 TermVocabularyDetailSection termVocabularyDetailSection
= formFactory
.createTermVocabularyDetailSection(getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(TermVocabularyDetailSection
.class, getInput().getClass().getCanonicalName(), true));
992 addPart(termVocabularyDetailSection
);
995 private void createDefinedTermSection(RootElement parent
) {
996 DefinedTermDetailSection definedTermDetailSection
= formFactory
.createDefinedTermDetailSection(getInput().getClass(), getConversationHolder(), parent
, this, StoreUtil
.getSectionStyle(DefinedTermDetailSection
.class, getInput().getClass().getCanonicalName(), true));
997 addPart(definedTermDetailSection
);
998 TermMediaSection termMediaSection
= formFactory
.createTermMediaSection(getConversationHolder(), parent
, StoreUtil
.getSectionStyle(DefinedTermDetailSection
.class, getInput().getClass().getCanonicalName(), true));
999 addPart(termMediaSection
);
1003 public void update(CdmDataChangeMap arg0
) {
1008 private void updateView(@UIEventTopic(WorkbenchEventConstants
.REFRESH_DETAILS
)boolean refresh
){
1016 private void updateView(@UIEventTopic(WorkbenchEventConstants
.REFRESH_DETAILS_DISTRIBUTION
)String nameCache
){
1017 if(nameCache
!= null && getInput() instanceof Distribution
&& this.activePart
instanceof IDistributionEditorPart
){
1018 if (part
instanceof CdmSectionPart
&& ((CdmSectionPart
)part
).getSection() instanceof DescriptionElementDetailSection
){
1019 for (ICdmFormElement element
: ((DescriptionElementDetailSection
)((CdmSectionPart
)part
).getSection()).getElements()){
1020 if (element
instanceof DescriptionElementDetailElement
){
1021 for(ICdmFormElement descriptionElement
:((DescriptionElementDetailElement
)element
).getElements()){
1022 if (descriptionElement
instanceof DistributionDetailElement
){
1023 ((DistributionDetailElement
) descriptionElement
).setName(nameCache
);