Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Closing the Project Programatically
Closing the Project Programatically [message #93798] Tue, 15 July 2003 05:15 Go to next message
Eclipse UserFriend
I am just trying to listen the ResourceChangedEvent and on closing the
project i try to reset some persistent properties and then try to close
the project by
IProject.close(new NullProgressMonitor())

org.eclipse.core.internal.resources.ResourceException: The resource tree
is locked for modifications.
at
org.eclipse.core.internal.resources.Workspace.beginOperation (Workspace.java:
144)
at org.eclipse.core.internal.resources.Project.close(Project.ja va:154)
Re: Closing the Project Programatically [message #93922 is a reply to message #93798] Tue, 15 July 2003 09:49 Go to previous messageGo to next message
Eclipse UserFriend
Easwar wrote:
> I am just trying to listen the ResourceChangedEvent and on closing the
> project i try to reset some persistent properties and then try to close
> the project by
> IProject.close(new NullProgressMonitor())
>
> org.eclipse.core.internal.resources.ResourceException: The resource tree
> is locked for modifications.
> at
> org.eclipse.core.internal.resources.Workspace.beginOperation (Workspace.java:
> 144)
> at org.eclipse.core.internal.resources.Project.close(Project.ja va:154)

During a resource change notification the workspace is locked, unless
you listen for PRE_AUTO_BUILD or POST_AUTO_BUILD event types. This has
been discussed in the archives, and there is also an article on resource
change listeners here:

http://www.eclipse.org/articles/Article-Resource-deltas/reso urce-deltas.html

Hope this helps,

Jeff
Re: Closing the Project Programatically [message #93982 is a reply to message #93798] Tue, 15 July 2003 10:05 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.NOSPAM.us.ibm.com

It is already closed by the time you receive the notification, you
shouldn't be trying to close it yourself. During resource notification,
certain modifications to resources aren't permitted because you are in
the process of notifying on those very resources.

If you want to change some persistent properties before closing, listen
for the PRE_CLOSE event type, that way the project won't yet be closed,
you can do your stuff, and then when you are done making your changes
and return from the notification the project will then be closed.

Rich
Previous Topic:builder not running
Next Topic:Adding interactive console
Goto Forum:
  


Current Time: Mon Jul 14 23:21:26 EDT 2025

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

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

Back to the top