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. |
void |
addFilterServiceProvider(TemplateFilterService.Provider provider)
Add a template filter service 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 Predicate<? super Template> |
getFilter(org.eclipse.emf.ecore.EObject owner,
org.eclipse.emf.ecore.EReference reference)
Obtain a filter predicate for the templates provided for the given
reference
of an owner object in the editor. |
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 addpublic void addFilterServiceProvider(TemplateFilterService.Provider 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
protected Predicate<? super Template> getFilter(org.eclipse.emf.ecore.EObject owner, org.eclipse.emf.ecore.EReference reference)
reference
of an owner
object in the editor.owner
- the EObject
in the modelreference
- the EReference
in which templates are to be instantiatednull
if noneCopyright © 2019. All rights reserved.