Revision cedc4ff1
Added by Katja Luther about 6 years ago
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/CopyOperation.java | ||
---|---|---|
1 | 1 |
/** |
2 | 2 |
* Copyright (C) 2009 EDIT |
3 |
* European Distributed Institute of Taxonomy
|
|
3 |
* European Distributed Institute of Taxonomy |
|
4 | 4 |
* http://www.e-taxonomy.eu |
5 |
*
|
|
5 |
* |
|
6 | 6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
7 | 7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
8 | 8 |
*/ |
... | ... | |
17 | 17 |
import org.eclipse.swt.dnd.TextTransfer; |
18 | 18 |
import org.eclipse.swt.dnd.Transfer; |
19 | 19 |
|
20 |
import eu.etaxonomy.cdm.model.taxon.TaxonNode; |
|
20 |
import eu.etaxonomy.cdm.api.service.ITaxonNodeService; |
|
21 |
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto; |
|
21 | 22 |
import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation; |
22 | 23 |
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled; |
24 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
|
23 | 25 |
|
24 | 26 |
|
25 | 27 |
/** |
... | ... | |
35 | 37 |
* @param taxon |
36 | 38 |
* @param postOperationEnabled |
37 | 39 |
*/ |
38 |
public CopyOperation(String label, IUndoContext undoContext, TaxonNode taxonNode,
|
|
40 |
public CopyOperation(String label, IUndoContext undoContext, TaxonNodeDto taxonNode,
|
|
39 | 41 |
IPostOperationEnabled postOperationEnabled) { |
40 | 42 |
super(label, undoContext, taxonNode, postOperationEnabled); |
41 | 43 |
} |
... | ... | |
46 | 48 |
@Override |
47 | 49 |
public IStatus execute(IProgressMonitor monitor, IAdaptable info) |
48 | 50 |
throws ExecutionException { |
49 |
|
|
50 |
String name = ((TaxonNode)taxonNode).getTaxon().getName().getTitleCache();
|
|
51 |
|
|
51 |
|
|
52 |
String name = taxonNode.getTitleCache();
|
|
53 |
|
|
52 | 54 |
final Clipboard cb = new Clipboard(null); |
53 | 55 |
TextTransfer textTransfer = TextTransfer.getInstance(); |
54 | 56 |
Transfer[] transfers = new Transfer[]{textTransfer}; |
55 |
|
|
57 |
|
|
56 | 58 |
cb.setContents(new Object[]{name}, transfers); |
57 |
|
|
58 |
return postExecute(((TaxonNode)taxonNode));
|
|
59 |
|
|
60 |
return postExecute(CdmStore.getService(ITaxonNodeService.class).find(taxonNode.getUuid()));
|
|
59 | 61 |
//return null; |
60 | 62 |
} |
61 | 63 |
|
Also available in: Unified diff
ref #2380: implement usage of Dto for taxon navigator