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
|
package eu.etaxonomy.taxeditor.editor.view.uses.handler;
|
10
|
|
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.UsageTermCollection;
|
22
|
import eu.etaxonomy.taxeditor.editor.view.descriptive.handler.CreateDescriptionElementHandler;
|
23
|
import eu.etaxonomy.taxeditor.editor.view.uses.operation.CreateUseSummaryOperation;
|
24
|
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
|
25
|
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
|
26
|
import eu.etaxonomy.taxeditor.store.CdmStore;
|
27
|
|
28
|
/**
|
29
|
* CreateUseSummaryHandler Class
|
30
|
* @author a.theys
|
31
|
* @created mar 13, 2012
|
32
|
* @version 1.0
|
33
|
*/
|
34
|
public class CreateUseSummaryHandler extends CreateDescriptionElementHandler {
|
35
|
/** {@inheritDoc} */
|
36
|
@Override
|
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.uuidUseSummaryFeature);
|
40
|
feature.setSupportsTextData(true);
|
41
|
return new CreateUseSummaryOperation(label, EditorUtil.getUndoContext(), taxon, description, feature, postOperationEnabled);
|
42
|
}
|
43
|
|
44
|
}
|