[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.jdt] Re: Problem: Class after creation not found in model

Jerome Lanneluc wrote:

Could it be that the source of Simple.java doesn't contain a package declaration ? e.g.
"package de.unikassel.janus.tests.autocompletion;" +
"public class Simple {" +
"}".
Also how do you use the SearchEngine ? What waiting policy do you use ?

i have added the package, but still no results. Waht iam doing is: packageFragment = packageFragmentRoot.createPackageFragment("de.unikassel.janus.tests.autocompletion2", true, null); compilationUnit = packageFragment.createCompilationUnit("Simple.java", "package de.unikassel.janus.tests.autocompletion2;\n" + "class Simple {\n" + "}", true, null); javaProject.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null); Platform.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD, null); Platform.getJobManager().join(ResourcesPlugin.FAMILY_MANUAL_BUILD, null);

After that i use basicly the SearchEngine like this:
searchEngine.searchAllTypeNames(
	packageName.toCharArray(),//final char[] packageName,
	SearchPattern.R_PATTERN_MATCH,//final int packageMatchRule,
        "Simpl".toCharArray(),
        SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CAMELCASE_MATCH,//final int typeMatchRule,
        IJavaSearchConstants.TYPE,//int searchFor,
        scope,//IJavaSearchScope scope,
        typeInfoRequestor,//final TypeNameMatchRequestor nameMatchRequestor,
        IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,//int waitingPolicy,
        null//IProgressMonitor progressMonitor
        );

But still no results.
If i try it in the working code, like opening our graphical editor,
rightclick on src folder in Package View, create class Simple and use then
an autocompletion in any of our type-autocompletion-enabled elements,
Simple is found and inserted correctly.

I tried it also with IJavaSearchConstants.FORCE_IMMEDIATE_SEARCH


Kind regards,

Dennis Keßler