[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

Dennis Keßler wrote:
Hello,
we are working on some Tests for our Plugin.
There we need to build some classes from scratch:

IPackageFragmentRoot packageFragmentRoot = javaProject.getPackageFragmentRoot(javaProject.getResource());
IPackageFragment packageFragment = packageFragmentRoot.createPackageFragment("de.unikassel.janus.tests.autocompletion", true, null);
ICompilationUnit compilationUnit = packageFragment.createCompilationUnit("Simple.java",
"class Simple {" +
"}",
true, null);


After creation, the .java and .class files are found where expected and with right content,
but if try to find the class via SearchEngine.searchAllTypeNames i dont find it?


What did we miss? And what do we need to do, to get the new created classes into the model?
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 ?