2 * Copyright (C) 2007 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
.editor
;
12 import java
.util
.Arrays
;
13 import java
.util
.HashSet
;
14 import java
.util
.List
;
16 import java
.util
.UUID
;
18 import org
.eclipse
.jface
.resource
.ImageDescriptor
;
19 import org
.eclipse
.ui
.IEditorInput
;
20 import org
.eclipse
.ui
.IMemento
;
21 import org
.eclipse
.ui
.IPersistableElement
;
23 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
24 import eu
.etaxonomy
.cdm
.api
.conversation
.IConversationEnabled
;
25 import eu
.etaxonomy
.cdm
.api
.service
.IClassificationService
;
26 import eu
.etaxonomy
.cdm
.api
.service
.ITaxonNodeService
;
27 import eu
.etaxonomy
.cdm
.api
.service
.ITaxonService
;
28 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
29 import eu
.etaxonomy
.cdm
.model
.name
.TaxonNameBase
;
30 import eu
.etaxonomy
.cdm
.model
.taxon
.ITaxonTreeNode
;
31 import eu
.etaxonomy
.cdm
.model
.taxon
.Synonym
;
32 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
33 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonBase
;
34 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonNode
;
35 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonRelationship
;
36 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonRelationshipType
;
37 import eu
.etaxonomy
.cdm
.persistence
.hibernate
.CdmDataChangeMap
;
38 import eu
.etaxonomy
.taxeditor
.model
.DataChangeBridge
;
39 import eu
.etaxonomy
.taxeditor
.preference
.PreferencesUtil
;
40 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
44 * <p>TaxonEditorInput class.</p>
50 public class TaxonEditorInput
implements IEditorInput
, IConversationEnabled
, IPersistableElement
{
52 private ConversationHolder conversation
;
54 private TaxonNode taxonNode
;
56 private TaxonEditorInputDataChangeBehaviour dataChangeBehavior
;
58 private TaxonBase initiallySelectedTaxonBase
;
60 private TaxonEditorInput(TaxonNode taxonNode
, ConversationHolder conversation
){
61 this.conversation
= conversation
;
62 this.taxonNode
= taxonNode
;
70 * @param taxonNodeUuid a {@link java.util.UUID} object.
71 * @return a {@link eu.etaxonomy.taxeditor.editor.TaxonEditorInput} object.
72 * @throws java.lang.Exception if any.
74 public static TaxonEditorInput
NewInstance(UUID taxonNodeUuid
) throws Exception
{
76 ConversationHolder conversation
= CdmStore
.createConversation();
77 return NewInstance(taxonNodeUuid
, conversation
);
85 * @param taxonNodeUuid
89 private static TaxonEditorInput
NewInstance(UUID taxonNodeUuid
, ConversationHolder conversation
){
92 TaxonNode taxonNode
= CdmStore
.getService(ITaxonNodeService
.class).load(taxonNodeUuid
, null);
94 if(taxonNode
== null){
95 EditorUtil
.warningDialog("Not yet implemented", TaxonEditorInput
.class, "Selected element is not type TaxonBase.");
99 return new TaxonEditorInput(taxonNode
, conversation
);
103 * <p>NewInstanceFromTaxonBase</p>
105 * @param taxonBaseUuid a {@link java.util.UUID} object.
106 * @return a {@link eu.etaxonomy.taxeditor.editor.TaxonEditorInput} object.
108 public static TaxonEditorInput
NewInstanceFromTaxonBase(UUID taxonBaseUuid
){
109 ConversationHolder conversation
= CdmStore
.createConversation();
111 TaxonEditorInput input
= null;
113 TaxonBase taxonBase
= CdmStore
.getService(ITaxonService
.class).find(taxonBaseUuid
);
114 if(taxonBase
.isOrphaned()) {
115 EditorUtil
.warningDialog("Orphaned Taxon", TaxonEditorInput
.class, "This is an orphaned taxon i.e. a taxon that is not connected to a classification and not having any taxonomic relationships. Editing of orphaned taxon is currently not supported.");
117 else if(taxonBase
.isInstanceOf(Taxon
.class)){
118 Taxon taxon
= CdmBase
.deproxy(taxonBase
, Taxon
.class);
120 if (taxon
.isMisapplication()){
121 // TODO get accepted taxon
122 EditorUtil
.info("trying to open Mispplied Name ");
124 Set
<Taxon
> acceptedTaxa
= new HashSet
<Taxon
>();
125 Set
<TaxonRelationship
> relations
= taxon
.getRelationsFromThisTaxon();
126 for(TaxonRelationship relation
: relations
){
127 if(relation
.getType().equals(TaxonRelationshipType
.MISAPPLIED_NAME_FOR())){
128 acceptedTaxa
.add(relation
.getToTaxon());
131 input
= getInputForMultipleTaxa(conversation
, acceptedTaxa
);
134 input
= getInputForMultipleNodes(conversation
, taxon
.getTaxonNodes());
136 }else if(taxonBase
instanceof Synonym
){
137 Synonym synonym
= (Synonym
) taxonBase
;
139 Set
<Taxon
> taxa
= synonym
.getAcceptedTaxa();
140 input
= getInputForMultipleTaxa(conversation
, taxa
);
143 input
.setInitiallySelectedTaxonBase(taxonBase
);
148 private static TaxonEditorInput
getInputForMultipleNodes(ConversationHolder conversation
, Set
<TaxonNode
> taxonNodes
){
149 if(taxonNodes
.size() == 1){
150 TaxonNode taxonNode
= taxonNodes
.iterator().next();
151 return NewInstance(taxonNode
.getUuid(), conversation
);
152 }else if(taxonNodes
.size() > 1){
153 TaxonNode taxonNode
= ChooseFromMultipleTaxonNodesDialog
.choose(taxonNodes
);
154 if(taxonNode
!= null){
155 return NewInstance(taxonNode
.getUuid(), conversation
);
157 }else if(taxonNodes
.size() == 0){
158 // this is an undesired state
159 EditorUtil
.warningDialog("Incorrect state", TaxonEditorInput
.class, "The accepted taxon is not part of any classification. This should not have happened.");
164 private static TaxonEditorInput
getInputForMultipleTaxa(ConversationHolder conversation
, Set
<Taxon
> taxa
){
165 if(taxa
.size() == 1){
166 Taxon taxon
= taxa
.iterator().next();
167 Set
<TaxonNode
> nodes
= taxon
.getTaxonNodes();
168 return getInputForMultipleNodes(conversation
, nodes
);
169 }else if(taxa
.size() > 1){
170 Set
<TaxonNode
> taxonNodes
= new HashSet
<TaxonNode
>();
171 for ( Taxon taxon
: taxa
){
172 taxonNodes
.addAll(taxon
.getTaxonNodes());
174 return getInputForMultipleNodes(conversation
, taxonNodes
);
175 }else if(taxa
.size() == 0){
176 // this is an undesired state
177 EditorUtil
.warningDialog("Incorrect state", TaxonEditorInput
.class, "Trying to open accepted taxon for a synonym or misapplication but" +
178 " no accepted taxa are present. This should not have happened.");
184 * <p>NewEmptyInstance</p>
186 * @param parentNodeUuid a {@link java.util.UUID} object.
187 * @return a {@link eu.etaxonomy.taxeditor.editor.TaxonEditorInput} object.
189 public static TaxonEditorInput
NewEmptyInstance(UUID parentNodeUuid
){
190 ConversationHolder conversation
= CdmStore
.createConversation();
192 TaxonNameBase
<?
, ?
> name
= PreferencesUtil
.getPreferredNomenclaturalCode().getNewTaxonNameInstance(null);
193 ITaxonTreeNode parentNode
= CdmStore
.getService(IClassificationService
.class).getTreeNodeByUuid(parentNodeUuid
);
195 Taxon newTaxon
= Taxon
.NewInstance(name
, parentNode
.getReference());
196 TaxonNode newTaxonNode
= parentNode
.addChildTaxon(newTaxon
, parentNode
.getReference(), parentNode
.getMicroReference());
198 // add the new taxon to the editors persistence context
199 UUID newTaxonNodeUuid
= CdmStore
.getService(ITaxonNodeService
.class).save(newTaxonNode
);
201 return new TaxonEditorInput(newTaxonNode
, conversation
);
205 * @see org.eclipse.ui.IEditorInput#exists()
213 public boolean exists() {
214 return taxonNode
!= null;
218 * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
221 * <p>getImageDescriptor</p>
223 * @return a {@link org.eclipse.jface.resource.ImageDescriptor} object.
226 public ImageDescriptor
getImageDescriptor() {
231 * @see org.eclipse.ui.IEditorInput#getName()
236 * @return a {@link java.lang.String} object.
239 public String
getName() {
240 if(getTaxon() == null){
243 TaxonNameBase
<?
, ?
> name
= getTaxon().getName();
244 if (name
== null || name
.getTitleCache() == null) {
247 return name
.getTitleCache();
252 * @see org.eclipse.ui.IEditorInput#getPersistable()
255 * <p>getPersistable</p>
257 * @return a {@link org.eclipse.ui.IPersistableElement} object.
260 public IPersistableElement
getPersistable() {
261 // if(CdmStore.isActive()){
262 // TaxonNode test = CdmStore.getTaxonTreeService().getTaxonNodeByUuid(taxonNode.getUuid());
263 // boolean isPersistable = CdmStore.getTaxonTreeService().getTaxonNodeByUuid(taxonNode.getUuid()) != null;
264 // if (isPersistable) {
272 * @see org.eclipse.ui.IEditorInput#getToolTipText()
275 * <p>getToolTipText</p>
277 * @return a {@link java.lang.String} object.
280 public String
getToolTipText() {
285 * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
289 public Object
getAdapter(Class adapter
) {
291 if (adapter
== Taxon
.class) {
292 return taxonNode
.getTaxon();
295 if (adapter
== TaxonNode
.class) {
305 * Overrides equals to ensure that a taxon can only be edited by
306 * one editor at a time.
309 public boolean equals(Object obj
) {
310 if (TaxonEditorInput
.class.equals(obj
.getClass())
311 && getTaxon() != null
312 && getTaxon().equals(((TaxonEditorInput
) obj
).getTaxon())){
313 if(((TaxonEditorInput
) obj
).getInitiallySelectedTaxonBase() != null){
314 setInitiallySelectedTaxonBase(((TaxonEditorInput
) obj
).getInitiallySelectedTaxonBase());
326 public Taxon
getTaxon(){
328 List
<String
> TAXON_INIT_STRATEGY
= Arrays
.asList(new String
[]{
329 // CdmBase : toOne-> "created, createdBy, uuid"
330 // VersionableEntity : toOne-> "updated, updatedBy"
331 // AnnotatableEntity : toMany-> "annotations, markers"
332 // IdentifiableEntity : toMany-> "credits, extensions, rights, sources"
334 // TaxonBase : toOne-> "homotypicgroup, name, sec"
335 // Taxon : toMany-> "descriptions, heterotypicSynonymyGroups, homotypicSynonymsByHomotypicGroup, homotypicSynonymsByHomotypicRelationship, homotypicSynonymyGroups, misappliedNames, relationsFromThisTaxon, relationsToThisTaxon, synonymNames, synonymRelations, synonyms, synonymsSortedByType, taxonNodes, taxonRelations"
336 // : toOne-> "imageGallery"
339 // CdmBase : toOne-> "created, createdBy, uuid"
340 // VersionableEntity : toOne-> "updated, updatedBy"
341 // AnnotatableEntity : toMany-> "" (available: "annotations, markers")
342 // LanguageStringBase : toOne-> "language"
343 // Annotation : toOne-> "annotatedObj, annotationType, commentator, linkbackUrl
346 // CdmBase : toOne-> "created, createdBy, uuid"
347 // VersionableEntity : toOne-> "updated, updatedBy"
348 // Marker : toOne-> "markedObj, markerType"
350 "markers.markerType.$",
352 // CdmBase : toOne-> "created, createdBy, uuid"
353 // AnnotatableEntity : toMany-> "" (available: "annotations, markers")
354 // LanguageStringBase : toOne-> "language"
355 // Annotation : toOne-> "annotatedObj, annotationType, commentator, linkbackUrl
356 // Credit : toOne-> "agent"
359 // CdmBase : toOne-> "created, createdBy, uuid"
360 // VersionableEntity : toOne-> "updated, updatedBy"
361 // Extension : toOne-> "extendedObj, type"
365 // CdmBase : toOne-> "created, createdBy, uuid"
366 // VersionableEntity : toOne-> "updated, updatedBy"
367 // AnnotatableEntity : toMany-> "" (available: "annotations, markers")
368 // LanguageStringBase : toOne-> "language"
369 // Rights : toOne-> "agent, type, uri"
372 // CdmBase : toOne-> "created, createdBy, uuid"
373 // VersionableEntity : toOne-> "updated, updatedBy"
374 // AnnotatableEntity : toMany-> "" (available: "annotations, markers")
375 // ReferencedEntityBase : toOne-> "citation"
376 // OriginalSourceBase :
377 // IdentifiableSource : toOne-> "sourcedObj"
380 // CdmBase : toOne-> "created, createdBy, uuid"
381 // AnnotatableEntity : toMany-> "" (available: "annotations, markers")
382 // HomotypicalGroup : toMany-> "" (available: "basionymAndReplacedSynonymRelations, basionyms, basionymsOrReplacedSynonyms, nameTypeDesignations, newCombinations, replacedSynonym, specimenTypeDesignations, synonymsInGroup, typeDesignations, typifiedNames, unrelatedNames" )
385 // CdmBase : toOne-> "created, createdBy, uuid"
386 // AnnotatableEntity : toMany-> "" (available: "annotations, markers")
387 // TaxonNameBase : toMany-> "" (available: "basionyms, descriptions, nameRelations, nameTypeDesignations, relationsFromThisName, relationsToThisName, specimenTypeDesignations, specimenTypeDesignationsOfHomotypicalGroup, status, synonyms, taggedName, taxa, taxonBases, typeDesignations" )
388 // : toOne-> "basionym, citation, homotypicalGroup, nomenclaturalCode, nomenclaturalReference, rank"
390 // NonViralName : toMany->"" (available: "childRelationships, hybridChildRelations, hybridParentRelations, orderedChildRelationships, parentRelationships")
391 // : toOne-> "basionymAuthorTeam, combinationAuthorTeam, exBasionymAuthorTeam, exCombinationAuthorTeam"
394 // CdmBase : toOne-> "created, createdBy, uuid"
395 // VersionableEntity : toOne-> "updated, updatedBy"
396 // AnnotatableEntity : toMany-> "annotations, markers"
397 // IdentifiableEntity : toMany-> "credits, extensions, rights, sources"
399 // IdentifiableMediaEntity : toMany->"" (available: "media")
400 // Reference : toOne->"authorTeam, datePublished, inBook, inJournal, inProceedings, inReference, inSeries, institution, school, type, uri"
403 // CdmBase : toOne-> "created, createdBy, uuid"
404 // AnnotatableEntity : toMany-> "annotations, markers"
405 // IdentifiableEntity : toMany-> "credits, extensions, rights, sources"
407 // DescriptionBase : toMany->"" (available: "describedSpecimenOrObservations, descriptiveSystem, elements, workingSets" )
408 // TaxonDescription : toMany->"" (available: "geoScopes, scopes" )
413 // CdmBase : toOne-> "created, createdBy, uuid"
414 // VersionableEntity : toOne-> "updated, updatedBy"
415 // AnnotatableEntity : toMany-> "annotations, markers"
416 // ReferencedEntityBase : toOne-> "citation"
417 // RelationshipBase :
418 // TaxonRelationship : toOne->"fromTaxon, relatedFrom, relatedTo, toTaxon, type"
419 "relationsFromThisTaxon.$",
421 // CdmBase : toOne-> "created, createdBy, uuid"
422 // VersionableEntity : toOne-> "updated, updatedBy"
423 // AnnotatableEntity : toMany-> "annotations, markers"
424 // ReferencedEntityBase : toOne-> "citation"
425 // RelationshipBase :
426 // TaxonRelationship : toOne->"fromTaxon, relatedFrom, relatedTo, toTaxon, type"
427 "relationsToThisTaxon.$",
429 // CdmBase : toOne-> "created, createdBy, uuid"
430 // VersionableEntity : toOne-> "updated, updatedBy"
431 // AnnotatableEntity : toMany-> "annotations, markers"
432 // ReferencedEntityBase : toOne-> "citation"
433 // RelationshipBase :
434 // SynonymRelationship : toOne->"acceptedTaxon, relatedFrom, relatedTo, synonym, type"
435 "synonymRelations.$",
437 // CdmBase : toOne-> "created, createdBy, uuid"
438 // VersionableEntity : toOne-> "updated, updatedBy"
439 // AnnotatableEntity : toMany-> "annotations, markers"
440 // IdentifiableEntity : toMany-> "credits, extensions, rights, sources"
442 // TaxonBase : toOne-> "homotypicgroup, name, sec"
443 // Synonym : toMany-> "" (available: "acceptedTaxa, relationType, synonymRelations" )
448 "misappliedNames.name.extensions.type.$",
449 "misappliedNames.name.status.$",
450 "misappliedNames.name.status.type.$",
451 "misappliedNames.name.descriptions.elements.$",
452 "misappliedNames.name.typeDesignations.$",
453 "misappliedNames.name.typeDesignations.typeStatus.$",
455 // "relationsFromThisTaxon.fromTaxon.$",
456 // "relationsFromThisTaxon.fromTaxon.name.status.$",
457 // "relationsFromThisTaxon.fromTaxon.name.status.type.$",
458 // "relationsFromThisTaxon.fromTaxon.name.descriptions.elements.$",
459 // "relationsFromThisTaxon.fromTaxon.name.typeDesignations.typeStatus.$",
460 // "relationsFromThisTaxon.toTaxon.$",
461 //// "relationsFromThisTaxon.toTaxon.name.extensions.type.$",
462 // "relationsFromThisTaxon.toTaxon.name.status.$",
463 // "relationsFromThisTaxon.toTaxon.name.status.type.$",
464 // "relationsFromThisTaxon.toTaxon.name.descriptions.elements.$",
465 // "relationsFromThisTaxon.toTaxon.name.typeDesignations.typeStatus.$",
467 // "relationsToThisTaxon.fromTaxon.$",
468 // "relationsToThisTaxon.fromTaxon.name.extensions.type.$",
469 // "relationsToThisTaxon.fromTaxon.name.status.type.$",
470 // "relationsToThisTaxon.fromTaxon.name.descriptions.elements.$",
471 // "relationsToThisTaxon.fromTaxon.name.typeDesignations.typeStatus.$",
472 // "relationsToThisTaxon.toTaxon.$",
473 // "relationsToThisTaxon.toTaxon.name.status.type.$",
474 // "relationsToThisTaxon.toTaxon.name.descriptions.elements.$",
475 // "relationsToThisTaxon.toTaxon.name.typeDesignations.typeStatus.$",
477 // TaxonNameEditor.createOrUpdateNameComposites()
478 // ContainerFactory.createOrUpdateAcceptedTaxonsHomotypicGroup()
479 "name.homotypicalGroup.typifiedNames.$",
480 "name.homotypicalGroup.synonymsInGroup",
481 "name.synonymRelations",
482 "name.descriptions.elements.$",
484 // "name.descriptions.scopes.$",
485 // "name.descriptions.scopes.terms.$",
486 "name.descriptions.geoscopes.$",
487 "name.descriptions.geoscopes.vocabulary.$",
488 "name.descriptions.geoscopes.vocabulary.terms.$",
490 // ContainerFactory.createOrUpdateAcceptedTaxonsHomotypicGroup()
491 "name.homotypicalGroup.$",
492 "name.homotypicalGroup.typifiedNames:$",
494 "synonymRelations.synonym.name.$",
495 "synonymRelations.synonym.name.descriptions.elements.$",
496 "synonymRelations.synonym.name.homotypicalGroup.$",
497 "synonymRelations.synonym.name.homotypicalGroup.typifiedNames.$",
498 "synonymRelations.synonym.name.status.$",
500 "synonymRelations.synonym.name.typeDesignations.$",
501 "synonymRelations.synonym.name.typeDesignations.typifiedNames.$",
502 "synonymRelations.synonym.name.typeDesignations.typeStatus.$",
503 "synonymRelations.synonym.name.typeDesignations.typeName.$",
504 "synonymRelations.synonym.name.typeDesignations.typeSpecimen.$",
507 // CdmBase : toOne-> "created, createdBy, uuid"
508 // VersionableEntity : toOne-> "updated, updatedBy"
509 // AnnotatableEntity : toMany-> "annotations, markers"
510 // DescriptionElementBase : toMany->"" (available: "media, modifiers, modifyingText, sources" )
511 // : toOne-> "feature, inDescription"
512 // CategoricalData : toMany->"" (available: "states" )
513 // CommonTaxaName : toOne->"area, language"
514 // Distribution : toOne->"area, status"
515 // IndividualsAssociation : toMany->"" (available: "description" )
516 // : toOne-> "associatedSpecimenOrObserviation"
517 // QuantitativeData : toMany->"" (available: "statisticalValues" )
519 // TaxonInteraction : toMany->"" (available: "descriptions" )
520 // : toOne-> "taxon2"
521 // TextData : toMany->"" (available: "multilanguageText" )
522 // : toOne-> "format, languageText, preferredLanguageString"
523 "descriptions.elements.$",
525 "descriptions.elements.annotations.$",
526 "descriptions.elements.markers.markerType.$",
528 "descriptions.elements.modifiers.$",
529 "descriptions.elements.modifyingText.$",
531 "descriptions.elements.description.$",
533 "descriptions.elements.associatedSpecimenOrObservation.$",
534 "descriptions.elements.associatedSpecimenOrObservation.annotations.$",
535 "descriptions.elements.associatedSpecimenOrObservation.annotations.annotationType.$",
536 "descriptions.elements.associatedSpecimenOrObservation.markers.markerType.$",
537 "descriptions.elements.associatedSpecimenOrObservation.credits.$",
538 "descriptions.elements.associatedSpecimenOrObservation.extensions.type.$",
539 "descriptions.elements.associatedSpecimenOrObservation.rights.$",
540 "descriptions.elements.associatedSpecimenOrObservation.sources.$",
541 "descriptions.elements.associatedSpecimenOrObservation.media.$",
542 "descriptions.elements.associatedSpecimenOrObservation.media.representations.parts.$",
544 "descriptions.elements.descriptions.$",
546 "descriptions.elements.multilanguageText.$",
548 // CdmBase : toOne-> "created, createdBy, uuid"
549 // VersionableEntity : toOne-> "updated, updatedBy"
550 // AnnotatableEntity : toMany-> "annotations, markers"
551 // IdentifiableEntity : toMany-> "credits, extensions, rights, sources"
553 // Media : toMany->"allDescriptions, allTitles, representations"
554 // : toOne-> "artist, description, mediaCreated, title"
555 "descriptions.elements.media.$",
556 // "descriptions.elements.media.allDescriptions.$",
557 // CdmBase : toOne-> "created, createdBy, uuid"
558 // VersionableEntity : toOne-> "updated, updatedBy"
559 // MediaRepresentation : toMany-> "parts"
561 // MediaRepresentationPart : toOne-> "mediaRepresentation, size, uri"
562 "descriptions.elements.media.representations.parts.$",
564 "descriptions.elements.media.annotations.$",
565 "descriptions.elements.media.annotations.annotationType.$",
566 "descriptions.elements.media.credits.$",
567 "descriptions.elements.media.extensions.$",
568 "descriptions.elements.media.extensions.type.$",
569 "descriptions.elements.media.markers.$",
570 "descriptions.elements.media.markers.marker.Type.$",
571 "descriptions.elements.media.rights.$",
572 "descriptions.elements.media.sources.$",
574 "descriptions.elements.states.$",
575 "descriptions.elements.statisticalValues.$",
578 // DescriptiveContentProvider.getContainerTreeForDesription()
579 // FeatureNodeContainerTree.getDescriptionsElementsForFeature()
580 // DescriptionHelper.getElementText()
582 // CdmBase : toOne-> "created, createdBy, uuid"
583 // VersionableEntity : toOne-> "updated, updatedBy"
584 // AnnotatableEntity : toMany-> "annotations, markers"
585 // ReferencedEntityBase : toOne-> "citation"
586 // DescriptionElementSource : toOne-> "nameUsedInSource, sourcedObj"
587 "descriptions.elements.sources.$",
589 // NamedArea.labelWithLevel()
591 // CdmBase : toOne-> "created, createdBy, uuid"
592 // VersionableEntity : toOne-> "updated, updatedBy"
593 // AnnotatableEntity : toMany-> "annotations, markers"
594 // ReferencedEntityBase : toOne-> "citation"
595 // NamedArea : toMany->"" (available: "allLevelList, generalizationOf, includes, waterbodiesOrCountries" )
596 // : toOne-> "hierarchieList, kindOf, level, partOf, pointApproximation, shape, type, validPeriod"
597 "descriptions.elements.area.$",
598 "descriptions.elements.area.allLevelList.$",
599 "descriptions.elements.area.allLevelList.vocabulary.$",
600 "descriptions.elements.area.allLevelList.vocabulary.terms.$",
601 "descriptions.elements.area.vocabulary.$",
602 "descriptions.elements.area.vocabulary.terms.$",
603 "descriptions.elements.vocabulary.$",
604 "descriptions.elements.vocabulary.terms.$",
607 // "descriptions.scopes.$",
608 // "descriptions.scopes.terms.$",
609 // "descriptions.geoscopes.$",
610 // "descriptions.geoscopes.vocabulary.$",
611 // "descriptions.geoscopes.vocabulary.terms.$",
613 // NameRelationshipDetailSection.createElementComposite()
614 // NameRelationshipDetailElement.setEntity()
615 "name.nameRelations.$",
619 "name.extensions.type.$",
621 "name.basionymAuthorTeam.$",
622 "name.basionymAuthorTeam.annotations.$",
623 "name.basionymAuthorTeam.annotations.annotationType.$",
624 "name.basionymAuthorTeam.markers.markerType.$",
625 "name.basionymAuthorTeam.credits.$",
626 "name.basionymAuthorTeam.extensions.type.$",
627 "name.basionymAuthorTeam.rights.$",
628 "name.basionymAuthorTeam.sources.$",
629 "name.basionymAuthorTeam.media.$",
630 "name.basionymAuthorTeam.media.representations.parts.$",
631 "name.basionymAuthorTeam.teamMembers.$",
632 "name.basionymAuthorTeam.teamMembers.annotations.$",
633 "name.basionymAuthorTeam.teamMembers.annotations.annotationType.$",
634 "name.basionymAuthorTeam.teamMembers.markers.markerType.$",
635 "name.basionymAuthorTeam.teamMembers.credits.$",
636 "name.basionymAuthorTeam.teamMembers.extensions.type.$",
637 "name.basionymAuthorTeam.teamMembers.rights.$",
638 "name.basionymAuthorTeam.teamMembers.sources.$",
639 "name.basionymAuthorTeam.teamMembers.media.$",
640 "name.basionymAuthorTeam.teamMembers.media.representations.parts.$",
642 "name.combinationAuthorTeam.$",
643 "name.combinationAuthorTeam.annotations.$",
644 "name.combinationAuthorTeam.annotations.annotationType.$",
645 "name.combinationAuthorTeam.markers.markerType.$",
646 "name.combinationAuthorTeam.credits.$",
647 "name.combinationAuthorTeam.extensions.type.$",
648 "name.combinationAuthorTeam.rights.$",
649 "name.combinationAuthorTeam.sources.$",
650 "name.combinationAuthorTeam.media.$",
651 "name.combinationAuthorTeam.media.representations.parts.$",
652 "name.combinationAuthorTeam.teamMembers.$",
653 "name.combinationAuthorTeam.teamMembers.annotations.$",
654 "name.combinationAuthorTeam.teamMembers.annotations.annotationType.$",
655 "name.combinationAuthorTeam.teamMembers.markers.markerType.$",
656 "name.combinationAuthorTeam.teamMembers.credits.$",
657 "name.combinationAuthorTeam.teamMembers.extensions.type.$",
658 "name.combinationAuthorTeam.teamMembers.rights.$",
659 "name.combinationAuthorTeam.teamMembers.sources.$",
660 "name.combinationAuthorTeam.teamMembers.media.$",
661 "name.combinationAuthorTeam.teamMembers.media.representations.parts.$",
663 "name.exBasionymAuthorTeam.$",
664 "name.exBasionymAuthorTeam.annotations.$",
665 "name.exBasionymAuthorTeam.annotations.annotationType.$",
666 "name.exBasionymAuthorTeam.markers.markerType.$",
667 "name.exBasionymAuthorTeam.credits.$",
668 "name.exBasionymAuthorTeam.extensions.type.$",
669 "name.exBasionymAuthorTeam.rights.$",
670 "name.exBasionymAuthorTeam.sources.$",
671 "name.exBasionymAuthorTeam.media.$",
672 "name.exBasionymAuthorTeam.media.representations.parts.$",
673 "name.exBasionymAuthorTeam.teamMembers.$",
674 "name.exBasionymAuthorTeam.teamMembers.annotations.$",
675 "name.exBasionymAuthorTeam.teamMembers.annotations.annotationType.$",
676 "name.exBasionymAuthorTeam.teamMembers.markers.markerType.$",
677 "name.exBasionymAuthorTeam.teamMembers.credits.$",
678 "name.exBasionymAuthorTeam.teamMembers.extensions.type.$",
679 "name.exBasionymAuthorTeam.teamMembers.rights.$",
680 "name.exBasionymAuthorTeam.teamMembers.sources.$",
681 "name.exBasionymAuthorTeam.teamMembers.media.$",
682 "name.exBasionymAuthorTeam.teamMembers.media.representations.parts.$",
684 "name.exCombinationAuthorTeam.$",
685 "name.exCombinationAuthorTeam.annotations.$",
686 "name.exCombinationAuthorTeam.annotations.annotationType.$",
687 "name.exCombinationAuthorTeam.markers.markerType.$",
688 "name.exCombinationAuthorTeam.credits.$",
689 "name.exCombinationAuthorTeam.extensions.type.$",
690 "name.exCombinationAuthorTeam.rights.$",
691 "name.exCombinationAuthorTeam.sources.$",
692 "name.exCombinationAuthorTeam.media.$",
693 "name.exCombinationAuthorTeam.media.representations.parts.$",
694 "name.exCombinationAuthorTeam.teamMembers.$",
695 "name.exCombinationAuthorTeam.teamMembers.annotations.$",
696 "name.exCombinationAuthorTeam.teamMembers.annotations.annotationType.$",
697 "name.exCombinationAuthorTeam.teamMembers.markers.markerType.$",
698 "name.exCombinationAuthorTeam.teamMembers.credits.$",
699 "name.exCombinationAuthorTeam.teamMembers.extensions.type.$",
700 "name.exCombinationAuthorTeam.teamMembers.rights.$",
701 "name.exCombinationAuthorTeam.teamMembers.sources.$",
702 "name.exCombinationAuthorTeam.teamMembers.media.$",
703 "name.exCombinationAuthorTeam.teamMembers.media.representations.parts.$",
705 "name.nomenclaturalReference.annotations.$",
706 "name.nomenclaturalReference.annotations.annotationType.$",
707 "name.nomenclaturalReference.authorTeam.$",
708 "name.nomenclaturalReference.authorTeam.media.$",
709 "name.nomenclaturalReference.authorTeam.media.representations.parts.$",
710 "name.nomenclaturalReference.markers.markerType.$",
711 "name.nomenclaturalReference.credits.$",
712 "name.nomenclaturalReference.extensions.type.$",
713 "name.nomenclaturalReference.rights.$",
714 "name.nomenclaturalReference.rights.type.$",
715 "name.nomenclaturalReference.sources.$",
716 "name.nomenclaturalReference.media.$",
717 "name.nomenclaturalReference.media.representations.parts.$",
718 "name.nomenclaturalReference.inReference.$",
719 "name.nomenclaturalReference.inReference.annotations.$",
720 "name.nomenclaturalReference.inReference.annotations.annotationType.$",
721 "name.nomenclaturalReference.inReference.markers.markerType.$",
723 "name.nomenclaturalReference.inReference.credits.$",
724 "name.nomenclaturalReference.inReference.extensions.type.$",
725 "name.nomenclaturalReference.inReference.rights.$",
726 "name.nomenclaturalReference.inReference.rights.type.$",
727 "name.nomenclaturalReference.inReference.sources.$",
728 "name.nomenclaturalReference.inReference.media.$",
729 "name.nomenclaturalReference.inReference.media.representations.parts.$",
732 "name.status.annotations.$",
733 "name.status.annotations.annotationType.$",
734 "name.status.markers.markerType.$",
735 "name.status.type.$",
737 "name.typeDesignations.$",
738 "name.typeDesignations.typifiedNames.$",
739 "name.typeDesignations.typeStatus.$",
740 "name.typeDesignations.typeName.$",
741 "name.typeDesignations.typeSpecimen.$",
745 return (Taxon
) CdmStore
.getService(ITaxonService
.class).load(taxonNode
.getTaxon().getUuid(), TAXON_INIT_STRATEGY
);
750 * <p>Getter for the field <code>taxonNode</code>.</p>
752 * @return the taxonNode
754 public TaxonNode
getTaxonNode() {
760 * @see eu.etaxonomy.cdm.api.conversation.IConversationEnabled#getConversationHolder()
763 * <p>getConversationHolder</p>
765 * @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
768 public ConversationHolder
getConversationHolder() {
774 * @see eu.etaxonomy.cdm.persistence.hibernate.ICdmPostCrudObserver#update(eu.etaxonomy.cdm.persistence.hibernate.CdmCrudEvent)
778 public void update(CdmDataChangeMap events
) {
779 if(dataChangeBehavior
== null){
780 dataChangeBehavior
= new TaxonEditorInputDataChangeBehaviour(this);
783 DataChangeBridge
.handleDataChange(events
, dataChangeBehavior
);
787 * @see org.eclipse.ui.IPersistableElement#getFactoryId()
790 * <p>getFactoryId</p>
792 * @return a {@link java.lang.String} object.
795 public String
getFactoryId() {
796 return TaxonEditorInputFactory
.getFactoryId();
800 * @see org.eclipse.ui.IPersistable#saveState(org.eclipse.ui.IMemento)
804 public void saveState(IMemento memento
) {
805 TaxonEditorInputFactory
.saveState(memento
, this);
810 * <p>Setter for the field <code>initiallySelectedTaxonBase</code>.</p>
812 * @param taxonBase a {@link eu.etaxonomy.cdm.model.taxon.TaxonBase} object.
814 public void setInitiallySelectedTaxonBase(TaxonBase taxonBase
) {
815 this.initiallySelectedTaxonBase
= taxonBase
;
819 * <p>Getter for the field <code>initiallySelectedTaxonBase</code>.</p>
821 * @return a {@link eu.etaxonomy.cdm.model.taxon.TaxonBase} object.
823 public TaxonBase
getInitiallySelectedTaxonBase() {
824 return initiallySelectedTaxonBase
;
828 public String
toString() {
829 return String
.format("%s[%s]", this.getClass().getSimpleName(), getTaxon());