Examples of IJavaSearchScope


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

      else if (isPrimitive(expandedClassName)) {
        // ignore primitives
      }
      else {
        SearchEngine searchEngine = new SearchEngine();
        IJavaSearchScope searchScope = JavaSearchScopeFactory.getInstance().createJavaProjectSearchScope(javaProject, JavaSearchScopeFactory.ALL);
        NullProgressMonitor progressMonitor = new NullProgressMonitor();
        TypeNameCollector typeNameCollector = new TypeNameCollector(javaProject, false);
        searchEngine.searchAllTypeNames(null, SearchPattern.R_EXACT_MATCH, shortClassName.toCharArray(), IJavaSearchConstants.TYPE, IJavaSearchConstants.TYPE, searchScope, typeNameCollector, IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, progressMonitor);
        Set<String> typeNames = typeNameCollector.getTypeNames();
        if (typeNames.size() == 1) {
View Full Code Here

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

  public static void findMatchingElementClassNames(String elementTypeName, int matchType, TypeNameCollector typeNameCollector, IProgressMonitor progressMonitor) throws JavaModelException {
    if (elementTypeName != null) {
      SearchEngine searchEngine = new SearchEngine();
      //IJavaSearchScope searchScope = new WOHierarchyScope(typeNameCollector.getSuperclassType(), typeNameCollector.getProject());
      IJavaSearchScope searchScope = WOHierarchyScope.hierarchyScope(typeNameCollector.getSuperclassType(), typeNameCollector.getProject().getProject());
      int lastDotIndex = elementTypeName.lastIndexOf('.');
      char[] packageName;
      char[] typeName;
      if (lastDotIndex == -1) {
        packageName = null;
View Full Code Here

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

      // dummy query for waiting until the indexes are ready
      if (monitor != null)
        monitor.subTask(Messages.javamodel_configuring_searchengine);
      SearchEngine engine = new SearchEngine();
      IJavaSearchScope scope = SearchEngine.createWorkspaceScope();
      try {
        engine.searchAllTypeNames(
          null,
          SearchPattern.R_EXACT_MATCH,
          "!@$#!@".toCharArray(), //$NON-NLS-1$
View Full Code Here

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

  private Set evaluateStarImportConflicts(IProgressMonitor monitor) throws JavaModelException {
    //long start= System.currentTimeMillis();

    final HashSet/*String*/ onDemandConflicts= new HashSet();

    IJavaSearchScope scope= SearchEngine.createJavaSearchScope(new IJavaElement[] { this.compilationUnit.getJavaProject() });

    ArrayList/*<char[][]>*/  starImportPackages= new ArrayList();
    ArrayList/*<char[][]>*/ simpleTypeNames= new ArrayList();
    int nPackageEntries= this.packageEntries.size();
    for (int i= 0; i < nPackageEntries; i++) {
View Full Code Here

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

  }
 
  @Test
  public void learning_SearchEngine() throws Exception {
    SearchEngine engine = new SearchEngine();
    IJavaSearchScope scope = SearchEngine.createWorkspaceScope();
    SearchPattern pattern = SearchPattern.createPattern("TestClass2", IJavaSearchConstants.CLASS, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_FULL_MATCH);
    SearchParticipant[] participants = new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()};
    SearchRequestor requestor = new SearchRequestor(){
   
      @Override
View Full Code Here

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

  }

  private void search(SearchPattern pattern) {
    try {
      SearchEngine engine = new SearchEngine();
      IJavaSearchScope scope = SearchEngine.createWorkspaceScope();
      SearchParticipant[] participants = new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()};
      engine.search(pattern, participants, scope, requestor, monitor);
    } catch (CoreException e) {
      JavaDocActivator.getDefault().handleSystemError(e, this);
    }
View Full Code Here

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

    /**
     * Show a dialog that lists all main types
     */
    protected void handleSearchButtonSelected() {
        try {
            IJavaSearchScope searchScope = createSearchScope("org.nakedobjects.nof.core.persist.Fixture");
            SelectionDialog dialog = null;
                dialog = JavaUI.createTypeDialog(
                            getTab().getShell(),
                            getTab().getLaunchConfigurationDialog(),
                            searchScope,
View Full Code Here

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

 
  public void populate(IProgressMonitor monitor) throws CoreException {
    SearchEngine engine = new SearchEngine();
    SearchPattern pattern = SearchPattern.createPattern("Relation", IJavaSearchConstants.ANNOTATION_TYPE, IJavaSearchConstants.ANNOTATION_TYPE_REFERENCE, SearchPattern.R_EXACT_MATCH | SearchPattern.R_CASE_SENSITIVE);
    SearchParticipant[] participants = new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()};
    IJavaSearchScope scope = SearchEngine.createWorkspaceScope();
   
    engine.search(pattern, participants, scope, this, monitor);
  }
View Full Code Here

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

 
  public void populate(IProgressMonitor monitor) throws CoreException {
    SearchEngine engine = new SearchEngine();
    SearchPattern pattern = SearchPattern.createPattern("Constraint", IJavaSearchConstants.ANNOTATION_TYPE, IJavaSearchConstants.ANNOTATION_TYPE_REFERENCE, SearchPattern.R_EXACT_MATCH | SearchPattern.R_CASE_SENSITIVE);
    SearchParticipant[] participants = new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()};
    IJavaSearchScope scope = SearchEngine.createWorkspaceScope();
   
    ConstraintRequestor consReq = new ConstraintRequestor(rels);   
    engine.search(pattern, participants, scope, consReq, monitor);
    constraints.addAll(consReq.getConstraints());
   
View Full Code Here

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

  public void populate(IProgressMonitor monitor) throws CoreException {
    SearchEngine engine = new SearchEngine();
    SearchPattern pattern = SearchPattern.createPattern("Infer", IJavaSearchConstants.ANNOTATION_TYPE, IJavaSearchConstants.ANNOTATION_TYPE_REFERENCE, SearchPattern.R_EXACT_MATCH | SearchPattern.R_CASE_SENSITIVE);
    SearchParticipant[] participants = new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()};
    IJavaSearchScope scope = SearchEngine.createWorkspaceScope();
    InferRequestor requestor = new InferRequestor(rels);
   
    engine.search(pattern, participants, scope, requestor, monitor);
    inferRules.addAll(requestor.getRules());
  }
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.