fd717832fd69a59801600f24b5fa3368c16825f2
[taxeditor.git] / eu.etaxonomy.taxeditor.editor / src / main / java / eu / etaxonomy / taxeditor / editor / view / uses / handler / CreateUseSummaryHandler.java
1 /**
2 * Copyright (C) 2011 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 org.eclipse.core.commands.ExecutionEvent;
13
14 import eu.etaxonomy.cdm.api.service.ITermService;
15 import eu.etaxonomy.cdm.model.description.DescriptionBase;
16 import eu.etaxonomy.cdm.model.description.Feature;
17 import eu.etaxonomy.taxeditor.editor.EditorUtil;
18 import eu.etaxonomy.taxeditor.editor.UsageTermCollection;
19 import eu.etaxonomy.taxeditor.editor.view.descriptive.handler.CreateDescriptionElementHandler;
20 import eu.etaxonomy.taxeditor.editor.view.uses.operation.CreateUseSummaryOperation;
21 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
22 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
23 import eu.etaxonomy.taxeditor.store.CdmStore;
24
25 /**
26 * CreateUseSummaryHandler Class
27 * @author a.theys
28 * @created mar 13, 2012
29 * @version 1.0
30 */
31 public class CreateUseSummaryHandler extends CreateDescriptionElementHandler {
32 /** {@inheritDoc} */
33 @Override
34 protected AbstractPostOperation operationCreationInstance(String label, ExecutionEvent event, DescriptionBase<?> description, IPostOperationEnabled postOperationEnabled) {
35 //Use Record Feature retrieval below
36 Feature feature = (Feature) CdmStore.getService(ITermService.class).find(UsageTermCollection.uuidUseSummaryFeature);
37 feature.setSupportsTextData(true);
38 return new CreateUseSummaryOperation(label, EditorUtil.getUndoContext(), description, feature, postOperationEnabled);
39 }
40
41 }