|
|
|
|
|
|
|
|
Re: IResourceChangeListener's PRE_DELETE event not work for IFile [message #312300 is a reply to message #312263] |
Tue, 06 February 2007 08:41   |
Eclipse User |
|
|
|
David,
The Resource model of Eclipse is optimized for the standard cases you
would get during code development. What you are describing sounds more
like a database that is contained in a file. Do you gain anything by
having your files appear in a workspace project? (i.e. Are they shared
with a code repository? Can users rename a file?). If you are not
getting much benefit from the Resource model, you may want to consider
creating your own model.
If you feel you want to stick with using Workspace projects, you may
want to check out this link and specifically the ResourceChangeValidator.
http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/team_model_model.htm
It won't give you a chance to close the file but it will give you a
chance to warn the user that they either need to close the editor first
or, better yet, run the delete operation that you provide so that all
the necessary cleanup happens.
Michael
David Kyle wrote:
> Look in Resource#unprotectedDelete(...) to see that the deletion of a
> IResource.FILE and IResource.FOLDER do not call a workspace broadcast with a
> PRE_DELETE event.
>
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=48291 was filled back in 2003
> about this lack of functionality and according to John it will not be fixed.
>
> It is causing us problems since we need to keep files (+1 Terabyte) open and
> we need the PRE_DELETE event to know to close the file so it can be deleted
> and its editor can be closed.
>
> David
>
> "John Arthorne" <john@eclipsefaq.org> wrote in message
> news:epqma1$5eb$2@utils.eclipse.org...
>> There is no event that occurs before deletion of a file.
>> --
>>
>> Eddie Man wrote:
>>> But I need to get the contents of the file, so cannot using POST_CHANGE
>>> event, any alternative?
>>>
>>> claire reynaud wrote:
>>>
>>>> Eddie Man a écrit :
>>>>
>>>>> I had register a IResourceChangeListener to the workspace (PRE_DELETE
>>>>> | PRE_CLOSE), but I found that this listener does not work for delete
>>>>> a IFile in the navigator view.
>>>>
>>>> IResourceChangeEvent.PRE_CLOSE and IResourceChangeEvent.PRE_DELETE are
>>>> projects events. You should use IResourceChangeEvent.POST_CHANGE to
>>>> get notified of a file deletion.
>>>> See IResourceChangeEvent javadoc.
>>>>
>>>> Regards,
>>>> Claire
>>>>
>>>> Did I get any wrong? or anyway can do that?
>>>>
>>>>> Thanks
>>>>> Eddie
>
>
|
|
|
|
Re: IResourceChangeListener's PRE_DELETE event not work for IFile [message #312322 is a reply to message #312300] |
Tue, 06 February 2007 11:17  |
Eclipse User |
|
|
|
Michael,
You are correct in thinking of the seismic file as a database. The files are
produced from a processing engine which can run for hours to weeks at a
time, on one or more CPU clusters (50+ CPUs per cluster). The data is stored
in a "flat" file for performance reasons. No SQL database on earth can
manipulate the data fast enough for us.
http://grus.berkeley.edu/~jrg/ngst/fft/salt.gif
Imagine this image to be 3 meters high and 30 meters wide at 90 DPI. A
seismic file would contain hundreds if not thousands of these slices. We
render any part of the seismic file as fast as the user can hit the keyboard
to switch from one slice to the next, zoom in/out, or scroll about. All in
java. All in Eclipse RCP.
We gain a great deal from having the seismic files in the workspace. It
allows our users to opt out of using our Eclipse RCP based interactive and
deal directly with the NFS files. The typical user workspace contains
numerous projects and thousands of files. We link to a number of high
performance disk farms (usually 11TB or larger). Typical seismic file sizes
are 20 GB with extremely large files in the 800GB to 1 TB. The users also
need to deal with image files (GIF, PNG, JPG), text files, PDF files, etc.
The size and speed at which we have to manipulate the seismic files usually
"break" typical software and hardware systems. We have been impressed with
how little of Eclipse RCP has "broken" under our extreme demands.
In our context, the workspace has nothing to do with traditional java source
code. In fact our users are not programmers but geophysicists.
Aside from the missing PRE_DELETE event on IFile and IFolders we see alot of
benefit from the resource model. It allows us to bring in eclipse and third
party plugins.
David
"Michael Valenta" <Michael_Valenta@ca.ibm.com> wrote in message
news:eqa0gq$sui$1@utils.eclipse.org...
> David,
>
> The Resource model of Eclipse is optimized for the standard cases you
> would get during code development. What you are describing sounds more
> like a database that is contained in a file. Do you gain anything by
> having your files appear in a workspace project? (i.e. Are they shared
> with a code repository? Can users rename a file?). If you are not
> getting much benefit from the Resource model, you may want to consider
> creating your own model.
>
> If you feel you want to stick with using Workspace projects, you may
> want to check out this link and specifically the ResourceChangeValidator.
>
>
http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/team_model_model.htm
>
> It won't give you a chance to close the file but it will give you a
> chance to warn the user that they either need to close the editor first
> or, better yet, run the delete operation that you provide so that all
> the necessary cleanup happens.
>
> Michael
>
>
>
> David Kyle wrote:
> > Look in Resource#unprotectedDelete(...) to see that the deletion of a
> > IResource.FILE and IResource.FOLDER do not call a workspace broadcast
with a
> > PRE_DELETE event.
> >
> > https://bugs.eclipse.org/bugs/show_bug.cgi?id=48291 was filled back in
2003
> > about this lack of functionality and according to John it will not be
fixed.
> >
> > It is causing us problems since we need to keep files (+1 Terabyte) open
and
> > we need the PRE_DELETE event to know to close the file so it can be
deleted
> > and its editor can be closed.
> >
> > David
> >
> > "John Arthorne" <john@eclipsefaq.org> wrote in message
> > news:epqma1$5eb$2@utils.eclipse.org...
> >> There is no event that occurs before deletion of a file.
> >> --
> >>
> >> Eddie Man wrote:
> >>> But I need to get the contents of the file, so cannot using
POST_CHANGE
> >>> event, any alternative?
> >>>
> >>> claire reynaud wrote:
> >>>
> >>>> Eddie Man a
|
|
|
Powered by
FUDForum. Page generated in 0.04475 seconds