Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » How to create hidden IJavaProject
How to create hidden IJavaProject [message #663892] Wed, 06 April 2011 17:59 Go to next message
imediava  is currently offline imediava Friend
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?
Re: How to create hidden IJavaProject [message #663987 is a reply to message #663892] Thu, 07 April 2011 05:23 Go to previous messageGo to next message
Prakash G.R. is currently offline Prakash G.R.Friend
Messages: 621
Registered: July 2009
Senior Member
On 06/04/11 11:29 PM, imediava wrote:

> 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?

IResource.isHidden() is for the hidden files in the disk. You should
implement org.eclipse.jdt.ui.javaElementFilters

--
- Prakash
Platform UI Team, IBM

www.eclipse-tips.com
Re: How to create hidden IJavaProject [message #666901 is a reply to message #663892] Sun, 24 April 2011 05:01 Go to previous message
Kivanc Muslu is currently offline Kivanc MusluFriend
Messages: 153
Registered: November 2010
Senior Member
This saved my life.

Thanks a lot!
Previous Topic:Serial Support in Java
Next Topic:[SOLVED] Is it possible to hide projects in the workspace from user view?
Goto Forum:
  


Current Time: Thu Apr 25 19:46:47 GMT 2024

Powered by FUDForum. Page generated in 0.02840 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top