Class BlankTemplateProvider
- java.lang.Object
-
- org.eclipse.emfforms.internal.core.services.datatemplate.BlankTemplateProvider
-
- All Implemented Interfaces:
TemplateProvider
public class BlankTemplateProvider extends java.lang.Object implements TemplateProvider
TemplateProvider
that provides a templates simply containing empty instances of the corresponding EClass and its concrete sub classes.- Author:
- Lucas Koehler
-
-
Constructor Summary
Constructors Constructor Description BlankTemplateProvider()
Creates a newBlankTemplateProvider
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 givenreference
of the givenowner
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 java.lang.String
getDisplayName(org.eclipse.emf.ecore.EClass type)
Fetch the display name for the givenEClass
.java.util.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 givenreference
of the givenowner
object.java.util.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 theBundleResolver
.
-
-
-
Constructor Detail
-
BlankTemplateProvider
public BlankTemplateProvider()
Creates a newBlankTemplateProvider
instance.
-
-
Method Detail
-
canProvideTemplates
public boolean canProvideTemplates(org.eclipse.emf.ecore.EObject owner, org.eclipse.emf.ecore.EReference reference)
Description copied from interface:TemplateProvider
Queries whether the provider can provide templates that may be assigned to the givenreference
of the givenowner
object.- Specified by:
canProvideTemplates
in interfaceTemplateProvider
- Parameters:
owner
- the object owning areference
to be assigned from a templatereference
- a reference feature of theowner
that is to be assigned from a template. If thereference
is acontainment
then theowner
would be thecontainer
of the template- Returns:
- whether I have any templates to offer
-
provideTemplates
public java.util.Set<Template> provideTemplates(org.eclipse.emf.ecore.EObject owner, org.eclipse.emf.ecore.EReference reference)
Description copied from interface:TemplateProvider
Obtains templates wrapping objects that can be assigned to the givenreference
of the givenowner
object. This will only be called for anowner
andreference
for which the receiver previously answeredtrue
to an invocation of theTemplateProvider.canProvideTemplates(EObject, EReference)
query.- Specified by:
provideTemplates
in interfaceTemplateProvider
- Parameters:
owner
- the object owning areference
to be assigned from a templatereference
- a reference feature of theowner
that is to be assigned from a template. If thereference
is acontainment
then theowner
would be thecontainer
of the template- Returns:
- my available templates, or an empty set if none (never
null
)
-
provideTemplates
public java.util.Set<Template> provideTemplates(org.eclipse.emf.ecore.EObject owner, org.eclipse.emf.ecore.EReference reference, EClassSelectionStrategy eClassSelectionStrategy)
The actual method which creates the templates. This Method uses the providedEClassSelectionStrategy
to filter possible templates.- Parameters:
owner
- TheEObject
to which the templates should be addedreference
- TheEReference
to which the templates should be addedeClassSelectionStrategy
- TheEClassSelectionStrategy
to use for filtering- Returns:
- The Set of Templates created by this
TemplateProvider
-
createTemplate
protected Template createTemplate(org.eclipse.emf.ecore.EClass type, org.eclipse.emf.ecore.EObject instance)
Creates a blank template for the given type.- Parameters:
type
- the type of theinstance
to wrap in a templateinstance
- the instance of the templatetype
- Returns:
- The blank
Template
-
setBundleResolver
protected void setBundleResolver(BundleResolver bundleResolver)
Set theBundleResolver
.- Parameters:
bundleResolver
- TheBundleResolver
-
getDisplayName
protected java.lang.String getDisplayName(org.eclipse.emf.ecore.EClass type)
Fetch the display name for the givenEClass
.- Parameters:
type
- theEClass
to get the display name for- Returns:
- the display name
-
-