Revision 3f482e4c
Added by Katja Luther about 3 years ago
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/RemotingChangeAcceptedTaxonToSynonymHandlerE4.java | ||
---|---|---|
144 | 144 |
SecReferenceHandlingEnum secHandling = PreferencesUtil.getSecReferenceHandlingPreference(); |
145 | 145 |
UUID newSecUuid = null; |
146 | 146 |
UUID newTaxonUuid = newAcceptedTaxonNode.getTaxon() != null && newAcceptedTaxonNode.getTaxon().getSec() != null ? newAcceptedTaxonNode.getTaxon().getSec().getUuid(): null; |
147 |
//the moved taxa have different secundum references |
|
147 | 148 |
if (secUuids.size() > 1 && !(secHandling.equals(SecReferenceHandlingEnum.KeepAlways) || secHandling.equals(SecReferenceHandlingEnum.AlwaysDelete))){ |
148 | 149 |
int result = MessagingUtils.confirmDialog(Messages.RemotingChangeAcceptedTaxonToSynonymHandler_Select_Sec_Reference_Handling_title, Messages.RemotingChangeAcceptedTaxonToSynonymHandler_Select_Sec_Reference_Handling_message, |
149 | 150 |
new String[]{Messages.RemotingChangeAcceptedTaxonToSynonymHandler_Select_Sec_Reference_Keep, Messages.RemotingChangeAcceptedTaxonToSynonymHandler_Select_Sec_Reference_Parent, Messages.RemotingChangeAcceptedTaxonToSynonymHandler_Select_Sec_Reference_Select}); |
150 | 151 |
if (result == 2){ |
152 |
//select new reference |
|
151 | 153 |
Reference sec = ReferenceSelectionDialog.select(shell, null); |
152 | 154 |
newSecUuid = sec != null? sec.getUuid(): null; |
153 | 155 |
}else if (result == 1){ |
156 |
//use parent sec |
|
154 | 157 |
newSecUuid = newTaxonUuid; |
155 | 158 |
}else if (result == 0){ |
159 |
//keep sec (also homotypic synonyms with different sec will keep the secundum) |
|
156 | 160 |
secHandling = SecReferenceHandlingEnum.KeepAlways; |
157 | 161 |
}else{ |
158 | 162 |
return null; |
159 | 163 |
} |
160 |
|
|
161 | 164 |
}else{ |
162 |
|
|
163 |
|
|
164 | 165 |
UUID oldSecUuid = secUuids.iterator().next(); |
165 | 166 |
boolean equalSec = (newTaxonUuid != null && newTaxonUuid.equals(oldSecUuid)) || (newTaxonUuid == null && oldSecUuid == null); |
167 |
//the nodes moved have all the same sec, but the accepted taxon has a different one |
|
166 | 168 |
if ((secUuids.size() > 0 && |
167 | 169 |
((newTaxonUuid != null && oldSecUuid != null && !newTaxonUuid.equals(oldSecUuid)) |
168 | 170 |
|| (newTaxonUuid != null && oldSecUuid == null) ||(newTaxonUuid == null && oldSecUuid != null)) |
Also available in: Unified diff
ref #9340: add comments