Revision dea7cd9c
Added by Patrick Plitzner over 9 years ago
- added command, handler, double click listener to open taxa from associated taxa section in details view
- caught runtime exception for orphaned taxa
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/TaxonEditorInput.java | ||
---|---|---|
48 | 48 |
*/ |
49 | 49 |
public class TaxonEditorInput implements IEditorInput, IConversationEnabled, IPersistableElement { |
50 | 50 |
|
51 |
private ConversationHolder conversation; |
|
51 |
private final ConversationHolder conversation;
|
|
52 | 52 |
|
53 |
private TaxonNode taxonNode; |
|
53 |
private final TaxonNode taxonNode;
|
|
54 | 54 |
|
55 | 55 |
private TaxonEditorInputDataChangeBehaviour dataChangeBehavior; |
56 | 56 |
|
... | ... | |
111 | 111 |
|
112 | 112 |
TaxonBase taxonBase = CdmStore.getService(ITaxonService.class).find(taxonBaseUuid); |
113 | 113 |
if (taxonBase != null){ |
114 |
if(taxonBase.isOrphaned()) { |
|
115 |
MessagingUtils.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."); |
|
116 |
} |
|
117 |
else if(taxonBase.isInstanceOf(Taxon.class)){ |
|
114 |
if(taxonBase.isInstanceOf(Taxon.class)){ |
|
118 | 115 |
Taxon taxon = CdmBase.deproxy(taxonBase, Taxon.class); |
119 |
|
|
116 |
|
|
120 | 117 |
if (taxon.getTaxonNodes().size() == 0 && taxon.isMisapplication()){ |
121 | 118 |
// TODO get accepted taxon |
122 | 119 |
MessagingUtils.info("trying to open Mispplied Name "); |
123 |
|
|
120 |
|
|
124 | 121 |
Set<Taxon> acceptedTaxa = new HashSet<Taxon>(); |
125 | 122 |
Set<TaxonRelationship> relations = taxon.getRelationsFromThisTaxon(); |
126 | 123 |
for(TaxonRelationship relation : relations){ |
... | ... | |
129 | 126 |
} |
130 | 127 |
} |
131 | 128 |
input = getInputForMultipleTaxa(conversation, acceptedTaxa); |
132 |
|
|
129 |
|
|
133 | 130 |
}else{ |
134 | 131 |
input = getInputForMultipleNodes(conversation, taxon.getTaxonNodes()); |
135 | 132 |
} |
136 | 133 |
}else if(taxonBase instanceof Synonym){ |
137 | 134 |
Synonym synonym = (Synonym) taxonBase; |
138 |
|
|
135 |
|
|
139 | 136 |
Set<Taxon> taxa = synonym.getAcceptedTaxa(); |
140 | 137 |
input = getInputForMultipleTaxa(conversation, taxa); |
141 | 138 |
} |
... | ... | |
143 | 140 |
input.setInitiallySelectedTaxonBase(taxonBase); |
144 | 141 |
} |
145 | 142 |
} |
146 |
|
|
143 |
|
|
147 | 144 |
|
148 | 145 |
return input; |
149 | 146 |
} |
Also available in: Unified diff