public class TemplateCreateNewModelElementStrategyProvider extends ReferenceServiceCustomizationVendor<CreateNewModelElementStrategy> implements CreateNewModelElementStrategy.Provider
DefaultReferenceService
that allows creating new model elements based on a template with pre-defined values.Constructor and Description |
---|
TemplateCreateNewModelElementStrategyProvider() |
Modifier and Type | Method and Description |
---|---|
void |
addEClassSelectionStrategyProvider(EClassSelectionStrategy.Provider provider)
Add an
EClass selection strategy provider. |
protected Set<Template> |
collectAvailableTemplates(org.eclipse.emf.ecore.EObject eObject,
org.eclipse.emf.ecore.EReference eReference)
Collect a list of available templates for the given
EReference . |
CreateNewModelElementStrategy |
createCreateNewModelElementStrategy()
Creates the
CreateNewModelElementStrategy . |
protected boolean |
handles(org.eclipse.emf.ecore.EObject owner,
org.eclipse.emf.ecore.EReference reference)
Queries whether I should bid on the given
owner and reference . |
bid
public TemplateCreateNewModelElementStrategyProvider()
public void addEClassSelectionStrategyProvider(EClassSelectionStrategy.Provider provider)
EClass
selection strategy provider.provider
- the provider to addprotected boolean handles(org.eclipse.emf.ecore.EObject owner, org.eclipse.emf.ecore.EReference reference)
ReferenceServiceCustomizationVendor
owner
and reference
.
The default implementation just returns true
; subclasses should override.handles
in class ReferenceServiceCustomizationVendor<CreateNewModelElementStrategy>
owner
- the owner of a reference being edited by the Reference Servicereference
- the reference being editedprotected Set<Template> collectAvailableTemplates(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EReference eReference)
EReference
.eObject
- the parent EObject
eReference
- the EReference
to find templates forpublic CreateNewModelElementStrategy createCreateNewModelElementStrategy()
CreateNewModelElementStrategy
.CreateNewModelElementStrategy
Copyright © 2019. All rights reserved.