Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Batching resource deletion - IWorkspaceRunnable?
Batching resource deletion - IWorkspaceRunnable? [message #293155] Wed, 19 October 2005 04:30 Go to next message
Eclipse UserFriend
Originally posted by: jmalone.infotec.de

Hi,

I want to delete a folder with multiple files and then update a custom
view with the contents of the current active editor, if there is one. The
custom view is associated with the IFile of the active editor plus another
IFile.

What I am currently doing is using a ResourceChangeListener and updating
the view after each deletion, but this causes some problems as the view
tries to update with information from a file that may have been deleted
already.

Is there any way to block a folder deletion, so that a notification will
be sent only after ALL deletions have taken place. I've been looking
around and think that IWorkspaceRunnable or 'batching' may help, but don't
really know how to use it. Is this used instead of a
ResourceChangeListener or as well as? Some sample code might help.

Thanks
Jen
Re: Batching resource deletion - IWorkspaceRunnable? [message #293229 is a reply to message #293155] Thu, 20 October 2005 06:51 Go to previous message
Eclipse UserFriend
Originally posted by: jmalone.infotec.de

Hi,
Ok, I've been looking a bit more into IWorkspaceRunnable and it really
seems like it could solve my problem. The only thing is, in all examples
the resources are modified programmatically. e.g.

public class Test implements IWorkspaceRunnable
{
...........
...........


public void run( IProgressMonitor monitor ) throws CoreException
{
...........
...........

createFolder( "Folder A" );
createFile( "File A_1" );
createFile( "File A_2" );

deleteFolder( "Folder B" );
deleteFile( "File B_1" );
}
}


Is it possible to use IWorkspaceRunnable when you delete a resource from
the Navigator, using the standard 'Delete' command? If so, then how would
you contain this within the run method? I would like to delete a
resource, and then, only after all the descendents of the resource are
deleted recursively, would I want a deletion notification event to occur.

I appreciate any help.

Thanks, Jen





Jen wrote:

> Hi,

> I want to delete a folder with multiple files and then update a custom
> view with the contents of the current active editor, if there is one. The
> custom view is associated with the IFile of the active editor plus another
> IFile.

> What I am currently doing is using a ResourceChangeListener and updating
> the view after each deletion, but this causes some problems as the view
> tries to update with information from a file that may have been deleted
> already.

> Is there any way to block a folder deletion, so that a notification will
> be sent only after ALL deletions have taken place. I've been looking
> around and think that IWorkspaceRunnable or 'batching' may help, but don't
> really know how to use it. Is this used instead of a
> ResourceChangeListener or as well as? Some sample code might help.

> Thanks
> Jen
Previous Topic:Duplicate Nodes on TreeViewer Refresh
Next Topic:NewWorkingsSet and NewProject in ONE WizardDialog
Goto Forum:
  


Current Time: Mon Jul 14 02:52:50 EDT 2025

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

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

Back to the top