Package org.eclipse.dltk.core.index2.IIndexingRequestor

Examples of org.eclipse.dltk.core.index2.IIndexingRequestor.DeclarationInfo


    * @param project
    * @return
    */
    public List<Bundle> findBundles(IScriptProject project) {
        IDLTKSearchScope scope = SearchEngine.createSearchScope(project.getScriptProject());
        ISearchEngine engine = ModelAccess.getSearchEngine(PHPLanguageToolkit.getDefault());
        final List<Bundle> bundles = new ArrayList<Bundle>();
        if (scope == null || engine == null) {
            return bundles;
        }

        engine.search(ISymfonyModelElement.BUNDLE, null, null, 0, 0, 100, SearchFor.REFERENCES, MatchRule.PREFIX, scope, new ISearchRequestor() {
            @Override
            public void match(int elementType, int flags, int offset, int length,
                    int nameOffset, int nameLength, String elementName,
                    String metadata, String doc, String qualifier, String parent,
                    ISourceModule sourceModule, boolean isReference) {
View Full Code Here


    * @param project
    * @return
    */
    public boolean hasViewMethod(final String method, IScriptProject project) {
        IDLTKSearchScope scope = SearchEngine.createSearchScope(project);
        ISearchEngine engine = getSearchEngine(PHPLanguageToolkit.getDefault());
        if (scope == null || engine == null) {
            return false;
        }

        final List<String> methods = new ArrayList<String>();
        engine.search(ISymfonyModelElement.VIEW_METHOD, null, method, 0, 0, 10, SearchFor.REFERENCES, MatchRule.EXACT, scope, new ISearchRequestor() {

            @Override
            public void match(int elementType, int flags, int offset, int length,
                    int nameOffset, int nameLength, String elementName,
                    String metadata, String doc, String qualifier, String parent,
View Full Code Here

    }

    public boolean hasRouteMethod(String method, IScriptProject project) {
        IDLTKSearchScope scope = SearchEngine.createSearchScope(project);
        ISearchEngine engine = getSearchEngine(PHPLanguageToolkit.getDefault());
        if (scope == null || engine == null) {
            return false;
        }

        final List<String> methods = new ArrayList<String>();
        engine.search(ISymfonyModelElement.ROUTE_METHOD, null, method, 0, 0, 10, SearchFor.REFERENCES, MatchRule.EXACT, scope, new ISearchRequestor() {
            @Override
            public void match(int elementType, int flags, int offset, int length,
                    int nameOffset, int nameLength, String elementName,
                    String metadata, String doc, String qualifier, String parent,
                    ISourceModule sourceModule, boolean isReference) {
View Full Code Here

    }

    public String findNameSpace(IScriptProject iScriptProject, final IPath path) {
        IDLTKSearchScope scope = SearchEngine.createSearchScope(iScriptProject);
        ISearchEngine engine = ModelAccess.getSearchEngine(PHPLanguageToolkit.getDefault());
        if (scope == null || engine == null) {
            return null;
        }

        final List<String> namespaces = new ArrayList<String>();
        engine.search(ISymfonyModelElement.NAMESPACE, null, null, 0, 0, 100, SearchFor.REFERENCES, MatchRule.PREFIX, scope, new ISearchRequestor() {
            @Override
            public void match(int elementType, int flags, int offset, int length,
                    int nameOffset, int nameLength, String elementName,
                    String metadata, String doc, String qualifier, String parent,
                    ISourceModule sourceModule, boolean isReference) {
View Full Code Here

    }


    public List<String> getNameSpaces(IScriptProject project) {
        IDLTKSearchScope scope = SearchEngine.createSearchScope(project);
        ISearchEngine engine = ModelAccess.getSearchEngine(PHPLanguageToolkit.getDefault());
        final List<String> namespaces = new ArrayList<String>();
        if (scope == null || engine == null) {
            return namespaces;
        }

        engine.search(ISymfonyModelElement.NAMESPACE, null, null, 0, 0, 100, SearchFor.REFERENCES, MatchRule.PREFIX, scope, new ISearchRequestor() {
            @Override
            public void match(int elementType, int flags, int offset, int length,
                    int nameOffset, int nameLength, String elementName,
                    String metadata, String doc, String qualifier, String parent,
                    ISourceModule sourceModule, boolean isReference) {
View Full Code Here

        if (bundleCache.get(key) != null) {
            return bundleCache.get(key) == NULL_ENTRY ? null :(Bundle) bundleCache.get(key);
        }

        IDLTKSearchScope scope = SearchEngine.createSearchScope(scriptProject);
        ISearchEngine engine = ModelAccess.getSearchEngine(PHPLanguageToolkit.getDefault());
        if (scope == null || engine == null) {
            return null;
        }

        final List<Bundle> bundles = new ArrayList<Bundle>();
        engine.search(ISymfonyModelElement.BUNDLE, null, bundleAlias, 0, 0, 100, SearchFor.REFERENCES, MatchRule.EXACT, scope, new ISearchRequestor() {
            @Override
            public void match(int elementType, int flags, int offset, int length,
                    int nameOffset, int nameLength, String elementName,
                    String metadata, String doc, String qualifier, String parent,
                    ISourceModule sourceModule, boolean isReference) {
View Full Code Here

    * @param sourceModule
    */
    public List<TemplateField> findTemplateVariables(ISourceModule sourceModule, String varName) {
        String viewPath = PathUtils.createViewPathFromTemplate(sourceModule, false);
        IDLTKSearchScope scope = SearchEngine.createSearchScope(sourceModule.getScriptProject());
        ISearchEngine engine = ModelAccess.getSearchEngine(SymfonyLanguageToolkit.getDefault());
        if (scope == null || engine == null) {
            return null;
        }

        final List<TemplateField> variables = new ArrayList<TemplateField>();
        final IElementResolver resolver = ModelAccess.getElementResolver(SymfonyLanguageToolkit.getDefault());

        // handle twig variables
        if (!varName.startsWith("$")) {
            varName = "$" + varName;
        }

        engine.search(ISymfonyModelElement.TEMPLATE_VARIABLE, viewPath, varName, 0, 0, 100, SearchFor.REFERENCES, MatchRule.EXACT, scope, new ISearchRequestor() {
            @Override
            public void match(int elementType, int flags, int offset, int length,
                    int nameOffset, int nameLength, String elementName,
                    String metadata, String doc, String qualifier, String parent,
                    ISourceModule sourceModule, boolean isReference) {
View Full Code Here

  public List<AppKernel> getKernels(IScriptProject project) {

    final List<AppKernel> kernels = new ArrayList<AppKernel>();

    IDLTKSearchScope scope = SearchEngine.createSearchScope(project);
    ISearchEngine engine = ModelAccess.getSearchEngine(SymfonyLanguageToolkit.getDefault());   

    engine.search(ISymfonyModelElement.ENVIRONMENT, null, null, 0, 0, 100, SearchFor.REFERENCES, MatchRule.PREFIX, scope, new ISearchRequestor() {

      @Override
      public void match(int elementType, int flags, int offset, int length,
          int nameOffset, int nameLength, String elementName,
          String metadata, String doc, String qualifier, String parent,
View Full Code Here

  public AppKernel getKernel(IScriptProject project, String name) {
   
    final List<AppKernel> kernels = new ArrayList<AppKernel>();

    IDLTKSearchScope scope = SearchEngine.createSearchScope(project);
    ISearchEngine engine = ModelAccess.getSearchEngine(SymfonyLanguageToolkit.getDefault());
   
    if (project == null || name == null || scope == null) {
        Logger.log(Logger.WARNING, "unable to retrieve kernel");
        return null;
    }

    engine.search(ISymfonyModelElement.ENVIRONMENT, null, name, 0, 0, 100, SearchFor.REFERENCES, MatchRule.EXACT, scope, new ISearchRequestor() {

      @Override
      public void match(int elementType, int flags, int offset, int length,
          int nameOffset, int nameLength, String elementName,
          String metadata, String doc, String qualifier, String parent,
View Full Code Here

     * @return
     */
    public Function[] getFunctions(IScriptProject scriptProject)
    {
        IDLTKSearchScope scope = SearchEngine.createSearchScope(scriptProject);
        ISearchEngine engine = ModelAccess.getSearchEngine(PHPLanguageToolkit
                .getDefault());

        final JSONParser parser = new JSONParser();
        final List<Function> functions = new ArrayList<Function>();

        engine.search(ITwigModelElement.FUNCTION, null, null, 0, 0, 100,
                SearchFor.REFERENCES, MatchRule.PREFIX, scope,
                new ISearchRequestor()
                {

                    @Override
View Full Code Here

TOP

Related Classes of org.eclipse.dltk.core.index2.IIndexingRequestor.DeclarationInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.