Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Why eclipse resource is "(not open)"?
Why eclipse resource is "(not open)"? [message #998955] Fri, 11 January 2013 03:07 Go to next message
Sungmin Cho is currently offline Sungmin Cho
Messages: 9
Registered: October 2012
Junior Member
I have a project in eclipse workspace.

http://i.stack.imgur.com/tMqOt.png

When I open this project as IJavaProject using the following code, I have the project "not open".

IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
IProject orig = root.getProject(this.projectName);
orig.open(null /* IProgressMonitor */);
orig.refreshLocal(IResource.DEPTH_ZERO, null);
this.javaProject = JavaCore.create(orig);

I opened the IProject with `open()` method, and refreshed manually using `refreshLocal`.
I have other resources not opened.

I tried "F5" to refresh the project, but it doesn't work.

What might be wrong? How can I open the resources?

http://i.stack.imgur.com/xrEO7.png

http://i.stack.imgur.com/nd3Ik.png
Re: Why eclipse resource is "(not open)"? [message #999201 is a reply to message #998955] Fri, 11 January 2013 14:53 Go to previous messageGo to next message
Curtis Windatt is currently offline Curtis Windatt
Messages: 166
Registered: July 2009
Senior Member
I think you are confused about the resource being open and the java element being open. There should be no need to open the IProject as it is already open in the workspace (you can check with isOpen()). Opening the IJavaProject is different. Opening a Java element opens a memory buffer for the element's contents. JDT will automatically open java elements as you try to access the contents (and cache the information). See org.eclipse.jdt.core.IOpenable for more information.
Re: Why eclipse resource is "(not open)"? [message #999619 is a reply to message #999201] Sat, 12 January 2013 17:15 Go to previous message
Sungmin Cho is currently offline Sungmin Cho
Messages: 9
Registered: October 2012
Junior Member
I got your point. Thanks for your answer!
Previous Topic:Allow users to create hotkeys
Next Topic:How to get all the hierarchical type information?
Goto Forum:
  


Current Time: Sat Oct 25 15:33:23 GMT 2014

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

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