Handling editor input load failure [message #316819] |
Tue, 19 June 2007 12:01  |
Eclipse User |
|
|
|
Originally posted by: ben.vitale.precipia.com
I've got a client server application, with IEditorInputs that hold
lightweight keys to objects on the server.
It's not clear to me, during the opening of the editor, when to process
the key and retrieve the object from the server. This is potentially a
time intensive operation.
Currently I'm doing the work in IEditorPart#init(IEditorSite,
IEditorInput), wrapped in an IRunnableWithProgress. Is there something
inherently wrong with doing the work here? Where/when should it be done?
A related question is how to gracefully handle an error during the
loading of said object. I can throw a PartInitException, but I'm not
thrilled with the "user friendliness" of the presentation of such
exceptions, and I'd rather just show my own error dialog, and abort the
editor initialization. Is this possible? Or should I just capture the
error, notify the user, then closer the editor when the part becomes
activated?
Thanks in advance.
Ben
|
|
|
|
Re: Handling editor input load failure [message #316839 is a reply to message #316819] |
Tue, 19 June 2007 21:05  |
Eclipse User |
|
|
|
Originally posted by: lamont_gilbert.rigidsoftware.com
On Tue, 19 Jun 2007 12:01:47 -0400, Ben Vitale wrote:
> I've got a client server application, with IEditorInputs that hold
> lightweight keys to objects on the server.
>
> It's not clear to me, during the opening of the editor, when to process
> the key and retrieve the object from the server. This is potentially a
> time intensive operation.
>
> Currently I'm doing the work in IEditorPart#init(IEditorSite,
> IEditorInput), wrapped in an IRunnableWithProgress. Is there something
> inherently wrong with doing the work here? Where/when should it be
> done?
>
> A related question is how to gracefully handle an error during the
> loading of said object. I can throw a PartInitException, but I'm not
> thrilled with the "user friendliness" of the presentation of such
> exceptions, and I'd rather just show my own error dialog, and abort the
> editor initialization. Is this possible? Or should I just capture the
> error, notify the user, then closer the editor when the part becomes
> activated?
>
> Thanks in advance.
>
> Ben
This question has been asked about 3 times this week. Maybe its time for
an enhancment request that we all can vote for something more elegant.
|
|
|
Powered by
FUDForum. Page generated in 0.15279 seconds