Interface IEcoreModelQuery<P extends org.eclipse.emf.ecore.EObject,​R>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      org.eclipse.emf.ecore.EObject getEcoreElement​(CommonXtextEditor<?,​P> editor, R elementDescription)
      Returns the EObject of the parse tree of the given editor's resource that matches the element described by the given ModelElementDescription.
      java.lang.String getName​(P project)
      Returns the name of the project.
      P getProject​(org.eclipse.xtext.nodemodel.ICompositeNode rootNode)
      Returns the "project" of the Ecore-model represented by the given root node.
      org.eclipse.xtext.nodemodel.ICompositeNode getRootNode​(org.eclipse.xtext.resource.XtextResource resource)
      Returns the ICompositeNode of the Ecore-model that represent the root node.
    • Method Detail

      • getName

        java.lang.String getName​(P project)
        Returns the name of the project.
        Parameters:
        project - the project
        Returns:
        the name of project
      • getRootNode

        org.eclipse.xtext.nodemodel.ICompositeNode getRootNode​(org.eclipse.xtext.resource.XtextResource resource)
        Returns the ICompositeNode of the Ecore-model that represent the root node.
        Parameters:
        resource - the XtextResource from which the root node should be retrieved
        Returns:
        the ICompositeNode of the Ecore-model that represent the root node. May return null if the given resource is null or cannot be parsed
      • getProject

        P getProject​(org.eclipse.xtext.nodemodel.ICompositeNode rootNode)
        Returns the "project" of the Ecore-model represented by the given root node.
        Parameters:
        rootNode - the ICompositeNode which is the root of the Ecore-model from which the "project" should be retrieved
        Returns:
        the "project" in the given resource. May return null if the given root node is null, or there is no "project" in that file
      • getEcoreElement

        org.eclipse.emf.ecore.EObject getEcoreElement​(CommonXtextEditor<?,​P> editor,
                                                      R elementDescription)
        Returns the EObject of the parse tree of the given editor's resource that matches the element described by the given ModelElementDescription. The search for this object will be performed in the Ecore-model of the given editor's resource only. This requires that it is ensured that the given editor displays a file which includes the desired element.
        Parameters:
        editor - the XtextEditor which displays the file in which the desired element should be found
        elementDescription - the ModelElementDescription that describes the model element that should be found in the parse tree of the given editor's resource
        Returns:
        the EObject that matches the element described by the given ModelElementDescription. May return null if the element could not be found