Class TemplateCreateNewModelElementStrategyProvider

    • Constructor Detail

      • TemplateCreateNewModelElementStrategyProvider

        public TemplateCreateNewModelElementStrategyProvider()
    • Method Detail

      • addEClassSelectionStrategyProvider

        public void addEClassSelectionStrategyProvider​(EClassSelectionStrategy.Provider provider)
        Add an EClass selection strategy provider.
        Parameters:
        provider - the provider to add
      • addFilterServiceProvider

        public void addFilterServiceProvider​(TemplateFilterService.Provider provider)
        Add a template filter service provider.
        Parameters:
        provider - the provider to add
        Since:
        1.21
      • handles

        protected boolean handles​(org.eclipse.emf.ecore.EObject owner,
                                  org.eclipse.emf.ecore.EReference reference)
        Description copied from class: ReferenceServiceCustomizationVendor
        Queries whether I should bid on the given owner and reference. The default implementation just returns true; subclasses should override.
        Overrides:
        handles in class ReferenceServiceCustomizationVendor<CreateNewModelElementStrategy>
        Parameters:
        owner - the owner of a reference being edited by the Reference Service
        reference - the reference being edited
        Returns:
        whether I should bid
      • collectAvailableTemplates

        protected java.util.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.
        Parameters:
        eObject - the parent EObject
        eReference - the EReference to find templates for
        Returns:
        list of available templates
      • getFilter

        protected java.util.function.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.
        Parameters:
        owner - the EObject in the model
        reference - the EReference in which templates are to be instantiated
        Returns:
        the filter, or null if none
        Since:
        1.21