--- /dev/null
+/**
+ * Copyright (C) 2011 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+
+package eu.etaxonomy.taxeditor.editor.view.uses.e4.handler;
+
+import javax.inject.Named;
+
+import org.eclipse.e4.core.di.annotations.CanExecute;
+import org.eclipse.e4.ui.services.IServiceConstants;
+
+import eu.etaxonomy.cdm.model.description.DescriptionBase;
+import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
+import eu.etaxonomy.cdm.model.description.Feature;
+import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.view.descriptive.e4.handler.CreateDescriptionElementHandlerE4;
+import eu.etaxonomy.taxeditor.editor.view.uses.operation.CreateUseRecordOperation;
+import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
+import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
+import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.store.UseObjectStore;
+
+/**
+ *
+ * @author pplitzner
+ * @since Sep 8, 2017
+ *
+ */
+public class CreateUseRecordHandlerE4 extends CreateDescriptionElementHandlerE4 {
+ /** {@inheritDoc} */
+ @Override
+ protected AbstractPostOperation operationCreationInstance(String label, Feature feature, DescriptionBase<?> description, IPostOperationEnabled postOperationEnabled) {
+ //Use Record Feature retrieval below
+ Feature useRecordFeature = UseObjectStore.getUseRecordFeature();
+ useRecordFeature.setSupportsCategoricalData(true);
+ return new CreateUseRecordOperation(label,
+ EditorUtil.getUndoContext(),
+ description, useRecordFeature, postOperationEnabled);
+ }
+
+
+ @CanExecute
+ public boolean canExecute(@Named(IServiceConstants.ACTIVE_SELECTION)Object selection){
+ return selection instanceof DescriptionBase
+ || selection instanceof DescriptionElementBase
+ || selection instanceof FeatureNodeContainer;
+ }
+
+}