Revision 03c03694
Added by Katja Luther over 5 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/MoveDescriptionElementsHandlerE4.java | ||
---|---|---|
66 | 66 |
*/ |
67 | 67 |
public class MoveDescriptionElementsHandlerE4 implements IPostOperationEnabled{ |
68 | 68 |
private UUID newAcceptedTaxonNodeUuid; |
69 |
private UUID oldAcceptedTaxonNodeUuid; |
|
69 | 70 |
private TaxonNameEditorE4 editor; |
70 | 71 |
private MApplication application; |
71 | 72 |
private EModelService modelService; |
... | ... | |
133 | 134 |
if (actualTaxon != null){ |
134 | 135 |
if (!actualTaxon.getTaxonNodes().isEmpty() && actualTaxon.getTaxonNodes().size() ==1){ |
135 | 136 |
actualNode = actualTaxon.getTaxonNodes().iterator().next(); |
136 |
excludeTaxa.add(actualNode.getUuid()); |
|
137 |
oldAcceptedTaxonNodeUuid = actualNode.getUuid(); |
|
138 |
excludeTaxa.add(oldAcceptedTaxonNodeUuid); |
|
137 | 139 |
classification = actualNode.getClassification(); |
138 | 140 |
|
139 | 141 |
} |
... | ... | |
181 | 183 |
// AbstractUtility.close(possibleOpenEditor); |
182 | 184 |
// } |
183 | 185 |
EditorUtil.openTaxonNodeE4(newAcceptedTaxonNodeUuid, modelService, partService, application); |
186 |
EditorUtil.openTaxonNodeE4(oldAcceptedTaxonNodeUuid, modelService, partService, application); |
|
184 | 187 |
} |
185 | 188 |
|
186 | 189 |
}); |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/MoveDescriptionToOtherTaxonHandlerE4.java | ||
---|---|---|
57 | 57 |
private MoveDescriptionToOtherTaxonOperation operation; |
58 | 58 |
|
59 | 59 |
private UUID newAcceptedTaxonNodeUuid; |
60 |
private UUID oldAcceptedTaxonNodeUuid; |
|
61 |
private UUID newAcceptedTaxonUuid; |
|
62 |
private UUID oldAcceptedTaxonUuid; |
|
60 | 63 |
private TaxonNameEditorE4 editor; |
61 | 64 |
private MApplication application; |
62 | 65 |
private EModelService modelService; |
... | ... | |
100 | 103 |
descriptions.add(description); |
101 | 104 |
|
102 | 105 |
// Choose the target taxon |
103 |
Set<UUID> excludeTaxa = new HashSet<>(); |
|
104 | 106 |
|
105 |
excludeTaxa.add(descriptions.get(0).getTaxon().getUuid()); |
|
106 | 107 |
|
107 | 108 |
//get current taxon node |
108 | 109 |
TaxonNode node = null; |
109 | 110 |
Classification classification = null; |
110 | 111 |
if(editor!=null){ |
111 | 112 |
node = editor.getEditorInput().getTaxonNode(); |
113 |
oldAcceptedTaxonUuid = editor.getTaxon().getUuid(); |
|
114 |
oldAcceptedTaxonNodeUuid = node.getUuid(); |
|
112 | 115 |
classification = node.getClassification(); |
113 | 116 |
} |
117 |
|
|
118 |
Set<UUID> excludeTaxa = new HashSet<>(); |
|
119 |
excludeTaxa.add(oldAcceptedTaxonNodeUuid); |
|
114 | 120 |
TaxonNode newAcceptedTaxonNode = TaxonNodeSelectionDialog.select(shell, |
115 | 121 |
// editor.getConversationHolder(), |
116 | 122 |
Messages.MoveDescriptionToOtherTaxonHandler_CHOOSE_ACC_TAXON, |
... | ... | |
123 | 129 |
} |
124 | 130 |
|
125 | 131 |
newAcceptedTaxonNodeUuid = newAcceptedTaxonNode.getUuid(); |
126 |
|
|
132 |
newAcceptedTaxonUuid = newAcceptedTaxonNode.getTaxon().getUuid(); |
|
127 | 133 |
for(TaxonDescription taxonDescription : descriptions){ |
128 | 134 |
operation = new MoveDescriptionToOtherTaxonOperation(menuItem.getLocalizedLabel(), |
129 | 135 |
editor.getUndoContext(), |
... | ... | |
153 | 159 |
// if(possibleOpenEditor != null){ |
154 | 160 |
// AbstractUtility.close(possibleOpenEditor); |
155 | 161 |
// } |
162 |
// EventUtility.postEvent(WorkbenchEventConstants.REFRESH_NAME_EDITOR, oldAcceptedTaxonNodeUuid); |
|
163 |
// EventUtility.postEvent(WorkbenchEventConstants.REFRESH_NAME_EDITOR, newAcceptedTaxonNodeUuid); |
|
156 | 164 |
EditorUtil.openTaxonNodeE4(newAcceptedTaxonNodeUuid, modelService, partService, application); |
165 |
EditorUtil.openTaxonNodeE4(oldAcceptedTaxonNodeUuid, modelService, partService, application); |
|
157 | 166 |
// } catch (PartInitException e) { |
158 | 167 |
// MessagingUtils.error(this.getClass(), e); |
159 | 168 |
// throw new RuntimeException(e); |
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/RemotingMoveTaxonNodeHandlerE4.java | ||
---|---|---|
66 | 66 |
TaxonNavigatorLabels.NO_TAXON_SELECTION_MESSAGE); |
67 | 67 |
} |
68 | 68 |
// check that selected object is a taxon node |
69 |
|
|
69 | 70 |
Object obj ; |
70 | 71 |
Iterator iter = selection.iterator(); |
71 | 72 |
oldTaxonNodeUUIDs = new HashSet<>(); |
Also available in: Unified diff
ref #3535: update both name editors after moving description oder description elements