Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Atomic workspace changes
Atomic workspace changes [message #290730] Tue, 30 August 2005 23:34 Go to next message
Eclipse UserFriend
Originally posted by: thhal.mailblocks.com

I've tried a couple of different methods to postpone all
IResourceChangeEvents issued from my workspace. None of them works it
seems. I read up on resource change listeners in this article
http://www.eclipse.org/articles/Article-Resource-deltas/reso urce-deltas.html.
It was helpful but it didn't solve my problem.

Here's what I'm trying to do:

I have a long running operation that creates several projects in my
workspace by downloading them from various sources. A lot of
File.create() happens. No matter what I do, at least one project
suddenly shows up in my navigator long before the operation is complete.
If I debug my Eclipse IDE, and set a breakpoint in the
NotificationManager.notify() method, then sure enough, notifications are
issued. They stem from a Workspace.endOperation() call made by
File.create().

I have tried using a WorkspaceModifyOperation, a IWorkspaceRunnable, and
a WorkspaceJob. Setting the IWorkspace.AVOID_UPDATE status doesn't help.
Using the workspace root as an ISchedulingRule doesn't help either.

Is there really no way to make the notifier shut up completely during an
operation?

Regards,
Thomas Hallgren
Re: Atomic workspace changes [message #290741 is a reply to message #290730] Wed, 31 August 2005 08:21 Go to previous message
Eclipse UserFriend
Originally posted by: thhal.mailblocks.com

I figured this one out myself. Perhaps my solution can help someone else
so here it is.

I subclass a WorkspaceJob and in the runInWorkspace method, I suspend
all other jobs, like this:

public IStatus runInWorkspace(IProgressMonitor monitor)
throws CoreException {
IJobManager jobManager = Platform.getJobManager();

// Suspend all other jobs for now. This one is already running
// and will not be affected.
//
jobManager.suspend();
try {
// Do the job here ...
} finally {
jobManager.resume();
}
return Status.OK_STATUS;
}

Regards,
Thomas Hallgren


Thomas Hallgren wrote:
> I've tried a couple of different methods to postpone all
> IResourceChangeEvents issued from my workspace. None of them works it
> seems. I read up on resource change listeners in this article
> http://www.eclipse.org/articles/Article-Resource-deltas/reso urce-deltas.html.
> It was helpful but it didn't solve my problem.
>
> Here's what I'm trying to do:
>
> I have a long running operation that creates several projects in my
> workspace by downloading them from various sources. A lot of
> File.create() happens. No matter what I do, at least one project
> suddenly shows up in my navigator long before the operation is complete.
> If I debug my Eclipse IDE, and set a breakpoint in the
> NotificationManager.notify() method, then sure enough, notifications are
> issued. They stem from a Workspace.endOperation() call made by
> File.create().
>
> I have tried using a WorkspaceModifyOperation, a IWorkspaceRunnable, and
> a WorkspaceJob. Setting the IWorkspace.AVOID_UPDATE status doesn't help.
> Using the workspace root as an ISchedulingRule doesn't help either.
>
> Is there really no way to make the notifier shut up completely during an
> operation?
>
> Regards,
> Thomas Hallgren
Previous Topic:Export not listing classes for main selection
Next Topic:problem with a plug-in depending on another project
Goto Forum:
  


Current Time: Sat Jun 08 11:56:49 GMT 2024

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

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

Back to the top