org.eclipse.xtend.shared.ui.core.search
Class XtendXpandSearchEngine

java.lang.Object
  extended by org.eclipse.xtend.shared.ui.core.search.XtendXpandSearchEngine

public class XtendXpandSearchEngine
extends java.lang.Object

Search engine for Xtend.

Author:
Sven Efftinge (http://www.efftinge.de), Peter Friese, Darius Jockel

Nested Class Summary
 class XtendXpandSearchEngine.ExpressionVisitor
           
 
Constructor Summary
XtendXpandSearchEngine()
           
 
Method Summary
static java.util.List<Definition> findAllDefines(IXtendXpandProject project)
           
static java.util.List<SearchMatch> findAllOccurrences(IXtendXpandProject project, java.lang.String identifier)
           
static java.util.List<SearchMatch> findDeclarations(IXtendXpandProject project, java.lang.String identifier)
          Find all extension declarations for the given identifier.
static ExpandStatement findDefinition(java.lang.String name, org.eclipse.jface.text.IRegion region, Template template)
          Search a template for a ExpandStatement inside given region.
static java.util.List<AbstractDefinition> findDefinitionsByNameInResourceAndImports(IXtendXpandProject project, java.lang.String identifier, XpandResource resource)
          Find all reachable Xpand declarations by name in given template resource or imported templates.
static OperationCall findExpressionInExtensionFile(org.eclipse.jface.text.IRegion region, ExtensionFile extensionFile, java.lang.String name)
          Search a ExtensionFile for a OperationCall inside region.
static OperationCall findExpressionInTemplate(java.lang.String name, Template template)
          Search a template for a Expression inside region.
static java.util.List<Extension> findExtensionsByNameInResourceAndImports(IXtendXpandProject project, java.lang.String identifier, IXtendXpandResource resource)
          Find all reachable Extensions declarations with name identifier in given resource.
static java.util.List<SearchMatch> findReferences(IXtendXpandProject project, java.lang.String identifier)
          Find all operation invocations for the given identifier.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XtendXpandSearchEngine

public XtendXpandSearchEngine()
Method Detail

findAllDefines

public static java.util.List<Definition> findAllDefines(IXtendXpandProject project)

findAllOccurrences

public static java.util.List<SearchMatch> findAllOccurrences(IXtendXpandProject project,
                                                             java.lang.String identifier)

findReferences

public static java.util.List<SearchMatch> findReferences(IXtendXpandProject project,
                                                         java.lang.String identifier)
Find all operation invocations for the given identifier. Ignores parameters and types as well as resource references (i.e. imports)


findDeclarations

public static java.util.List<SearchMatch> findDeclarations(IXtendXpandProject project,
                                                           java.lang.String identifier)
Find all extension declarations for the given identifier. Ignores parameters and types as well as resource references (i.e. imports)


findDefinitionsByNameInResourceAndImports

public static java.util.List<AbstractDefinition> findDefinitionsByNameInResourceAndImports(IXtendXpandProject project,
                                                                                           java.lang.String identifier,
                                                                                           XpandResource resource)
Find all reachable Xpand declarations by name in given template resource or imported templates. Type or parameters are ignored.


findExtensionsByNameInResourceAndImports

public static java.util.List<Extension> findExtensionsByNameInResourceAndImports(IXtendXpandProject project,
                                                                                 java.lang.String identifier,
                                                                                 IXtendXpandResource resource)
Find all reachable Extensions declarations with name identifier in given resource.

Returns:
A list of extensions imported by the IXtendXpandResource resource with given name identifier

findExpressionInTemplate

public static OperationCall findExpressionInTemplate(java.lang.String name,
                                                     Template template)
Search a template for a Expression inside region.

Parameters:
hyperlinkRegion - The region inside the template to search for
template - the template to search inside
Returns:
Iff found, the Expression, else null
Since:
2.0

findExpressionInExtensionFile

public static OperationCall findExpressionInExtensionFile(org.eclipse.jface.text.IRegion region,
                                                          ExtensionFile extensionFile,
                                                          java.lang.String name)
Search a ExtensionFile for a OperationCall inside region.

Parameters:
hyperlinkRegion - The region inside the template to search for
extensionFile - the ExtensionFile to search inside
Returns:
Iff found, the OperationCall, else null
Since:
2.0

findDefinition

public static ExpandStatement findDefinition(java.lang.String name,
                                             org.eclipse.jface.text.IRegion region,
                                             Template template)
Search a template for a ExpandStatement inside given region.

Parameters:
region - The region inside the template to search for
template - The template to search inside
Returns:
Iff found, the ExpandStatement, else null