Creating files in a project folder [message #605720] |
Sun, 02 May 2010 16:59  |
Eclipse User |
|
|
|
I'm working on a Plug-in that creates a bunch of Java files in a folder in the project. The files are created by a Job to avoid problems with blocking the GUI parts. It is taking longer than it would seem like it should (about 1 second per file, and the largest file is only 19K bytes with most of them being 1K-2K in size).
It seems like after each file is created, some Eclipse code is doing a synchronization with SVN and/or compiling the file.
I would like it if I could somehow defer the "background" file processing until after I've written all of the files. I am updating a view in my plug-in with progress and I'd like that to be quick. The files will not be used immediately so I can easily wait a bit for Eclipse to do the behind the scenes work after the fact.
In my Job, I call setRule with the IFolder object into which I'm writing all of the files. Is there more that can be done to defer things until after "my" work is done?
I'm using Display.asynchExec to run the code that updates the GUI so that should not be the problem. (I commented out the calls to asynchExec and the time did not improve.)
Thanks
Dave Patterson
|
|
|
Re: Creating files in a project folder [message #605724 is a reply to message #605720] |
Mon, 03 May 2010 05:47  |
Eclipse User |
|
|
|
Hi Dave,
for initiating the workspace to be re-build after all of your changes
are completed you should consider IWorkspaceRunnable. For further
information look here:
http://wiki.eclipse.org/FAQ_What_are_IWorkspaceRunnable,_IRu nnableWithProgress,_and_WorkspaceModifyOperation%3F
best regards,
Jan
David Patterson wrote:
> I'm working on a Plug-in that creates a bunch of Java files in a folder
> in the project. The files are created by a Job to avoid problems with
> blocking the GUI parts. It is taking longer than it would seem like it
> should (about 1 second per file, and the largest file is only 19K bytes
> with most of them being 1K-2K in size).
>
> It seems like after each file is created, some Eclipse code is doing a
> synchronization with SVN and/or compiling the file.
>
> I would like it if I could somehow defer the "background" file
> processing until after I've written all of the files. I am updating a
> view in my plug-in with progress and I'd like that to be quick. The
> files will not be used immediately so I can easily wait a bit for
> Eclipse to do the behind the scenes work after the fact.
> In my Job, I call setRule with the IFolder object into which I'm
> writing all of the files. Is there more that can be done to defer things
> until after "my" work is done?
>
> I'm using Display.asynchExec to run the code that updates the GUI so
> that should not be the problem. (I commented out the calls to asynchExec
> and the time did not improve.)
>
> Thanks
>
> Dave Patterson .
|
|
|
Powered by
FUDForum. Page generated in 0.04038 seconds