2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
10 package eu
.etaxonomy
.taxeditor
.editor
.view
.uses
.handler
;
12 import java
.util
.UUID
;
14 import org
.eclipse
.core
.commands
.ExecutionEvent
;
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
.UsageTermCollection
;
22 import eu
.etaxonomy
.taxeditor
.editor
.view
.descriptive
.handler
.CreateDescriptionElementHandler
;
23 import eu
.etaxonomy
.taxeditor
.editor
.view
.uses
.operation
.CreateUseRecordOperation
;
24 import eu
.etaxonomy
.taxeditor
.operation
.AbstractPostOperation
;
25 import eu
.etaxonomy
.taxeditor
.operation
.IPostOperationEnabled
;
26 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
29 * CreateUseRecordHandler Class
31 * @created mar 13, 2012
34 public class CreateUseRecordHandler
extends CreateDescriptionElementHandler
{
37 protected AbstractPostOperation
operationCreationInstance(String label
, ExecutionEvent event
, Taxon taxon
, TaxonDescription description
, IPostOperationEnabled postOperationEnabled
) {
38 //Use Record Feature retrieval below
39 Feature feature
= (Feature
) CdmStore
.getService(ITermService
.class).find(UsageTermCollection
.uuidUseRecordFeature
);
40 feature
.setSupportsCategoricalData(true);
41 return new CreateUseRecordOperation(label
,
42 EditorUtil
.getUndoContext(), taxon
,
43 description
, feature
, postOperationEnabled
);