Project

General

Profile

Download (1.73 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
 * Copyright (C) 2007 EDIT
3
 * European Distributed Institute of Taxonomy 
4
 * http://www.e-taxonomy.eu
5
 * 
6
 * The contents of this file are subject to the Mozilla Public License Version 1.1
7
 * See LICENSE.TXT at the top of this package for the full license terms.
8
 */
9

    
10
package eu.etaxonomy.taxeditor.editor.view.uses.handler;
11

    
12
import java.util.UUID;
13

    
14
import org.eclipse.core.commands.ExecutionEvent;
15

    
16
import eu.etaxonomy.cdm.api.service.ITermService;
17
import eu.etaxonomy.cdm.model.description.Feature;
18
import eu.etaxonomy.cdm.model.description.TaxonDescription;
19
import eu.etaxonomy.cdm.model.taxon.Taxon;
20
import eu.etaxonomy.taxeditor.editor.EditorUtil;
21
import eu.etaxonomy.taxeditor.editor.view.descriptive.handler.CreateDescriptionElementHandler;
22
import eu.etaxonomy.taxeditor.editor.view.uses.operation.CreateUseRecordOperation;
23
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
24
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
25
import eu.etaxonomy.taxeditor.store.CdmStore;
26

    
27
/**
28
 * CreateUseRecordHandler Class
29
 * @author a.theys	
30
 * @created mar 13, 2012
31
 * @version 1.0
32
 */
33
public class CreateUseRecordHandler extends CreateDescriptionElementHandler {
34
	/** {@inheritDoc} */
35
	@Override
36
	protected AbstractPostOperation operationCreationInstance(String label, ExecutionEvent event, Taxon taxon, TaxonDescription description, IPostOperationEnabled postOperationEnabled) {
37
		//Use Record Feature retrieval below
38
		Feature feature = (Feature) CdmStore.getService(ITermService.class).find(UUID.fromString("8125a59d-b4d5-4485-89ea-67306297b599"));
39
		feature.setSupportsCategoricalData(true);
40
		return new CreateUseRecordOperation(label,
41
					EditorUtil.getUndoContext(), taxon,
42
					description, feature, postOperationEnabled);
43
	}
44
	
45
	
46
	
47
}
(2-2/3)