Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » executing at post_change event
executing at post_change event [message #323893] Fri, 11 January 2008 08:20 Go to next message
Eclipse UserFriend
Originally posted by: nclauwers.gmail.com

Hey,

I want to add a builder to all projects that are created. I can listen to
newly created projects via a ResourceChangeListener but I cannot attach a
builder to a project at a post_change event. This is normal but is there
any way to circumvent this?

I found some hints about a WorkspaceRunnable, but I do not know how to
delay this job until after the post_change event.

Thanks in advance for any help.

Niels
Re: executing at post_change event [message #323900 is a reply to message #323893] Fri, 11 January 2008 13:14 Go to previous message
Eclipse UserFriend
Do something like this:

WorkspaceJob job = new WorkspaceJob("Resource Changes")
{
@Override
public IStatus runInWorkspace(IProgressMonitor monitor)
throws CoreException
{
// Do your work

return Status.OK_STATUS;
}
};

job.setRule(yourProject);
job.schedule();

The scheduling rule (job.setRule()) will make sure it runs only when
it's safe to do so.

Niels wrote:
> Hey,
>
> I want to add a builder to all projects that are created. I can listen
> to newly created projects via a ResourceChangeListener but I cannot
> attach a builder to a project at a post_change event. This is normal but
> is there any way to circumvent this?
>
> I found some hints about a WorkspaceRunnable, but I do not know how to
> delay this job until after the post_change event.
>
> Thanks in advance for any help.
>
> Niels
>
>
>
Previous Topic:Clear Bold Tab Highlight (warnOfContentChange)
Next Topic:How to programmatically select the existing projects into workspace ?
Goto Forum:
  


Current Time: Mon Jul 14 22:17:50 EDT 2025

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

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

Back to the top