Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Behavior of IWorkspace.run()
Behavior of IWorkspace.run() [message #264474] Thu, 29 July 2004 11:33 Go to next message
Eclipse UserFriend
Originally posted by: dr_wack.email.com

I want to know that when we run some actions that make changes to the work
space, but in the IWorkspaceRunnable.run() method that we pass onto
Workspace.run(). Then, how does the workspace comes to know that what
changes have been made to the workspace.

For example i run a tool that creates a zip file of some of the resources i
put this action in this run method but when the method returns the workspace
doesnt show the zip file in the navigatro view. Althought it is there in the
file system. It appears if i refresh it. (I am using eclipse 2.1)

Do i need to perform some other tasks like create or modify the delta and
return it back or somehow hint the workspace as to what and where the change
has occured or does the workspace automatically detects all the changes once
the run has been called.

Please help me on this i am stuck at this and i have no idea what the
problem could be.
Re: Behavior of IWorkspace.run() [message #264494 is a reply to message #264474] Thu, 29 July 2004 14:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

If you use the Eclipse methods to modify files (e.g.
IFile.setContents()) or modify folders (e.g. IFolder.create(...)) etc.,
then Eclipse knows immediately you changed something and you don't to
tell it so.

But if you go straight to the file system then Eclipse doesn't know you
did anything. You have to tell it you did something within the runnable
by doing an explicit refresh within the runnable. To programatically do
a refresh you must use IResource.refreshLocal(...) If you do this on a
folder and tell it to recurse by using a depth of
IResource.DEPTH_INFINITE it will walk through the folder and all
subfolders to see what files have been touched. It will then update its
own internal tables.
--
Thanks, Rich Kulp

Re: Behavior of IWorkspace.run() [message #264544 is a reply to message #264474] Thu, 29 July 2004 17:03 Go to previous message
Eclipse UserFriend
Originally posted by: chris.eclipsefaq.org

Wiki Criki wrote:

> I want to know that when we run some actions that make changes to the work
> space, but in the IWorkspaceRunnable.run() method that we pass onto
> Workspace.run(). Then, how does the workspace comes to know that what
> changes have been made to the workspace.

There is a pretty good discussion on this topic at

http://eclipsefaq.org, Chapter 17, Workspace and Resources API
FAQ 289 – How can I be notified of changes to the workspace?

Chris
Previous Topic:Develop with J2ME on a Mac
Next Topic:Generating Ant scripts from the command line
Goto Forum:
  


Current Time: Thu May 15 19:30:58 EDT 2025

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

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

Back to the top