How to create hidden IJavaProject [message #663892] |
Wed, 06 April 2011 17:59 |
imediava Messages: 9 Registered: February 2011 |
Junior Member |
|
|
Hi,
I'm a developing an Eclipse plugin where I need to create a IJavaProject that i don't want the user of my plugin to see. I'm creating the IJavaProject cause that let me add it some libraries and binaries to the classpath with attached javadoc documentation. Then with
javaProject.findType(typeFullyQualifiedName)
.getAttachedJavadoc(null)
i can access the javadoc description of any class in the classpath of the IJavaProject.
The problem is that the user should be completely unaware of the project i'm creating. But that's not what's happening cause now when i create the project the user of my plugin can see it in his workspace. I've tried setting the hidden attribute for the project in many ways but that doesn't seem to work. This is the way i create the project:
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
IProject project = root.getProject(JAVA_DOC_READER_PROJECT);
project.delete(true, null);
IProjectDescription description =
ResourcesPlugin.getWorkspace().newProjectDescription
(JAVA_DOC_READER_PROJECT);
String[] natures = description.getNatureIds();
String[] newNatures = new String[natures.length + 1];
System.arraycopy(natures, 0, newNatures, 0, natures.length);
newNatures[natures.length] = JavaCore.NATURE_ID;
description.setNatureIds(newNatures);
project.create(description, IResource.HIDDEN , null);
System.out.println(project.isHidden());
javaProject = JavaCore.create(project)
and that last project.isHidden() returns true, yet when i execute the code i can see the project in my workspace.
Does anybody now of a way to hide that project so it can't be seen?
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02840 seconds