Revision 324d38f7
Added by Alex Theys about 12 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/handler/CreateUseRecordHandler.java | ||
---|---|---|
1 | 1 |
package eu.etaxonomy.taxeditor.editor.view.uses.handler; |
2 | 2 |
|
3 |
import java.util.List; |
|
4 |
import java.util.Set; |
|
3 |
|
|
5 | 4 |
import java.util.UUID; |
6 | 5 |
|
7 | 6 |
import org.eclipse.core.commands.AbstractHandler; |
... | ... | |
12 | 11 |
import org.eclipse.jface.viewers.IStructuredSelection; |
13 | 12 |
import org.eclipse.jface.viewers.ITreeSelection; |
14 | 13 |
import org.eclipse.jface.viewers.TreePath; |
15 |
import org.eclipse.swt.widgets.Event; |
|
16 | 14 |
import org.eclipse.ui.IEditorInput; |
17 | 15 |
import org.eclipse.ui.IEditorPart; |
18 | 16 |
import org.eclipse.ui.IWorkbenchPart; |
... | ... | |
20 | 18 |
import org.eclipse.ui.handlers.HandlerUtil; |
21 | 19 |
|
22 | 20 |
import eu.etaxonomy.cdm.api.service.ITermService; |
23 |
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper; |
|
24 |
import eu.etaxonomy.cdm.model.description.CategoricalData; |
|
25 |
import eu.etaxonomy.cdm.model.description.DescriptionElementBase; |
|
26 | 21 |
import eu.etaxonomy.cdm.model.description.Feature; |
27 | 22 |
import eu.etaxonomy.cdm.model.description.TaxonDescription; |
28 |
import eu.etaxonomy.cdm.model.description.TextData; |
|
29 | 23 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
30 | 24 |
import eu.etaxonomy.taxeditor.editor.EditorUtil; |
31 | 25 |
import eu.etaxonomy.taxeditor.editor.TaxonEditorInput; |
... | ... | |
34 | 28 |
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled; |
35 | 29 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
36 | 30 |
|
31 |
/** |
|
32 |
* The context manager mediates context start/stop and workbench shutdowns to all registered listeners. |
|
33 |
* |
|
34 |
* @author a.theys |
|
35 |
* @created mar 13, 2012 |
|
36 |
* @version 1.0 |
|
37 |
*/ |
|
37 | 38 |
public class CreateUseRecordHandler extends AbstractHandler { |
38 | 39 |
public Object execute(ExecutionEvent event) throws ExecutionException { |
39 | 40 |
IWorkbenchPart part = HandlerUtil.getActivePart(event); |
... | ... | |
69 | 70 |
AbstractPostOperation operation = null; |
70 | 71 |
try { |
71 | 72 |
//Use Record Feature retrieval below |
72 |
//Feature feature = (Feature) CdmStore.getService(ITermService.class).find(UUID.fromString("8125a59d-b4d5-4485-89ea-67306297b599")); |
|
73 |
//Feature feature = (Feature) CdmStore.getService(ITermService.class).find(UUID.fromString("247606f2-5f24-421f-92ca-dad2351b171e")); |
|
73 |
Feature feature = (Feature) CdmStore.getService(ITermService.class).find(UUID.fromString("8125a59d-b4d5-4485-89ea-67306297b599")); |
|
74 | 74 |
//The code below retrieves the feature "Uses" as a work around |
75 |
Feature feature = (Feature) CdmStore.getService(ITermService.class).find(UUID.fromString("e5374d39-b210-47c7-bec1-bee05b5f1cb6")); |
|
75 |
//Feature feature = (Feature) CdmStore.getService(ITermService.class).find(UUID.fromString("e5374d39-b210-47c7-bec1-bee05b5f1cb6"));
|
|
76 | 76 |
feature.setSupportsCategoricalData(true); |
77 | 77 |
operation = new CreateUseRecordOperation(event |
78 | 78 |
.getCommand().getName(), |
Also available in: Unified diff
AT: committing latest changes to the Tax Editor after a first round of Code review