Package org.eclipse.jdt.core.search

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


        final TreeSet<PkgPatternProposal> result = new TreeSet<PkgPatternProposal>(comparator);

        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
View Full Code Here


            }
        }

        private List<String> search(String type, final List<IJavaElement> testCaseList, IProgressMonitor monitor) throws TestCaseListException {

            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
View Full Code Here

                if (name.length() > 0) { // Do not include default pkg
                    packageList.add(enclosingElement);
                }
            }
        };
        final SearchPattern pattern = SearchPattern.createPattern("*", IJavaSearchConstants.PACKAGE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_PATTERN_MATCH | SearchPattern.R_CASE_SENSITIVE);

        IRunnableWithProgress operation = new IRunnableWithProgress() {
            public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
                try {
                    new SearchEngine().search(pattern, SearchUtils.getDefaultSearchParticipants(), scope, requestor, monitor);
View Full Code Here

import org.eclipse.jdt.core.search.SearchRequestor;

public class SearchHelper {

    public IType findTypeByName(String name) throws CoreException {
        SearchPattern pattern = SearchPattern.createPattern(name, IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_EXACT_MATCH);
        if (pattern == null) {
            throw new NullPointerException("No pattern!?");
        }
       
        final List<SearchMatch> matches = new ArrayList<SearchMatch>();
View Full Code Here

    }
   
    public SearchMatch[] findSubClassesOf(IType type) throws CoreException {
        final List<SearchMatch> references = new ArrayList<SearchMatch>();
       
        SearchPattern pattern = SearchPattern.createPattern(type, IJavaSearchConstants.SUPERTYPE_TYPE_REFERENCE);
        if (pattern == null) {
            // E.g. element not found / no longer exists
            throw new NullPointerException("No pattern!?");
        }
       
View Full Code Here

    }
   
    public SearchMatch[] findReferencesTo(IJavaElement element, IJavaElement withinType) throws CoreException {
        final List<SearchMatch> references = new ArrayList<SearchMatch>();
       
        SearchPattern pattern = SearchPattern.createPattern(element, IJavaSearchConstants.REFERENCES);
        if (pattern == null) {
            // E.g. element not found / no longer exists
            throw new NullPointerException("No pattern!?");
        }
       
View Full Code Here

    }
   
    public SearchMatch[] findMethodReferences(String methodName, IJavaElement withinType) throws CoreException {
        final List<SearchMatch> references = new ArrayList<SearchMatch>();
       
        SearchPattern pattern = SearchPattern.createPattern(methodName,
                                                            IJavaSearchConstants.ALL_OCCURRENCES,
                                                            IJavaSearchConstants.REFERENCES,
                                                            SearchPattern.R_FULL_MATCH);
        if (pattern == null) {
            // E.g. element not found / no longer exists
View Full Code Here

  private void findAndOpenClass(StoryLine storyLine) {
    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

   */
  public static void markOccurrence(final ITextEditor textEditor, final String string) {
    if (string == null) {
      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) {
View Full Code Here

    SearchEngine eng = new SearchEngine();
    EmbeddedFieldsSearchRequestor efcr = new EmbeddedFieldsSearchRequestor();
    efcr.setTypeAnnotationSet(Arrays.asList(typeAnnotations));
    efcr.setFieldsAnnotationSet(fieldAnnotations);
    efcr.setEncType(encType);
    SearchPattern patternFirst = SearchPattern.createPattern(".*"
        + typename, IJavaSearchConstants.CLASS,
        IJavaSearchConstants.DECLARATIONS,
        SearchPattern.R_PATTERN_MATCH);

    try {
View Full Code Here

TOP

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

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.