Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Handling editor input load failure
Handling editor input load failure [message #316819] Tue, 19 June 2007 12:01 Go to next message
Eclipse UserFriend
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 #316825 is a reply to message #316819] Tue, 19 June 2007 13:35 Go to previous messageGo to next message
Eclipse UserFriend
Depending on just how long the "lag" can be you have 2 choices (which
you've already outlined :-)

1) just try and get the content during the init(*). The downside is
that if it does take >1second eclipse will appear frozen unless you are
spinning the event loop yourself ... which may or may not have
interesting consequences while opening an editor. Also as you mentioned
the handling of a PartInitException on failure can leave the user
feeling queasy :-)

2) Just open the editor with a "Connecting to server ... retrieving
data" message. If it fails, fill in the editor with an appropriate
error message (failed to connect, invalid key, object not found, etc)
and a "Retry" button or instructions to close the editor.


#2 is more work on your part but is potentially more useful to your users.


Please take my suggestions with a grain of salt.

PW
Re: Handling editor input load failure [message #316839 is a reply to message #316819] Tue, 19 June 2007 21:05 Go to previous message
Eclipse UserFriend
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.
Previous Topic:How to programmatically find execution environment of ECLIPSE?
Next Topic:How to clean the unused externalized strings
Goto Forum:
  


Current Time: Thu May 29 08:46:11 EDT 2025

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

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

Back to the top