Examples of SearchPattern


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

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

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

    }
   
    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

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

    }
   
    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

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

    }
   
    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

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

  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

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

   */
  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

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

    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

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

    if (annotationL != null && annotationL.length != 0) {
      asr.setAnnotationsSet((List<String>) Arrays.asList(annotationL));
    } else {
      asr.setAnnotationsSet(new ArrayList());
    }
    SearchPattern patternFirst = SearchPattern.createPattern(".*"
        + typeName, IJavaSearchConstants.CLASS,
        IJavaSearchConstants.DECLARATIONS,
        SearchPattern.R_PATTERN_MATCH);

    try {
View Full Code Here

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

      ArrayList<IJavaElement> elements) throws CoreException {
    SearchEngine eng = new SearchEngine();
    // AppSearchRequestor asr = new AppSearchRequestor();
    SpecialAppEngSeacrhRequestor sAsr = new SpecialAppEngSeacrhRequestor();

    SearchPattern patternFirst = SearchPattern.createPattern("*." + ck,
        IJavaSearchConstants.CLASS, IJavaSearchConstants.DECLARATIONS,
        SearchPattern.R_PATTERN_MATCH);

    eng.search(patternFirst, new SearchParticipant[] { SearchEngine
        .getDefaultSearchParticipant() }, ijss, sAsr,
View Full Code Here

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

      IJavaSearchScope ijss = SearchEngine.createJavaSearchScope(
          elements.toArray(new IJavaElement[elements.size()]),
          IJavaSearchScope.SOURCES);
      AnnotationSearchRequestor asr = new AnnotationSearchRequestor();

      SearchPattern patternFirst = SearchPattern.createPattern(
          "PersistenceCapable", IJavaSearchConstants.ANNOTATION_TYPE,
          IJavaSearchConstants.REFERENCES,
          SearchPattern.R_EXACT_MATCH);

      SearchPattern patternSecond = SearchPattern.createPattern("Entity",
          IJavaSearchConstants.ANNOTATION_TYPE,
          IJavaSearchConstants.REFERENCES,
          SearchPattern.R_EXACT_MATCH);

      engine.search(patternFirst, new SearchParticipant[] { SearchEngine
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.