Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Handling page load errors with SWT browser.
Handling page load errors with SWT browser. [message #765035] Tue, 13 December 2011 09:58 Go to next message
kris Jacobs is currently offline kris Jacobs
Messages: 1
Registered: March 2011
Junior Member
Hi,

For our eclipse application we display some help content using a SWT browser. The content is available both online and offline, the intention being that if the user cannot get to the online site, they can still view the offline content.

I'd like to be able catch any page loading errors (for example, if the user loses their network connection), then offer them the option of going offline instead. However, I cant seem to find any way to do this. Does anyone know if it is possible to somehow check for/get notifications of page load errors using the SWT browser?

Thanks in advance,
Kris.
Re: Handling page load errors with SWT browser. [message #765169 is a reply to message #765035] Tue, 13 December 2011 14:52 Go to previous message
Grant Gayed is currently offline Grant Gayed
Messages: 2151
Registered: July 2009
Senior Member
Hi Kris,

Unfortunately the Browser does not send a notification for handling
errors, the existing request for this is
https://bugs.eclipse.org/bugs/show_bug.cgi?id=98302 . The main reason
this has not been implemented is because mozilla-based renderers do not
provide support for this (at least they didn't last time I checked). I
think this would be valuable to have.

Given that your case is specific (you're showing your own help content),
you could probably infer a load failure by adding a ProgressListener to
the Browser and in its completed() implementation checking the Browser's
url and page content (getText()) to see if the navigate appears to have
succeeded. This is not ideal in a few ways (for instance the native
browser's "could not load page" error screen or prompter would appear),
but it should at least give you a way of taking a recovery step.

HTH,
Grant


On 12/13/2011 4:58 AM, kris Jacobs wrote:
> Hi,
>
> For our eclipse application we display some help content using a SWT
> browser. The content is available both online and offline, the intention
> being that if the user cannot get to the online site, they can still
> view the offline content.
> I'd like to be able catch any page loading errors (for example, if the
> user loses their network connection), then offer them the option of
> going offline instead. However, I cant seem to find any way to do this.
> Does anyone know if it is possible to somehow check for/get
> notifications of page load errors using the SWT browser?
>
> Thanks in advance,
> Kris.
Previous Topic:Custom TabFolder
Next Topic:ScroolBar and Group
Goto Forum:
  


Current Time: Tue Sep 16 05:05:26 GMT 2014

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

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