public class BlankTemplateProvider extends Object implements TemplateProvider
TemplateProvider
that provides a templates simply containing empty instances of the corresponding EClass and
its concrete sub classes.Constructor and Description |
---|
BlankTemplateProvider()
Creates a new
BlankTemplateProvider instance. |
Modifier and Type | Method and Description |
---|---|
boolean |
canProvideTemplates(org.eclipse.emf.ecore.EObject owner,
org.eclipse.emf.ecore.EReference reference)
Queries whether the provider can provide templates that may be assigned
to the given
reference of the given owner object. |
protected Template |
createTemplate(org.eclipse.emf.ecore.EClass type,
org.eclipse.emf.ecore.EObject instance)
Creates a blank template for the given type.
|
protected String |
getDisplayName(org.eclipse.emf.ecore.EClass type)
Fetch the display name for the given
EClass . |
Set<Template> |
provideTemplates(org.eclipse.emf.ecore.EObject owner,
org.eclipse.emf.ecore.EReference reference)
Obtains templates wrapping objects that can be assigned to the given
reference of the given owner object. |
Set<Template> |
provideTemplates(org.eclipse.emf.ecore.EObject owner,
org.eclipse.emf.ecore.EReference reference,
EClassSelectionStrategy eClassSelectionStrategy)
The actual method which creates the templates.
|
protected void |
setBundleResolver(BundleResolver bundleResolver)
Set the
BundleResolver . |
public BlankTemplateProvider()
BlankTemplateProvider
instance.public boolean canProvideTemplates(org.eclipse.emf.ecore.EObject owner, org.eclipse.emf.ecore.EReference reference)
TemplateProvider
reference
of the given owner
object.canProvideTemplates
in interface TemplateProvider
owner
- the object owning a reference
to be assigned from a templatereference
- a reference feature of the owner
that is to be assigned from a template.
If the reference
is a containment
then
the owner
would be the container
of the templatepublic Set<Template> provideTemplates(org.eclipse.emf.ecore.EObject owner, org.eclipse.emf.ecore.EReference reference)
TemplateProvider
reference
of the given owner
object. This will only
be called for an owner
and reference
for which the
receiver previously answered true
to an invocation of the
TemplateProvider.canProvideTemplates(EObject, EReference)
query.provideTemplates
in interface TemplateProvider
owner
- the object owning a reference
to be assigned from a templatereference
- a reference feature of the owner
that is to be assigned from a template.
If the reference
is a containment
then
the owner
would be the container
of the templatenull
)public Set<Template> provideTemplates(org.eclipse.emf.ecore.EObject owner, org.eclipse.emf.ecore.EReference reference, EClassSelectionStrategy eClassSelectionStrategy)
EClassSelectionStrategy
to
filter possible templates.owner
- The EObject
to which the templates should be addedreference
- The EReference
to which the templates should be addedeClassSelectionStrategy
- The EClassSelectionStrategy
to use for filteringTemplateProvider
protected Template createTemplate(org.eclipse.emf.ecore.EClass type, org.eclipse.emf.ecore.EObject instance)
type
- the type of the instance
to wrap in a templateinstance
- the instance of the template type
Template
protected void setBundleResolver(BundleResolver bundleResolver)
BundleResolver
.bundleResolver
- The BundleResolver
protected String getDisplayName(org.eclipse.emf.ecore.EClass type)
EClass
.type
- the EClass
to get the display name forCopyright © 2019. All rights reserved.