[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:
Jerome Lanneluc wrote:
There must be something else going on with your code. I ran the
following test successfully
(ie. it printed "de.unikassel.janus.tests.autocompletion2.Simple" to
the console):...
As i tested further, i found an exception:
Java Model Exception: Java Model Status
[de.unikassel.janus.tests.autocompletion is read-only]
at this line:
IPackageFragment packageFragment =
packageFragmentRoot.createPackageFragment("de.unikassel.janus.tests.autocompletion",
true, null);
It means that the package already exists on disk and that it has been set to read-only on the file system.
Whats the meaning of this? Maybe we are doing something wrong at
Projectcreation..
Can you Post your IJavaProject javaProject = createJavaProject("P"); code?
public IJavaProject createJavaProject(String projectName) throws CoreException {
IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
IProject project = workspaceRoot.getProject(projectName);
project.create(null);
project.open(null);
IProjectDescription description = project.getDescription();
description.setNatureIds(new String[] {JavaCore.NATURE_ID});
project.setDescription(description, null);
IJavaProject javaProject = JavaCore.create(project);
javaProject.setRawClasspath(
new IClasspathEntry[] {
JavaCore.newSourceEntry(project.getFullPath())
},
null);
return javaProject;
}