Package org.eclipse.jdt.core.search

Examples of org.eclipse.jdt.core.search.SearchRequestor


        final IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] {
            searchContext.getJavaProject()
        });
        final SearchPattern pattern = SearchPattern.createPattern("*" + prefix + "*", IJavaSearchConstants.PACKAGE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_PATTERN_MATCH);
        final SearchRequestor requestor = new SearchRequestor() {
            @Override
            public void acceptSearchMatch(SearchMatch match) throws CoreException {
                IPackageFragment pkg = (IPackageFragment) match.getElement();
                // Reject the default package and any package starting with
                // "java." since these cannot be imported
View Full Code Here


            SearchPattern pattern = SearchPattern.createPattern(type, IJavaSearchConstants.CLASS, IJavaSearchConstants.IMPLEMENTORS, SearchPattern.R_EXACT_MATCH | SearchPattern.R_CASE_SENSITIVE);

            final List<String> typesFound = new ArrayList<String>();

            SearchRequestor requestor = new SearchRequestor() {
                @Override
                public void acceptSearchMatch(SearchMatch match) throws CoreException {
                    IJavaElement enclosingElement = (IJavaElement) match.getElement();
                    if (!testCaseList.contains(enclosingElement)) {
                        typesFound.add(getClassName(enclosingElement));
View Full Code Here

        this.runContext = runContext;
    }

    public String[] getPackages(boolean includeNonSource, IPackageFilter filter) throws PackageListException {
        final List<IJavaElement> packageList = new LinkedList<IJavaElement>();
        final SearchRequestor requestor = new SearchRequestor() {
            @Override
            public void acceptSearchMatch(SearchMatch match) throws CoreException {
                IJavaElement enclosingElement = (IJavaElement) match.getElement();
                String name = enclosingElement.getElementName();
                if (name.length() > 0) { // Do not include default pkg
View Full Code Here

            throw new NullPointerException("No pattern!?");
        }
       
        final List<SearchMatch> matches = new ArrayList<SearchMatch>();
       
        SearchRequestor requestor = new SearchRequestor() {
            @Override public void acceptSearchMatch(SearchMatch match) {
                matches.add(match);
            }
        };
       
View Full Code Here

        if (pattern == null) {
            // E.g. element not found / no longer exists
            throw new NullPointerException("No pattern!?");
        }
       
        SearchRequestor requestor = new SearchRequestor() {
            @Override public void acceptSearchMatch(SearchMatch match) {
                references.add(match);
            }
        };
       
View Full Code Here

        if (pattern == null) {
            // E.g. element not found / no longer exists
            throw new NullPointerException("No pattern!?");
        }
       
        SearchRequestor requestor = new SearchRequestor() {
            @Override public void acceptSearchMatch(SearchMatch match) {
                references.add(match);
            }
        };
       
View Full Code Here

        if (pattern == null) {
            // E.g. element not found / no longer exists
            throw new NullPointerException("No pattern!?");
        }
       
        SearchRequestor requestor = new SearchRequestor() {
            @Override public void acceptSearchMatch(SearchMatch match) {
                references.add(match);
            }
        };
       
View Full Code Here

    try {
      String className=storyLine.asClassName();
      final List types = new ArrayList();
        SearchPattern pattern = SearchPattern.createPattern(className, IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_EXACT_MATCH);
        IJavaSearchScope scope = SearchEngine.createWorkspaceScope();
        SearchRequestor requestor = new SearchRequestor(){
        public void acceptSearchMatch(SearchMatch match) throws CoreException {
          types.add(match.getElement());
        }
        };
View Full Code Here

      return;
    }
    SearchPattern pattern = SearchPattern.createPattern(string, IJavaSearchConstants.FIELD, IJavaSearchConstants.ALL_OCCURRENCES,
        SearchPattern.R_EXACT_MATCH);

    SearchRequestor requestor = new SearchRequestor() {
      @Override
      public void acceptSearchMatch(final SearchMatch match) {
        IAnnotationModel model = textEditor.getDocumentProvider().getAnnotationModel(textEditor.getEditorInput());
        Annotation annotation = new Annotation("org.eclipse.jdt.ui.occurrences", false, "wicket id constant");
        model.addAnnotation(annotation, new Position(match.getOffset(), match.getLength()));
View Full Code Here

    IType sc = getSuperClass(jp);
    if (sc != null)
      elems.add(sc);
     
    if (elems.size() > 0){       
      SearchRequestor requestor = new Searcher();
      SearchEngine engine = new SearchEngine();
     
      IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[]{jp});//, IJavaSearchScope.SOURCES | IJavaSearchScope.APPLICATION_LIBRARIES | IJavaSearchScope.);
      SearchPattern combined = SearchPattern.createPattern((IJavaElement)elems.get(0), IJavaSearchConstants.IMPLEMENTORS, 0);
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.search.SearchRequestor

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.